My previous blog article build the guests in a VirtualBox environment. This blog article shows the configuration for testing.
Sunday, November 6. 2016
Dustin Spinhirne's OVN Tutorial: Test Configuration
For c01, the controller. One note, is that the lsp (sw1-r1) needs to have the same mac address as the lrp (r1-sw1).
ovn-nbctl lr-add r1 ovn-nbctl lrp-add r1 r1-sw1 00:00:00:00:01:29 172.16.255.129/26 ovn-nbctl lr-add r2 ovn-nbctl lrp-add r2 r2-sw2 00:00:00:00:01:93 172.16.255.193/26 ovn-nbctl lrp-add r1 r1_r2 00:00:00:01:00:02 172.16.255.2/31 peer=r2_r1 ovn-nbctl lrp-add r2 r2_r1 00:00:00:01:00:03 172.16.255.3/31 peer=r1_r2 ovn-nbctl lr-route-add r1 "172.16.255.192/26" 172.16.255.3 ovn-nbctl lr-route-add r2 "172.16.255.128/26" 172.16.255.2 ovn-nbctl ls-add sw1 ovn-nbctl lsp-add sw1 sw1-r1 ovn-nbctl lsp-set-type sw1-r1 router ovn-nbctl lsp-set-addresses sw1-r1 00:00:00:00:01:29 ovn-nbctl lsp-set-options sw1-r1 router-port=r1-sw1 ovn-nbctl ls-add sw2 ovn-nbctl lsp-add sw2 sw2-r2 ovn-nbctl lsp-set-type sw2-r2 router ovn-nbctl lsp-set-addresses sw2-r2 00:00:00:00:01:93 ovn-nbctl lsp-set-options sw2-r2 router-port=r2-sw2 ovn-nbctl lsp-add sw1 sw1-vm1 ovn-nbctl lsp-set-addresses sw1-vm1 "00:00:00:00:01:31 172.16.255.131" ovn-nbctl lsp-set-port-security sw1-vm1 "00:00:00:00:01:31 172.16.255.131" ovn-nbctl lsp-add sw1 sw1-vm2 ovn-nbctl lsp-set-addresses sw1-vm2 "00:00:00:00:01:32 172.16.255.132" ovn-nbctl lsp-set-port-security sw1-vm2 "00:00:00:00:01:32 172.16.255.132" ovn-nbctl lsp-add sw2 sw2-vm3 ovn-nbctl lsp-set-addresses sw2-vm3 "00:00:00:00:01:95 172.16.255.195" ovn-nbctl lsp-set-port-security sw2-vm3 "00:00:00:00:01:95 172.16.255.195" ovn-nbctl lsp-add sw2 sw2-vm4 ovn-nbctl lsp-set-addresses sw2-vm4 "00:00:00:00:01:96 172.16.255.196" ovn-nbctl lsp-set-port-security sw2-vm4 "00:00:00:00:01:96 172.16.255.196" sw1Dhcp="$(ovn-nbctl create DHCP_Options cidr=172.16.255.128/26 \ options="\"server_id\"=\"172.16.255.129\" \"server_mac\"=\"00:00:00:00:01:29\" \ \"lease_time\"=\"3600\" \"router\"=\"172.16.255.129\"")" echo $sw1Dhcp sw2Dhcp="$(ovn-nbctl create DHCP_Options cidr=172.16.255.192/26 \ options="\"server_id\"=\"172.16.255.193\" \"server_mac\"=\"00:00:00:00:01:93\" \ \"lease_time\"=\"3600\" \"router\"=\"172.16.255.193\"")" echo $sw2Dhcp ovn-nbctl lsp-set-dhcpv4-options sw1-vm1 $sw1Dhcp ovn-nbctl lsp-set-dhcpv4-options sw1-vm2 $sw1Dhcp ovn-nbctl lsp-set-dhcpv4-options sw2-vm3 $sw2Dhcp ovn-nbctl lsp-set-dhcpv4-options sw2-vm4 $sw2Dhcp
I put the following on h01 to test the distributed switch and the distributed routing. The interface used for encapsulation should be a higher mtu due to encapsulation overhead.
ENCAP_INTERFACE=enp0s9 ip link set dev ${ENCAP_INTERFACE} mtu 9000 ovs-vsctl add-br br-int -- set Bridge br-int fail-mode=secure ovs-vsctl set open . external-ids:ovn-remote=tcp:10.10.101.2:6642 ovs-vsctl set open . external-ids:ovn-encap-type=geneve ovs-vsctl set open . external-ids:ovn-encap-ip=10.10.104.2 # --- ovs-vsctl add-port br-int vm1 -- set interface vm1 type=internal ip link set vm1 address 00:00:00:00:01:31 ip link set up dev vm1 ovs-vsctl set Interface vm1 external_ids:iface-id=sw1-vm1 ip netns add vm1 ip netns exec vm1 ip link set dev lo up ip link set vm1 netns vm1 ip netns exec vm1 dhclient vm1 ip netns exec vm1 ip addr show vm1 ip netns exec vm1 ip route show #--- ovs-vsctl add-port br-int vm3 -- set Interface vm3 type=internal ip link set vm3 address 00:00:00:00:01:95 ip link set up dev vm3 ovs-vsctl set Interface vm3 external_ids:iface-id=sw2-vm3 ip netns add vm3 ip netns exec vm3 ip link set dev lo up ip link set vm3 netns vm3 ip netns exec vm3 dhclient vm3 ip netns exec vm3 ip addr show vm3 ip netns exec vm3 ip route show
This configuration goes on h02 (h03 is unused at the moment):
ENCAP_INTERFACE=enp0s9 ip link set dev ${ENCAP_INTERFACE} mtu 9000 ovs-vsctl add-br br-int -- set Bridge br-int fail-mode=secure ovs-vsctl set open . external-ids:ovn-remote=tcp:10.10.102.2:6642 ovs-vsctl set open . external-ids:ovn-encap-type=geneve ovs-vsctl set open . external-ids:ovn-encap-ip=10.10.104.3 #--- ovs-vsctl add-port br-int vm2 -- set interface vm2 type=internal ip link set vm2 address 00:00:00:00:01:32 ip link set up dev vm2 ovs-vsctl set Interface vm2 external_ids:iface-id=sw1-vm2 ip netns add vm2 ip netns exec vm2 ip link set dev lo up ip link set vm2 netns vm2 ip netns exec vm2 dhclient vm2 ip netns exec vm2 ip addr show vm2 ip netns exec vm2 ip route show # --- ovs-vsctl add-port br-int vm4 -- set Interface vm4 type=internal ip link set vm4 address 00:00:00:00:01:96 ip link set up dev vm4 ovs-vsctl set Interface vm4 external_ids:iface-id=sw2-vm4 ip netns add vm4 ip netns exec vm4 ip link set dev lo up ip link set vm4 netns vm4 ip netns exec vm4 dhclient vm4 ip netns exec vm4 ip addr show vm4 ip netns exec vm4 ip route show
Trackbacks
Trackback specific URI for this entry
No Trackbacks