In Linux networking and systems administration, physical network interfaces communicate directly with external cables or wireless transceivers, whilst the loopback interface (lo) facilitates inter-process communication on 127.0.0.1. However, complex networking workflows—such as BGP Anycast routing, isolated local service binding, DNS blackholing, network simulation, and high-availability testing—frequently require an independent virtual interface that discards outbound packets like a black hole while keeping its assigned IP addresses persistently reachable to the local operating system kernel. The Linux dummy network driver, administered via ip link, fulfills this exact role.
What Is a Dummy Network Interface and How Does It Work?
A dummy interface is a purely virtual network device provided by the Linux kernel module dummy. Functionally, it operates similarly to the loopback interface with several distinct advantages:
- Packet Sinks / Black Holes: Any network packet transmitted out through a dummy interface is silently discarded without generating error responses or consuming physical network bandwidth.
- Persistent Local Addressing: IP addresses bound to a dummy interface remain marked as active and operational in the kernel routing table, even if all physical Ethernet cables or Wi-Fi connections are disconnected.
- Routing Protocol Anchors: Routing daemons such as BIRD and FRRouting use dummy interfaces to host stable Router IDs and Anycast VIPs (Virtual IP addresses) advertised across BGP and OSPF meshes.
- Isolated Development Environments: Web developers can bind mock services, database replicas, or proxy endpoints to non-loopback subnet addresses (such as
10.254.254.1) without exposing them to physical local area networks.
Loading the Kernel Dummy Module
Before instantiating dummy devices, ensure the Linux kernel dummy driver is active on your host system. In your terminal, run:
sudo modprobe dummy
Verify that the module loaded successfully:
lsmod | grep dummy
Step 1: Create a Dummy Interface Using ip link
Using modern iproute2 commands, you can dynamically create a dummy interface with any arbitrary descriptive name (such as dummy0 or vip0):
- To add a dummy device named
dummy0, execute:sudo ip link add dummy0 type dummy - Confirm the virtual link creation:
The kernel displays the interface with an auto-generated MAC address and standard down flags:ip link show dummy05: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 22:5a:3b:4c:5d:6e brd ff:ff:ff:ff:ff:ff
Step 2: Assign IPv4 and IPv6 Addresses to the Dummy Interface
Once created, you can assign single or multiple IP addresses across any valid private or public subnet ranges:
- Assign an IPv4 address and subnet mask:
sudo ip addr add 192.168.100.1/24 dev dummy0 - Assign an IPv6 address:
sudo ip addr add fd00:cafe::1/64 dev dummy0 - Assign a secondary VIP for testing:
sudo ip addr add 10.10.10.1/32 dev dummy0
Step 3: Bring the Interface Up and Verify Connectivity
Activate the dummy device so the kernel begins routing local packets directed toward its IP addresses:
- Bring the interface up:
sudo ip link set dev dummy0 up - Verify that the status changes to
UP:
The terminal displays the device in anip -br addr show dummy0UNKNOWNorUPoperational state, with both IPv4 and IPv6 addresses bound. - Test local packet delivery using
ping:
The kernel responds instantaneously with near-zero latency, verifying that local sockets can bind and communicate over this address.ping -c 3 192.168.100.1
Step 4: Customise MTU and MAC Address (Optional)
For specialized network emulation or router ID simulation, you can alter the dummy device’s hardware address or Maximum Transmission Unit (MTU):
- Change the MAC address:
sudo ip link set dev dummy0 address 00:22:33:44:55:66 - Adjust the MTU to match jumbo frame requirements:
sudo ip link set dev dummy0 mtu 9000
Step 5: Deleting and Tearing Down Dummy Interfaces
When testing or simulation workflows conclude, removing the virtual interface requires a single command:
- Delete the virtual link:
sudo ip link delete dummy0 type dummy - Confirm that the device has been erased:
The command returns Device “dummy0” does not exist, and all associated routing entries are instantly purged by the kernel.ip link show dummy0
Persisting Dummy Interfaces Across Reboots
Method A: Persistent Dummy Interface in systemd-networkd
In modern server distributions managed by systemd-networkd, create two configuration files inside /etc/systemd/network/:
1. Create the netdev file (/etc/systemd/network/10-dummy0.netdev):
[NetDev]
Name=dummy0
Kind=dummy
2. Create the network file (/etc/systemd/network/10-dummy0.network):
[Match]
Name=dummy0
[Network]
Address=192.168.100.1/24
Restart the network daemon with sudo systemctl restart systemd-networkd to activate the persistent device.
Method B: Persistent Dummy Module in /etc/modules
To ensure the kernel driver loads automatically on Debian/Ubuntu boots, add dummy to /etc/modules:
echo "dummy" | sudo tee -a /etc/modules
For additional Linux virtual networking configurations, see how to create and configure virtual Ethernet (veth) pairs in Linux using ip link for container sandboxes, create and configure network bonding in Linux using ip link for failover, create and configure network bridges in Linux using ip link, or learn how to enable and disable promiscuous mode in Linux using ip link.