Ok guys,
I have to create several bridges to test SD-WAN in just one computer. And also avoid me the work to change IP segments every time my box is moving among different places 🙂
My base hots is a Centos7 and I am using it laso as my router. Don’t forget to create routes in your laptop to access all elements. You need to use the following syntax in case of a Mac:
sudo route -n add -net 10.250.250.0/24 192.168.1.113
I want to create a topology like this:
Load the dummy module
Do the following to create 3 dummies interfaces:
modprobe dummy numdummies=3 echo "dummy" > /etc/modules-load.d/dummy.conf echo "options dummy numdummies=3" > /etc/modprobe.d/dummy.conf
Create the bridges and interfaces
Check out my configuration for this dummies that I will bridge later to core, wan and inet bridges.
[root@box01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-dummy0 DEVICE=dummy0 MACADDR=52:54:00:7e:27:d0 NM_CONTROLLED=no ONBOOT=yes TYPE=Ethernet BRIDGE=core IPV6INIT=no [root@box01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-dummy1 DEVICE=dummy1 MACADDR=52:54:00:7e:27:d1 NM_CONTROLLED=no ONBOOT=yes TYPE=Ethernet BRIDGE=wan IPV6INIT=no [root@box01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-dummy2 DEVICE=dummy2 MACADDR=52:54:00:7e:27:d2 NM_CONTROLLED=no ONBOOT=yes TYPE=Ethernet BRIDGE=inet IPV6INIT=no
Finally, I will create the bridges
[root@box01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-core DEVICE="core" ONBOOT="yes" TYPE=Bridge BOOTPROTO=static IPADDR=10.10.10.1 NETMASK=255.255.255.0 [root@box01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-wan DEVICE="wan" ONBOOT="yes" TYPE=Bridge BOOTPROTO=static IPADDR=10.250.250.1 NETMASK=255.255.255.0 [root@box01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-inet DEVICE="inet" ONBOOT="yes" TYPE=Bridge BOOTPROTO=static IPADDR=80.80.80.1 NETMASK=255.255.255.0
Reboot your server and you will get this into your interfaces (use “ip addr” command):
6: dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master core state UNKNOWN link/ether 52:54:00:7e:27:d0 brd ff:ff:ff:ff:ff:ff 7: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master wan state UNKNOWN link/ether 52:54:00:7e:27:d1 brd ff:ff:ff:ff:ff:ff 8: dummy2: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master inet state UNKNOWN link/ether 52:54:00:7e:27:d2 brd ff:ff:ff:ff:ff:ff 9: wlp0s22u1u2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000 link/ether 74:da:38:7d:86:81 brd ff:ff:ff:ff:ff:ff 10: core: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP link/ether 52:54:00:7e:27:d0 brd ff:ff:ff:ff:ff:ff inet 10.10.10.1/24 brd 10.10.10.255 scope global core valid_lft forever preferred_lft forever 11: wan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP link/ether 52:54:00:7e:27:d1 brd ff:ff:ff:ff:ff:ff inet 10.250.250.1/24 brd 10.250.250.255 scope global wan valid_lft forever preferred_lft forever 12: inet: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP link/ether 52:54:00:7e:27:d2 brd ff:ff:ff:ff:ff:ff inet 80.80.80.1/24 brd 80.80.80.255 scope global inet valid_lft forever preferred_lft forever
Connect your virsh domains to those bridges
Easy, check the xml domain file and edit the interface section that way:
<interface type='bridge'> <source bridge='wan'/> <target dev='vnet6'/> <model type='virtio'/> <alias name='net0'/> </interface> <interface type='bridge'> <source bridge='inet'/> <target dev='vnet7'/> <model type='virtio'/> <alias name='net1'/> </interface>
Check your bridges and connection that way:
[root@box01 ~]# brctl show bridge name bridge id STP enabled interfaces branch01 8000.fe540027b5c5 no vnet14 vnet15 vnet18 vnet19 vnet20 vnet8 branch02 8000.000000000000 no core 8000.5254007e27d0 no dummy0 vnet0 vnet10 vnet11 vnet3 vnet4 vnet5 vnet9 inet 8000.5254007e27d2 no dummy2 vnet13 vnet17 vnet2 vnet7 wan 8000.5254007e27d1 no dummy1 vnet1 vnet12 vnet16 vnet6
See ya!
1 reply »