54 | | == 1. Create the Software Switch == |
55 | | Now that you are logged in, we need first to initialize OVS: |
56 | | * Start the OVS database: |
57 | | {{{ |
58 | | sudo ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \ |
59 | | --remote=db:Open_vSwitch,manager_options \ |
60 | | --private-key=db:SSL,private_key \ |
61 | | --certificate=db:SSL,certificate \ |
62 | | --bootstrap-ca-cert=db:SSL,ca_cert \ |
63 | | --pidfile --detach |
64 | | }}} |
65 | | * Initialize OVS: |
66 | | {{{ |
67 | | sudo ovs-vsctl --no-wait init |
68 | | }}} |
69 | | {{{ |
70 | | sudo ovs-vswitchd --pidfile --detach |
71 | | }}} |
72 | | Ignore the warnings you are going to see. Now that OVS is running it is time to create our software switch. The software switch will be a bridge, in which we are going to add all the interfaces we want to be part of the switch. |
| 54 | == 1. Configure the Software Switch == |
| 55 | Now that you are logged in, we need first to configure OVS. To save time in the tutorial we have already started OVS and we have added an ethernet bridge that will act as our software switch. Try: |
| 56 | {{{ |
| 57 | sudo ovs-vsctl list-br |
| 58 | }}} |
| 59 | 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. |
90 | | <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: <br/> |
91 | | <ul><li> <code> sudo ifconfig ethX 0 </code> </li></ul> |
92 | | </li> <br/> |
93 | | <li> Add all the interfaces you just brought down to your switch (bridge): |
94 | | <ul><li> <code> sudo ovs-vsctl add-port br0 ethX </code> </li></ul> |
| 70 | <li> Notice that all interfaces other than <code> eth0</code> do not have IP addresses. This is because we don't want the kernel to process and forward IP packets. |
| 71 | <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. |
| 72 | <ul><li> <code> sudo ovs-vsctl add-port br0 \<data_interface_name\> </code> </li></ul> |