Bridge your dummy interface in centos7

howdy,

I had to start using a dummy interface in bring mobility to my lab. It’s a demo in-a-box. Every time that I’ve tried to disconnect it and use other network. I had to make a lot of changes to my configuration: it’s messy.

Create your permanent dummy interface

I had to make the following change to my box:

[root@box01 ~]# cat /etc/modprobe.d/dummy.conf 
install dummy /sbin/modprobe --ignore-install dummy; /sbin/ip link set name ethdummy1 dev dummy0
[root@box01 ~]# cat /etc/modules-load.d/dummy.conf
# Load dummy.ko at boot
dummy
[root@box01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ethdummy1
NAME=ethdummy1
DEVICE=ethdummy1
MACADDR=00:22:22:ff:ff:ff
IPADDR=10.10.10.1
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
NM_CONTROLLED=no

After reboot, check if you dummy is there:

[root@box01 ~]# ifconfig ethdummy1
ethdummy1: flags=195<UP,BROADCAST,RUNNING,NOARP>  mtu 1500
        inet 10.10.10.1  netmask 255.255.255.0  broadcast 10.10.10.255
        ether 00:22:22:ff:ff:ff  txqueuelen 0  (Ethernet)

Got i from this forum thread: Permanent dummy interface

turn your dummy into a bridge

I’ll bridge ethdummy to bridge0:

[root@box01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ethdummy1
NAME=ethdummy1
DEVICE=ethdummy1
#MACADDR=00:22:22:ff:ff:ff
#IPADDR=10.10.10.1
#NETMASK=255.255.255.0
ONBOOT=yes
#TYPE=Ethernet
NM_CONTROLLED=no
BRIDGE=bridge0
[root@box01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-bridge0 
DEVICE="bridge0"
ONBOOT="yes"
TYPE=Bridge
BOOTPROTO=static
IPADDR=10.10.10.1
NETMASK=255.255.255.0

Restart network services: service network restart
And let’s check this out.

[root@box01 ~]# brctl show
bridge name	bridge id		STP enabled	interfaces
bridge0		8000.002222ffffff	no		ethdummy1

Important Notes

Don’t forget to use iptables to translate IPs and get Internet access from your VMs connected to this new bridge (servers need to use dummy interface as the default gateway: 10.10.10.1)

# You need to translate your IPs thru eth0
# eth0 is the interface connected to the Network
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

That’s all
See ya!

One thought on “Bridge your dummy interface in centos7

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s