Changes between Version 9 and Version 10 of JoeSandbox/OpenFlowOVS/Execute
- Timestamp:
- 07/23/15 10:14:46 (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
JoeSandbox/OpenFlowOVS/Execute
v9 v10 19 19 == Step 2. Configure and Initialize == 20 20 21 Although OVS is installed and initialized on the host that is meant to act as a software switch, it has not been configured yet. 22 There are two main things that need to be configured: ''(1) configure your software switch with the interfaces as ports'' and '' (2) point the switch to an !OpenFlow controller''. 23 24 In order to configure our switch, we first need to login to the host that will be used as an !OpenFlow switch. 21 OVS is installed and initialized on the host that is meant to act as a software switch. This experiment requires two things to be configured: ''(1) configure your software switch with the interfaces as ports'' and '' (2) point the switch to an !OpenFlow controller''. Item ''(1)'' is already done for you, you just need to define the controller for item ''(2)''. In order to configure our switch, we first need to login to the host that will be used as an !OpenFlow switch. 25 22 26 23 To get ready for the tutorial you will need to have the following windows open: … … 33 30 Depending on which tool and OS you are using there is a slightly different process for logging in. If you don't know how to SSH to your reserved hosts take a look in [wiki:HowTo/LoginToNodes this page.] 34 31 35 === 2a. '''(No need any more)'''Configure the Software Switch === 36 37 Now that you are logged in, we need first to configure OVS. To save time in this tutorial, we have already started OVS and we have added an Ethernet bridge that will act as our software switch. Try the following to show the configure bridge: 38 {{{ 39 sudo ovs-vsctl list-br 40 }}} 41 You should see only on bridge `br0`. Now we need to add the interfaces to this bridge that will act as ports of our software switch. 32 === 2a. Software Switch Configuration === 33 The Software switch configuration has already been applied to the OVS VM. To see the configured bridge name: 34 {{{ 35 $ sudo ovs-vsctl list-br 36 br-switch 37 }}} 38 You should see only on bridge `br-switch`. To see the port configured for this bridge: 39 {{{ 40 $ sudo ovs-vsctl list-ports br-switch 41 eth1 42 eth2 43 eth3 44 }}} 45 46 47 This sections captures how those interfaces were added to the bridge predefined in the OVS image: 42 48 43 49 {{{ … … 51 57 Write down the interface names that correspond to the connections to your hosts. The correspondence is: 52 58 <ul> 53 <li> Interface with IP 10.10.1.11 to host1 - eth X</li>54 <li> Interface with IP 10.10.1.12 to host2 - eth Y</li>55 <li> Interface with IP 10.10.1.13 to host3 - eth Z</li>59 <li> Interface with IP 10.10.1.11 to host1 - eth1</li> 60 <li> Interface with IP 10.10.1.12 to host2 - eth2</li> 61 <li> Interface with IP 10.10.1.13 to host3 - eth3</li> 56 62 </ul></li> 57 63 </li> <br/> 58 64 <li> Be careful <b> not to bring down eth0</b>. This is your control interface, if you bring that interface down you <b> won't be able to login</b> to your host!. For all interfaces other than <code>eth0</code> and <code> l0</code>, remove the IP from the interfaces (your interface names may vary): <br/> 59 <ul><li> <code> sudo ifconfig eth X0 </code> </li></ul>60 <ul><li> <code> sudo ifconfig eth Y0 </code> </li></ul>61 <ul><li> <code> sudo ifconfig eth Z0 </code> </li></ul>65 <ul><li> <code> sudo ifconfig eth1 0 </code> </li></ul> 66 <ul><li> <code> sudo ifconfig eth2 0 </code> </li></ul> 67 <ul><li> <code> sudo ifconfig eth3 0 </code> </li></ul> 62 68 <li> Add all the data interfaces to your switch (bridge):Be careful <b> not to add interface eth0</b>. This is your control interface. You should see three interfaces that start with VLAN, these are your data interfaces. (Use the same interfaces as you used in the previous step.) 63 <ul><li> <code> sudo ovs-vsctl add-port br0 eth X</code> </li></ul>64 <ul><li> <code> sudo ovs-vsctl add-port br0 eth Y</code> </li></ul>65 <ul><li> <code> sudo ovs-vsctl add-port br0 eth Z</code> </li></ul>69 <ul><li> <code> sudo ovs-vsctl add-port br0 eth1 </code> </li></ul> 70 <ul><li> <code> sudo ovs-vsctl add-port br0 eth2 </code> </li></ul> 71 <ul><li> <code> sudo ovs-vsctl add-port br0 eth3 </code> </li></ul> 66 72 </li> 67 73 </ol> … … 73 79 </table> 74 80 }}} 75 76 Congratulations! You have configured your software switch. To verify the three ports configured run: 77 {{{ 78 sudo ovs-vsctl list-ports br0 79 }}} 80 81 === '''(Where is 2b?)'''2c. Point your switch to a controller === 82 83 Find the control interface IP of your controller, use ifconfig and note down the IP of `eth0`. 81 The above bridge instructions were used to create the OVS image, you need not execute the above! If you want to see the list of ports associated with the bridge: 82 {{{ 83 $ sudo ovs-vsctl list-ports br-switch 84 }}} 85 86 === 2b. Point your switch to a controller === 87 88 Find the control interface IP of your controller, use /sbin/ifconfig and note down the IP of `eth0`. 84 89 85 90 An !OpenFlow switch will not forward any packet, unless instructed by a controller. Basically the forwarding table is empty, until an external controller inserts forwarding rules. The !OpenFlow controller communicates with the switch over the control network and it can be anywhere in the Internet as long as it is reachable by the OVS host. '''(The following sentence is not true anymore)'''For the purpose of this tutorial and in order to minimize the resources we have reserved we are going to run !OpenFlow controller at the same host as the OVS switch. This is '''merely''' for convenience reasons, the controller could have been anywhere on the Internet. 86 91 87 In order to point our software !OpenFlow switch to the controller run:88 {{{ 89 sudo ovs-vsctl set-controller br-switch tcp:<controller_ip>:663390 }}} 91 92 ==== '''(No need anymore. But maybe we should keep the instroduction)'''`standalone` vs `secure` mode ====92 In order to point our software !OpenFlow switch to the controller issue the following command on the OVS host: 93 {{{ 94 $sudo ovs-vsctl set-controller br-switch tcp:<controller_ip>:6633 95 }}} 96 97 ==== `standalone` vs `secure` mode ==== 93 98 94 99 The !OpenFlow controller is responsible for setting up all flows on the switch, which means that when the controller is not running there should be no packet switching at all. Depending on the setup of your network, such a behavior might not be desired. It might be best that when the controller is down, the switch should default back in being a learning layer 2 switch. In other circumstances however this might be undesirable. In OVS this is a tunable parameter, called `fail-safe-mode` which can be set to the following parameters: … … 98 103 In OVS when the parameter is not set it falls back to the `standalone` mode. For the purpose of this tutorial we will set the `fail-safe-mode` to `secure`, since we want to be the ones controlling the forwarding. Run: 99 104 {{{ 100 sudo ovs-vsctl set-fail-mode br-switch secure105 $ sudo ovs-vsctl set-fail-mode br-switch secure 101 106 }}} 102 107 You can verify your OVS settings by issuing the following: 103 108 104 109 {{{ 105 sudo ovs-vsctl show110 $ sudo ovs-vsctl show 106 111 }}} 107 112