52 | | 3. Customize the setup script '''gec18_setup.sh''' in /root/StartupScripts. This script is designed to (1) define user variables, (2) configure the tap interface with OpenVPN, (3) start Floodlight, (4) initialize and start OpenVswitch, and (5) configure Linux networking. |
53 | | a. In the Root Terminal, open a new tab by browsing to File-->Open Tab. |
54 | | b. In the Root Terminal, execute '''ifconfig''': |
| 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. |
| 55 | {{{ |
| 56 | $ ifconfig wmx0 |
| 57 | eth0 Link encap:Ethernet HWaddr 00:0c:29:04:5c:41 |
| 58 | inet addr:192.168.93.128 Bcast:192.168.93.255 Mask:255.255.255.0 |
| 59 | inet6 addr: fe80::20c:29ff:fe04:5c41/64 Scope:Link |
| 60 | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 |
| 61 | RX packets:48 errors:0 dropped:0 overruns:0 frame:0 |
| 62 | TX packets:38 errors:0 dropped:0 overruns:0 carrier:0 |
| 63 | collisions:0 txqueuelen:1000 |
| 64 | RX bytes:8503 (8.3 KiB) TX bytes:6274 (6.1 KiB) |
| 65 | Interrupt:18 Base address:0x1424 |
| 66 | $ ifconfig wlan1 |
| 67 | eth1 Link encap:Ethernet HWaddr 00:0c:29:04:5c:4b |
| 68 | inet addr:192.168.193.132 Bcast:192.168.193.255 Mask:255.255.255.0 |
| 69 | inet6 addr: fe80::20c:29ff:fe04:5c4b/64 Scope:Link |
| 70 | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 |
| 71 | RX packets:152 errors:0 dropped:0 overruns:0 frame:0 |
| 72 | TX packets:26 errors:0 dropped:0 overruns:0 carrier:0 |
| 73 | collisions:0 txqueuelen:1000 |
| 74 | RX bytes:31818 (31.0 KiB) TX bytes:5234 (5.1 KiB) |
| 75 | Interrupt:19 Base address:0x14a4 |
| 76 | }}} |
| 77 | 4. Also in the client, customize the setup script '''gec18_setup.sh''' in /root/StartupScripts. This script is designed to (1) define user variables, (2) configure the tap interface with OpenVPN, (3) start Floodlight, (4) initialize and start OpenVswitch, and (5) configure Linux networking. |
| 78 | |
336 | | 4. Examine the kernel routing table, and create a script to automate adding and removing of IP routes. |
337 | | a. In the Root Terminal, change to the '''eth_control''' directory: |
338 | | {{{ |
339 | | $ cd eth_control |
340 | | $ ls |
341 | | ... delete_route.sh ... |
342 | | }}} |
343 | | b. Determine and note the entries in the kernel IP routing table: |
344 | | {{{ |
345 | | $ route -n |
346 | | Kernel IP routing table |
347 | | Destination Gateway Genmask Flags Metric Ref Use Ifac |
348 | | 192.168.193.0 0.0.0.0 255.255.255.0 U 1 0 0 eth2 |
349 | | 192.168.193.0 0.0.0.0 255.255.255.0 U 1 0 0 eth1 |
350 | | 192.168.93.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0 |
351 | | 0.0.0.0 192.168.93.2 0.0.0.0 UG 0 0 0 eth0 |
352 | | }}} |
353 | | c. With your text editor of choice, open '''delete_route.sh''': |
354 | | {{{ |
355 | | $ gedit delete_route.sh |
356 | | #!/bin/bash |
357 | | |
358 | | echo "Previous routing table:" |
359 | | route -n |
360 | | |
361 | | echo "Delete route for each phyical interface's OVS bridge..." |
362 | | route del -net 192.168.193.0 netmask 255.255.255.0 dev br_wifi0 |
363 | | route del -net 192.168.193.0 netmask 255.255.255.0 dev br_wimax |
364 | | |
365 | | echo "Delete route for each physical interface..." |
366 | | route del -net 192.168.193.0 netmask 255.255.255.0 dev eth1 |
367 | | route del -net 192.168.193.0 netmask 255.255.255.0 dev eth2 |
368 | | |
369 | | echo "Delete default routes..." |
370 | | route delete default dev eth0 |
371 | | |
372 | | echo "Add single default route via OVS tap bridge..." |
373 | | route add default dev br_tap |
374 | | |
375 | | echo "New routing table:" |
376 | | route -n |
377 | | |
378 | | exit 0 |
379 | | }}} |
380 | | Configure the script to remove all routes except a single default route via the br_tap interface. Note, until the '''system_setup.sh''' is executed, there will be no OVS bridge interfaces present. As such, this script will not be run until after '''system_setup.sh'''. (There is no harm in running it now, though. If an attempt is made to add or remove a non-existent route, a error message will be displayed and the script will continue.) |
381 | | d. Save the '''delete_route.sh''' script and exit the text editor. |