48 | | 2. Remove the Forwarding module from the Floodlight OpenFlow controller. Floodlight uses what it calls a '''module loading system''', where the user can write modules to perform a certain task or set of tasks. Each module can register for certain events. For example, the Forwarding module registers for PACKET_IN events where the controller is sent a packet from a connected switch. Upon such an event, the Forwarding module will send the packet out the correct port(s) depending on the destination. This module essentially implements a standard '''learning switch''' function where the OpenFlow-enabled switch behaves as if it were a standard network switch. We do not want this functionality, since we would like to have exclusive control over which port(s) our packets get forwarded. |
49 | | a. In the client and the server nodes, remove the Forwarding module. |
50 | | b. The '''module loading system''' maintains a list of the modules to be loaded at runtime. To remove the Forwarding module from this list (and thus disable it), open the '''/root/floodlight-0.90/src/main/resources/floodlightdefault.properties''' file and remove the line '''net.floodlightcontroller.forwarding.Forwarding,\'''. |
51 | | c. Browse to the root directory of the Floodlight project -- /root/floodlight-0.90. Execute '''ant''' in the terminal. ant is a Java-based build tool to build and compile Java projects. Upon success, ant will produce an updated executable jar file in the /root/floodlight-0.90/target directory named '''floodlight.jar'''. |
52 | | 3. In the client, determine the MAC addresses of the WiMAX and WiFi network interface cards (NICs) for use in OpenFlow flows. |
53 | | a. Load the kernel modules for each of the NICs by executing '''modprobe i2400m_usb''' and '''modprobe ath5k''', respectively. |
54 | | b. After the kernel modules are loaded, the devices should be visible in the system. Execute '''ifconfig wmx0''' and '''ifconfig wlan1''', respectively and note the MAC addresses of each NIC. These will be used in later steps. |
| 48 | 2. In the client, remove the Forwarding module from the Floodlight OpenFlow controller. Floodlight uses what it calls a '''module loading system''', where the user can write modules to perform a certain task or set of tasks. Each module can register for certain events. For example, the Forwarding module registers for PACKET_IN events where the controller is sent a packet from a connected switch. Upon such an event, the Forwarding module will send the packet out the correct port(s) depending on the destination. This module essentially implements a standard '''learning switch''' function where the OpenFlow-enabled switch behaves as if it were a standard network switch. We do not want this functionality, since we would like to have exclusive control over which port(s) our packets get forwarded. |
| 49 | a. Remove the Forwarding module. |
| 50 | b. The '''module loading system''' maintains a list of the modules to be loaded at runtime. To remove the Forwarding module from this list (and thus disable it), open the '''/root/floodlight-0.90/src/main/resources/floodlightdefault.properties''' file and remove the line '''net.floodlightcontroller.forwarding.Forwarding,\'''. |
| 51 | c. Browse to the root directory of the Floodlight project -- '''/root/floodlight-0.90'''. Execute '''ant''' in the terminal. '''ant''' is a Java-based build tool to build and compile Java projects. Upon success, '''ant''' will produce an updated executable jar file in the '''/root/floodlight-0.90/target''' directory named '''floodlight.jar'''. |
| 52 | 3. In the client, determine the MAC addresses of the WiMAX and WiFi network interface cards (NICs). These will be used in OpenFlow flows and will be discussed shortly. |
| 53 | a. Load the kernel modules for each of the NICs by executing '''modprobe i2400m_usb''' and '''modprobe ath5k''', respectively. |
| 54 | b. After the kernel modules are loaded, the devices should be visible in the system. Execute '''ifconfig wmx0''' and '''ifconfig wlan1''', respectively and note the MAC addresses of each NIC. These will be used in later steps. |
83 | | }}} |
84 | | f. Next, we need to remove any running instances of Floodlight and OVS. We do not want more than one instance of these processes running, otherwise chaos might ensue. So, a simple loop and kill works to terminate all running processes. |
85 | | g. Next, we need to create our tap interface. This is the network interface that will funnel all outbound packets from the applications on our client and send them into our OpenVswitch network. |
86 | | {{{ |
| 83 | |
| 84 | SERVER_IP=10.41.14.3 |
| 85 | SERVER_MAC=00:1d:e1:3b:62:a6 |
| 86 | |
| 87 | #IFACE_bridge_A=br_eth |
| 88 | IFACE_bridge_B=br_wifi1 |
| 89 | #IFACE_bridge_C=br_wifi1 |
| 90 | IFACE_bridge_D=br_wimax |
| 91 | IFACE_bridge_E=br_tap |
| 92 | IFACE_bridge_E_IP=10.41.14.1/16 |
| 93 | |
| 94 | #IFACE_A=eth0 |
| 95 | IFACE_B=wlan1 |
| 96 | IFACE_B_AP_ESSID=GENI_WiFi_AP |
| 97 | IFACE_B_AP_MAC=00:60:B3:B0:C6:6C |
| 98 | IFACE_B_AP_channel=11 |
| 99 | IFACE_B_AP_mode=Managed |
| 100 | IFACE_B_kernel_module=ath5k |
| 101 | #IFACE_C=wlan1 |
| 102 | IFACE_D=wmx0 |
| 103 | IFACE_D_network_ID=51 |
| 104 | IFACE_D_DEV_NAME=/dev/sg1 |
| 105 | IFACE_D_kernel_module=i2400m_usb |
| 106 | IFACE_D_MAC=00:1d:e1:3b:48:1d |
| 107 | IFACE_E=tap0 |
| 108 | IFACE_E_MAC=12:51:16:90:8f:ee |
| 109 | |
| 110 | #IFACE_patch_bridge_A_to_bridge_E=eth-tap |
| 111 | #IFACE_patch_bridge_E_to_bridge_A=tap-eth |
| 112 | IFACE_patch_bridge_B_to_bridge_E=wlan1-tap |
| 113 | IFACE_patch_bridge_E_to_bridge_B=tap-wlan1 |
| 114 | #IFACE_patch_bridge_C_to_bridge_E=wlan0-tap |
| 115 | #IFACE_patch_bridge_E_to_bridge_C=tap-wlan0 |
| 116 | IFACE_patch_bridge_D_to_bridge_E=wimax-tap |
| 117 | |
| 118 | OVS_kernel_module_path=/root/openvswitch-1.9.0/datapath/linux/openvswitch.ko |
| 119 | #OVS_switchDPID_A=0000000000000001 |
| 120 | OVS_switchDPID_B=0000000000000002 |
| 121 | #OVS_switchDPID_C=0000000000000003 |
| 122 | OVS_switchDPID_D=0000000000000004 |
| 123 | OVS_switchDPID_E=0000000000000005 |
| 124 | OVS_controllerIP=127.0.0.1:6633 |
| 125 | |
| 126 | FL_contRESTIP=127.0.0.1 |
| 127 | FL_path=/root/floodlight-0.90/target/floodlight.jar |
| 128 | FL_log=/root/floodlight-output |
| 129 | FL_clear_flows_script=/root/SwitchingScripts/clear_flows.sh |
| 130 | FL_initial_flows_script=/root/SwitchingScripts/gec18_switch_to_wifi.sh |
| 131 | ... |
| 132 | }}} |
| 133 | c. Next, we need to remove any running instances of Floodlight and OVS. We do not want more than one instance of these processes running, otherwise chaos might ensue. So, a simple loop and kill works to terminate all running processes. |
| 134 | {{{ |
| 135 | ... |
| 136 | ########## |
| 137 | #CLEAN UP# |
| 138 | ########## |
| 139 | |
| 140 | while [ -n "$(ps aux | grep floodlight | grep -v grep | awk '{print $2}')" ]; |
| 141 | do |
| 142 | echo "PRE: Cleaning up previous Floodlight..." |
| 143 | kill -9 $(ps aux | grep floodlight | grep -v grep | awk '{print $2}') |
| 144 | done |
| 145 | while [ -n "$(ps aux | grep ovs[^_] | grep -v grep | awk '{print $2}')" ]; |
| 146 | do |
| 147 | echo "PRE: Cleaning up previous OVS..." |
| 148 | kill -9 $(ps aux | grep ovs[^_] | grep -v grep | awk '{print $2}') |
| 149 | done |
| 150 | ... |
| 151 | }}} |
| 152 | d. The next thing to do is load our WiFi and WiMAX kernel modules. We have already done this to get the MAC addresses of the interfaces, but we should also do this here so that this script can be run without any prerequisites aside from this initial configuration process. |
| 153 | {{{ |
| 154 | ... |
| 155 | ################# |
| 156 | #ADD WIMAX IFACE# |
| 157 | ################# |
| 158 | |
| 159 | echo "WM: Installing WiMAX kernel module..." |
| 160 | modprobe $IFACE_D_kernel_module |
| 161 | |
| 162 | sleep 3 |
| 163 | |
| 164 | echo "WM: Testing WiMAX connection to basestation..." |
| 165 | wimaxcu roff |
| 166 | sleep 2 |
| 167 | wimaxcu ron |
| 168 | sleep 2 |
| 169 | wimaxcu connect network $IFACE_D_network_ID |
| 170 | |
| 171 | echo "WiFi: Installing WiFi kernel module..." |
| 172 | modprobe $IFACE_B_kernel_module |
| 173 | ... |
| 174 | }}} |
| 175 | e. Next, we need to create our tap interface. This is the network interface that will funnel all outbound packets from the applications on our client and send them into our OpenVswitch network. |
| 176 | {{{ |
| 177 | ... |
135 | | }}} |
136 | | k. Now, we need to take down any pre-existing OVS bridges and create new ones. If we later try to create bridges with the same names, OVS will produce an error. There are options called '''--if-exists''' and '''--may-exists''' that are supposed to allow the creation of an OVS bridge/port under the condition it does not exist already. I have not been able to get these options to work, so we will use Bash scripting instead: |
137 | | {{{ |
138 | | echo "OVS: Removing any existing bridge, $IFACE_bridge_eth $IFACE_bridge_wlan0" |
139 | | echo "OVS: $IFACE_bridge_wimax $IFACE_bridge_int ..." |
140 | | |
141 | | ... |
142 | | |
143 | | ## Wlan0 |
144 | | echo "OVS: Removing any existing bridge, $IFACE_bridge_wlan0..." |
145 | | if [ -n "$(ovs-vsctl show | grep $IFACE_bridge_wlan0)" ] |
146 | | then |
147 | | echo "OVS: ...removing $IFACE_bridge_wlan0" |
148 | | ovs-vsctl del-br $IFACE_bridge_wlan0 |
149 | | fi |
150 | | |
151 | | ## WiMAX |
152 | | if [ -n "$(ovs-vsctl show | grep $IFACE_bridge_wimax)" ] |
153 | | then |
154 | | echo "OVS: ...removing $IFACE_bridge_wimax" |
155 | | ovs-vsctl del-br $IFACE_bridge_wimax |
156 | | fi |
157 | | |
158 | | ## Internal |
159 | | if [ -n "$(ovs-vsctl show | grep $IFACE_bridge_int)" ] |
160 | | then |
161 | | echo "OVS: ...removing $IFACE_bridge_int" |
162 | | ovs-vsctl del-br $IFACE_bridge_int |
163 | | fi |
164 | | |
165 | | ###################### |
166 | | #ADD INTERNAL BRIDGES# |
167 | | ###################### |
168 | | |
169 | | ... |
170 | | |
171 | | ## Wlan0 |
172 | | echo "OVS: Adding interface bridge, $IFACE_bridge_wlan0..." |
173 | | ovs-vsctl add-br $IFACE_bridge_wlan0 |
174 | | echo "OVS: ...with port $IFACE_wlan0" |
175 | | ovs-vsctl add-port $IFACE_bridge_wlan0 $IFACE_wlan0 -- set Interface $IFACE_wlan0 ofport=$port_eth1 |
176 | | echo "OVS: ...with port $IFACE_patch_wlan0_to_tap" |
177 | | ovs-vsctl add-port $IFACE_bridge_wlan0 $IFACE_patch_wlan0_to_tap -- set Interface $IFACE_patch_wlan0_to_tap ofport=$port_wlan0_to_tap |
178 | | |
179 | | ## WiMAX |
180 | | echo "OVS: Adding interface bridge, $IFACE_bridge_wimax..." |
181 | | ovs-vsctl add-br $IFACE_bridge_wimax |
182 | | echo "OVS: ...with port $IFACE_wimax" |
183 | | ovs-vsctl add-port $IFACE_bridge_wimax $IFACE_wimax -- set Interface $IFACE_wimax ofport=$port_eth2 |
184 | | echo "OVS: ...with port $IFACE_patch_wimax_to_tap" |
185 | | ovs-vsctl add-port $IFACE_bridge_wimax $IFACE_patch_wimax_to_tap -- set Interface $IFACE_patch_wimax_to_tap ofport=$port_wimax_to_tap |
186 | | |
187 | | ## Internal |
188 | | echo "OVS: Adding interface bridge, $IFACE_bridge_int..." |
189 | | ovs-vsctl add-br $IFACE_bridge_int |
190 | | echo "OVS: ...with port $IFACE_tap" |
191 | | ovs-vsctl add-port $IFACE_bridge_int $IFACE_tap -- set Interface $IFACE_tap ofport=$port_tap0 |
192 | | #echo "OVS: ...with port $IFACE_patch_tap_to_eth" |
193 | | #ovs-vsctl add-port $IFACE_bridge_int $IFACE_patch_tap_to_eth -- set Interface $IFACE_patch_tap_to_eth ofport=$port_tap_to_eth |
194 | | echo "OVS: ...with port $IFACE_patch_tap_to_wlan0" |
195 | | ovs-vsctl add-port $IFACE_bridge_int $IFACE_patch_tap_to_wlan0 -- set Interface $IFACE_patch_tap_to_wlan0 ofport=$port_tap_to_wlan0 |
196 | | echo "OVS: ...with port $IFACE_patch_tap_to_wimax" |
197 | | ovs-vsctl add-port $IFACE_bridge_int $IFACE_patch_tap_to_wimax -- set Interface $IFACE_patch_tap_to_wimax ofport=$port_tap_to_wimax |
| 226 | ... |
| 227 | }}} |
| 228 | |
| 229 | h. Now, we need to take down any pre-existing OVS bridges and create new ones. If we later try to create bridges with the same names, OVS will produce an error. There are options called '''--if-exists''' and '''--may-exists''' that are supposed to allow the creation of an OVS bridge/port under the condition it does not exist already. I have not been able to get these options to work, so we will use Bash scripting instead: |
| 230 | {{{ |
| 231 | echo "OVS: Removing any existing bridge, $IFACE_bridge_A $IFACE_bridge_B" |
| 232 | echo "OVS: $IFACE_bridge_C $IFACE_bridge_D ..." |
| 233 | |
| 234 | ## Ethernet |
| 235 | #if [ -n "$(ovs-vsctl show | grep $IFACE_bridge_A)" ] |
| 236 | #then |
| 237 | # echo "OVS: ...removing $IFACE_bridge_A" |
| 238 | # ovs-vsctl del-br $IFACE_bridge_A |
| 239 | #fi |
| 240 | |
| 241 | ## Wlan0 |
| 242 | echo "OVS: Removing any existing bridge, $IFACE_bridge_B..." |
| 243 | if [ -n "$(ovs-vsctl show | grep $IFACE_bridge_B)" ] |
| 244 | then |
| 245 | echo "OVS: ...removing $IFACE_bridge_B" |
| 246 | ovs-vsctl del-br $IFACE_bridge_B |
| 247 | fi |
| 248 | |
| 249 | ## Wlan1 |
| 250 | #if [ -n "$(ovs-vsctl show | grep $IFACE_bridge_C)" ] |
| 251 | #then |
| 252 | # echo "OVS: ...removing $IFACE_bridge_C" |
| 253 | # ovs-vsctl del-br $IFACE_bridge_C |
| 254 | #fi |
| 255 | |
| 256 | ## WiMAX |
| 257 | if [ -n "$(ovs-vsctl show | grep $IFACE_bridge_D)" ] |
| 258 | then |
| 259 | echo "OVS: ...removing $IFACE_bridge_D" |
| 260 | ovs-vsctl del-br $IFACE_bridge_D |
| 261 | fi |
| 262 | |
| 263 | ## Tap |
| 264 | if [ -n "$(ovs-vsctl show | grep $IFACE_bridge_E)" ] |
| 265 | then |
| 266 | echo "OVS: ...removing $IFACE_bridge_E" |
| 267 | ovs-vsctl del-br $IFACE_bridge_E |
| 268 | fi |
| 269 | |
| 270 | ## Wlan0 |
| 271 | echo "OVS: Adding interface bridge, $IFACE_bridge_B..." |
| 272 | ovs-vsctl add-br $IFACE_bridge_B |
| 273 | echo "OVS: ...with port $IFACE_B" |
| 274 | ovs-vsctl add-port $IFACE_bridge_B $IFACE_B |
| 275 | echo "OVS: ...with port $IFACE_patch_bridge_B_to_bridge_E" |
| 276 | ovs-vsctl add-port $IFACE_bridge_B $IFACE_patch_bridge_B_to_bridge_E |
| 277 | |
| 278 | ## Wlan1 |
| 279 | #echo "OVS: Adding interface bridge, $IFACE_bridge_C..." |
| 280 | #ovs-vsctl add-br $IFACE_bridge_C |
| 281 | #echo "OVS: ...with port $IFACE_C" |
| 282 | #ovs-vsctl add-port $IFACE_bridge_C $IFACE_C |
| 283 | #echo "OVS: ...with port $IFACE_patch_bridge_C_to_bridge_E" |
| 284 | #ovs-vsctl add-port $IFACE_bridge_C $IFACE_patch_bridge_C_to_bridge_E |
| 285 | |
| 286 | ## WiMAX |
| 287 | echo "OVS: Adding interface bridge, $IFACE_bridge_D..." |
| 288 | ovs-vsctl add-br $IFACE_bridge_D |
| 289 | echo "OVS: ...with port $IFACE_D" |
| 290 | ovs-vsctl add-port $IFACE_bridge_D $IFACE_D |
| 291 | echo "OVS: ...with port $IFACE_patch_bridge_D_to_bridge_E" |
| 292 | ovs-vsctl add-port $IFACE_bridge_D $IFACE_patch_bridge_D_to_bridge_E |
| 293 | |
| 294 | ## Tap |
| 295 | echo "OVS: Adding interface bridge, $IFACE_bridge_E..." |
| 296 | ovs-vsctl add-br $IFACE_bridge_E |
| 297 | echo "OVS: ...with port $IFACE_E" |
| 298 | ovs-vsctl add-port $IFACE_bridge_E $IFACE_E |
| 299 | #echo "OVS: ...with port $IFACE_patch_bridge_E_to_bridge_A" |
| 300 | #ovs-vsctl add-port $IFACE_bridge_E $IFACE_patch_bridge_E_to_bridge_A |
| 301 | echo "OVS: ...with port $IFACE_patch_bridge_E_to_bridge_B" |
| 302 | ovs-vsctl add-port $IFACE_bridge_E $IFACE_patch_bridge_E_to_bridge_B |
| 303 | #echo "OVS: ...with port $IFACE_patch_bridge_E_to_bridge_C" |
| 304 | #ovs-vsctl add-port $IFACE_bridge_E $IFACE_patch_bridge_E_to_bridge_C |
| 305 | echo "OVS: ...with port $IFACE_patch_bridge_E_to_bridge_D" |
| 306 | ovs-vsctl add-port $IFACE_bridge_E $IFACE_patch_bridge_E_to_bridge_D |
| 307 | ... |
205 | | ... |
206 | | |
207 | | echo "OVS: Patching ports $IFACE_patch_tap_to_wlan0, $IFACE_patch_wlan0_to_tap" |
208 | | ovs-vsctl set interface $IFACE_patch_tap_to_wlan0 type=patch |
209 | | ovs-vsctl set interface $IFACE_patch_tap_to_wlan0 options:peer=$IFACE_patch_wlan0_to_tap |
210 | | ovs-vsctl set interface $IFACE_patch_wlan0_to_tap type=patch |
211 | | ovs-vsctl set interface $IFACE_patch_wlan0_to_tap options:peer=$IFACE_patch_tap_to_wlan0 |
212 | | |
213 | | echo "OVS: Patching ports $IFACE_patch_tap_to_wimax, $IFACE_patch_wimax_to_tap" |
214 | | ovs-vsctl set interface $IFACE_patch_tap_to_wimax type=patch |
215 | | ovs-vsctl set interface $IFACE_patch_tap_to_wimax options:peer=$IFACE_patch_wimax_to_tap |
216 | | ovs-vsctl set interface $IFACE_patch_wimax_to_tap type=patch |
217 | | ovs-vsctl set interface $IFACE_patch_wimax_to_tap options:peer=$IFACE_patch_tap_to_wimax |
| 316 | ## Set patch ports |
| 317 | #echo "OVS: Patching ports $IFACE_patch_bridge_E_to_bridge_A, $IFACE_patch_bridge_A_to_bridge_E" |
| 318 | #ovs-vsctl set interface $IFACE_patch_bridge_E_to_bridge_A type=patch |
| 319 | #ovs-vsctl set interface $IFACE_patch_bridge_E_to_bridge_A options:peer=$IFACE_patch_bridge_A_to_bridge_E |
| 320 | #ovs-vsctl set interface $IFACE_patch_bridge_A_to_bridge_E type=patch |
| 321 | #ovs-vsctl set interface $IFACE_patch_bridge_A_to_bridge_E options:peer=$IFACE_patch_bridge_E_to_bridge_A |
| 322 | |
| 323 | echo "OVS: Patching ports $IFACE_patch_bridge_E_to_bridge_B, $IFACE_patch_bridge_B_to_bridge_E" |
| 324 | ovs-vsctl set interface $IFACE_patch_bridge_E_to_bridge_B type=patch |
| 325 | ovs-vsctl set interface $IFACE_patch_bridge_E_to_bridge_B options:peer=$IFACE_patch_bridge_B_to_bridge_E |
| 326 | ovs-vsctl set interface $IFACE_patch_bridge_B_to_bridge_E type=patch |
| 327 | ovs-vsctl set interface $IFACE_patch_bridge_B_to_bridge_E options:peer=$IFACE_patch_bridge_E_to_bridge_B |
| 328 | |
| 329 | #echo "OVS: Patching ports $IFACE_patch_bridge_E_to_bridge_C, $IFACE_patch_bridge_C_to_bridge_E" |
| 330 | #ovs-vsctl set interface $IFACE_patch_bridge_E_to_bridge_C type=patch |
| 331 | #ovs-vsctl set interface $IFACE_patch_bridge_E_to_bridge_C options:peer=$IFACE_patch_bridge_C_to_bridge_E |
| 332 | #ovs-vsctl set interface $IFACE_patch_bridge_C_to_bridge_E type=patch |
| 333 | #ovs-vsctl set interface $IFACE_patch_bridge_C_to_bridge_E options:peer=$IFACE_patch_bridge_E_to_bridge_C |
| 334 | |
| 335 | echo "OVS: Patching ports $IFACE_patch_bridge_E_to_bridge_D, $IFACE_patch_bridge_D_to_bridge_E" |
| 336 | ovs-vsctl set interface $IFACE_patch_bridge_E_to_bridge_D type=patch |
| 337 | ovs-vsctl set interface $IFACE_patch_bridge_E_to_bridge_D options:peer=$IFACE_patch_bridge_D_to_bridge_E |
| 338 | ovs-vsctl set interface $IFACE_patch_bridge_D_to_bridge_E type=patch |
| 339 | ovs-vsctl set interface $IFACE_patch_bridge_D_to_bridge_E options:peer=$IFACE_patch_bridge_E_to_bridge_D |
| 340 | |
287 | | |
288 | | ... |
289 | | |
| 410 | echo "0" > /proc/sys/net/ipv4/conf/all/forwarding |
| 411 | |
| 412 | ## Disable IPv6 |
| 413 | echo "NTWK: Disabling IPv6..." |
| 414 | echo "0" > /proc/sys/net/ipv6/conf/all/disable_ipv6 |
| 415 | |
| 416 | ## Disable IP on interfaces |
| 417 | #echo "NTWK: Taking down $IFACE_A..." |
| 418 | #ifconfig $IFACE_A down |
| 419 | echo "NTWK: Taking down $IFACE_D..." |
| 420 | ifconfig $IFACE_D down |
| 421 | echo "NTWK: Taking down $IFACE_B..." |
| 422 | ifconfig $IFACE_B down |
| 423 | #echo "NTWK: Taking down $IFACE_C..." |
| 424 | #ifconfig $IFACE_C down |
| 425 | #echo "NTWK: Taking down $IFACE_bridge_A..." |
| 426 | #ifconfig $IFACE_bridge_A down |
| 427 | echo "NTWK: Taking down $IFACE_bridge_B..." |
| 428 | ifconfig $IFACE_bridge_B down |
| 429 | #echo "NTWK: Taking down $IFACE_bridge_C..." |
| 430 | #ifconfig $IFACE_bridge_C down |
| 431 | echo "NTWK: Taking down $IFACE_bridge_D..." |
| 432 | ifconfig $IFACE_bridge_D down |
| 433 | sleep 2 |
| 434 | |
| 435 | # The use of ip link over ifconfig is necessary is some cases, especially for WiFi (haven't fully debugged yet) |
| 436 | ip link set dev $IFACE_B down |
| 437 | |
| 438 | echo "NTWK: Bringing all non-bridge interfaces back up..." |
| 439 | ip link set dev $IFACE_B promisc on up |
| 440 | ip link set dev $IFACE_D promisc on up |
| 441 | ip link set dev $IFACE_E promisc on up |
| 442 | ifconfig $IFACE_B 0.0.0.0 |
| 443 | ifconfig $IFACE_D 0.0.0.0 |
| 444 | ifconfig $IFACE_E 0.0.0.0 |
| 445 | |
| 446 | echo "NTWK: Setting MAC of $IFACE_B to $IFACE_D..." |
| 447 | ifconfig $IFACE_B down |
| 448 | ifconfig $IFACE_B hw ether $IFACE_D_MAC |
| 449 | ifconfig $IFACE_B up promisc multicast |
| 450 | echo "NTWK: Connecting $IFACE_B to AP via iwconfig..." |
| 451 | iwconfig $IFACE_B essid $IFACE_B_AP_ESSID ap $IFACE_B_AP_MAC channel $IFACE_B_AP_channel mode $IFACE_B_AP_mode |
| 452 | |
| 453 | echo "NTWK: Connecting $IFACE_D to BS via wimaxcu..." |
| 454 | wimaxcu roff |
| 455 | sleep 2 |
| 456 | wimaxcu ron |
| 457 | sleep 2 |
| 458 | wimaxcu connect network $IFACE_D_network_ID |
| 459 | |
| 460 | echo "NTWK: Bringing all non-IP OVS bridges up..." |
| 461 | ifconfig $IFACE_bridge_B 0.0.0.0 up |
| 462 | ifconfig $IFACE_bridge_D 0.0.0.0 up |
| 463 | |
| 464 | echo "NTWK: Setting IP of $IFACE_bridge_E_IP on $IFACE_bridge_E" |
| 465 | ifconfig $IFACE_bridge_E $IFACE_bridge_E_IP up |
| 466 | |
| 467 | # We can't kill every dhclient process here, since on Orbit, we have a control interface (eth1?) over DHCP it seems |
| 468 | echo "NTWK: Sleeping for a bit while dhclient has a chance to auto-start..." |
| 469 | sleep 10 |
| 470 | |
| 471 | echo "NTWK: Killing any running dhclient processes on $IFACE_D" |
| 472 | pgrep -f dhclient.$IFACE_D |
| 473 | pkill -9 -f dhclient.$IFACE_D |
| 474 | ifconfig $IFACE_D 0.0.0.0 |
| 475 | |
| 476 | echo "NTWK: Inserting static ARP entry to server as $SERVER_IP $SERVER_MAC" |
| 477 | arp -s $SERVER_IP $SERVER_MAC |
| 478 | |
| 479 | echo "NTWK: Pushing initial flows..." |
| 480 | $FL_clear_flows_script |
| 481 | $FL_initial_flows_script |
| 482 | |
| 483 | exit 0 |