Creating dummy interfaces on Linux

I will give an example of creating dummy interfaces in Linux.
On the test I use Ubuntu Server 16.04.

The first thing you need to load the module “dummy”, you can also add the option “numdummies = 2” to immediately create two dummyX interfaces:

sudo modprobe -v dummy numdummies=2

Let’s see if the module is loaded:

lsmod | grep dummy

Let’s see if the interfaces were created:

ifconfig -a | grep dummy

You can add or remove an IP address from the dummy0 interface, for example:

sudo ip addr add dev dummy0
sudo ip addr del dev dummy0

Change the MAC address as follows:

sudo ip link set dummy0 address 00:00:00:11:11:11

Interfaces are added or removed as follows:

sudo ip link add dummy2 type dummy
sudo ip link del dummy2 type dummy

You can unload the dummy module as follows (dummy interfaces will be deleted automatically):

sudo rmmod dummy

In order to start the module automatically when the system is started, we will add to the /etc/modules file (one dummy0 interface will be created at startup):


If you need to create for example two interfaces or more, then add the following line to /etc/rc.local:

modprobe -v dummy numdummies=2

Or create a dummy.conf file:

sudo -i
echo "options dummy numdummies=2" > /etc/modprobe.d/dummy.conf

So that when the system starts on the dummy interface there is an IP address, open the configuration file:

sudo nano /etc/network/interfaces

And as usual, let’s assign a static IP address (similarly for dummy1, dummy2, etc.):

auto dummy0
iface dummy0 inet static

See that the assigned IP address on the dummy interface does not match the network on the physical network interface, otherwise the routes will match and the server may not be available at both IP addresses. If you need to assign multiple IP addresses from the same network, then I recommend using aliases.

See also my article:
Configuring the Network in Linux

Leave a comment

Leave a Reply