Dummy Interfaces in VyOS
Dummy interfaces in VyOS are virtual interfaces that are always in the “up” state and are not tied to any physical hardware. They are used for a variety of technical tasks, including testing, routing, and serving as stable endpoints.
Overview
Dummy interfaces are used for:
- Testing: Simulating interfaces without physical hardware
- Stable endpoint: An always-available IP for routing protocols
- Router ID: A stable identifier for OSPF/BGP (an alternative to loopback)
- Blackhole routing: Dropping traffic through a dummy
- Source address: A stable source IP for outbound connections
- Development: Developing and debugging network configurations
Dummy vs Loopback
| Characteristic | Dummy | Loopback |
|---|---|---|
| State | Always up | Always up |
| Use case | Testing, routing, blackhole | Router ID, management |
| Count | Multiple (dum0, dum1, …) | One (lo) |
| Standardization | Linux-specific | Universal (RFC 1122) |
| Recommendation | For temporary tasks | For production router ID |
When to use Dummy:
- Testing configurations
- Temporary endpoints
- Blackhole routing
- Multiple virtual interfaces
When to use Loopback:
- Router ID for OSPF/BGP
- Management address
- Production stable endpoint
Basic Configuration
Creating a Dummy Interface
# Create a dummy interface with an IP address
set interfaces dummy dum0 address 192.168.255.1/32
commit
saveMultiple Dummy Interfaces
# First dummy
set interfaces dummy dum0 address 192.168.255.1/32
# Second dummy
set interfaces dummy dum1 address 192.168.255.2/32
# Third dummy with a description
set interfaces dummy dum2 address 192.168.255.3/32
set interfaces dummy dum2 description 'Test interface for BGP'
commit
saveMultiple IP Addresses on a Dummy
# Dummy with several addresses
set interfaces dummy dum0 address 192.168.255.1/32
set interfaces dummy dum0 address 10.255.255.1/32
set interfaces dummy dum0 address 172.16.255.1/32
commit
saveIPv6 on a Dummy
# IPv4 + IPv6
set interfaces dummy dum0 address 192.168.255.1/32
set interfaces dummy dum0 address 2001:db8::1/128
commit
saveAdvanced Configuration
Dummy for Router ID (OSPF/BGP)
# Dummy interface for the Router ID
set interfaces dummy dum0 address 10.255.255.1/32
set interfaces dummy dum0 description 'Router ID for OSPF/BGP'
# OSPF uses this address as its Router ID
set protocols ospf parameters router-id 10.255.255.1
set protocols ospf area 0 network 10.255.255.1/32
# BGP uses it as well
set protocols bgp local-as 65000
set protocols bgp parameters router-id 10.255.255.1
# Advertise into OSPF (optional)
set protocols ospf area 0 network 10.255.255.1/32
commit
saveBlackhole Routing with a Dummy
Dummy interfaces can be used for blackhole routing - dropping unwanted traffic.
# Create a dummy for blackhole
set interfaces dummy dum0 address 192.0.2.1/32
set interfaces dummy dum0 description 'Blackhole interface'
# Routes pointing to the dummy (traffic will be dropped)
set protocols static route 10.0.0.0/8 interface dum0
set protocols static route 172.16.0.0/12 interface dum0
set protocols static route 192.168.0.0/16 interface dum0
commit
saveNow all traffic to these subnets will be dropped (useful for DDoS protection or for routing bogon prefixes).
Source Address for Outbound Connections
# Dummy for a stable source address
set interfaces dummy dum0 address 203.0.113.100/32
set interfaces dummy dum0 description 'Stable source for outgoing connections'
# BGP uses the dummy as its source
set protocols bgp neighbor 198.51.100.1 remote-as 65001
set protocols bgp neighbor 198.51.100.1 update-source dum0
# Static route to make the dummy address reachable
set protocols ospf area 0 network 203.0.113.100/32
commit
saveDummy for NAT Testing
# The dummy simulates an internal network
set interfaces dummy dum0 address 192.168.10.1/24
set interfaces dummy dum0 description 'Test internal network'
# NAT for the dummy interface
set nat source rule 100 outbound-interface name eth0
set nat source rule 100 source address 192.168.10.0/24
set nat source rule 100 translation address masquerade
commit
saveDummy for Policy-Based Routing
# Dummy for PBR testing
set interfaces dummy dum0 address 192.168.100.1/24
# Policy route for traffic to the dummy
set policy route TEST-ROUTE rule 10 destination address 192.168.100.0/24
set policy route TEST-ROUTE rule 10 set table 100
# Apply to the interface
set interfaces ethernet eth1 policy route TEST-ROUTE
commit
saveConfiguration Examples
Example 1: Router ID for OSPF/BGP
# Dummy interface for a stable Router ID
set interfaces dummy dum0 address 10.255.255.1/32
set interfaces dummy dum0 description 'Router ID'
# OSPF configuration
set protocols ospf parameters router-id 10.255.255.1
set protocols ospf area 0 network 10.0.0.0/24
set protocols ospf area 0 network 10.255.255.1/32
# BGP configuration
set protocols bgp local-as 65000
set protocols bgp parameters router-id 10.255.255.1
set protocols bgp neighbor 10.0.0.2 remote-as 65001
set protocols bgp neighbor 10.0.0.2 update-source dum0
commit
saveExample 2: Blackhole Routing for Bogon Prefixes
# Dummy for blackhole
set interfaces dummy dum0 address 192.0.2.1/32
set interfaces dummy dum0 description 'Blackhole for bogon prefixes'
# RFC 1918 private addresses (if they should not be routed to the internet)
set protocols static route 10.0.0.0/8 blackhole distance 254
set protocols static route 172.16.0.0/12 blackhole distance 254
set protocols static route 192.168.0.0/16 blackhole distance 254
# Other bogon prefixes
set protocols static route 0.0.0.0/8 blackhole distance 254
set protocols static route 127.0.0.0/8 blackhole distance 254
set protocols static route 169.254.0.0/16 blackhole distance 254
set protocols static route 224.0.0.0/4 blackhole distance 254
set protocols static route 240.0.0.0/4 blackhole distance 254
commit
saveNote: blackhole is more efficient than a route through a dummy, but a dummy can be used for specific cases.
Example 3: Test Environment with Multiple Dummies
# Simulating multiple networks for testing
set interfaces dummy dum0 address 192.168.10.1/24
set interfaces dummy dum0 description 'Test network VLAN 10'
set interfaces dummy dum1 address 192.168.20.1/24
set interfaces dummy dum1 description 'Test network VLAN 20'
set interfaces dummy dum2 address 192.168.30.1/24
set interfaces dummy dum2 description 'Test network VLAN 30'
# OSPF advertises all test networks
set protocols ospf area 0 network 192.168.10.0/24
set protocols ospf area 0 network 192.168.20.0/24
set protocols ospf area 0 network 192.168.30.0/24
commit
saveExample 4: Stable Source for BGP Peering
# Dummy for BGP peering
set interfaces dummy dum0 address 10.255.0.1/32
set interfaces dummy dum0 description 'BGP peering endpoint'
# Advertise the dummy into the IGP (OSPF)
set protocols ospf area 0 network 10.255.0.1/32
# BGP neighbors use the dummy as update-source
set protocols bgp local-as 65000
set protocols bgp parameters router-id 10.255.0.1
set protocols bgp neighbor 10.255.0.2 remote-as 65000
set protocols bgp neighbor 10.255.0.2 update-source dum0
set protocols bgp neighbor 10.255.0.3 remote-as 65000
set protocols bgp neighbor 10.255.0.3 update-source dum0
commit
saveNow BGP peering uses a stable IP that does not depend on the state of the physical interfaces.
Example 5: Dummy for VRF Testing
# VRF with a dummy interface
set vrf name TEST-VRF table 100
# Dummy in the VRF
set interfaces dummy dum0 vrf TEST-VRF
set interfaces dummy dum0 address 192.168.100.1/24
set interfaces dummy dum0 description 'Test interface in VRF'
# Static route in the VRF
set protocols vrf TEST-VRF static route 192.168.200.0/24 next-hop 192.168.100.254
commit
saveExample 6: Anycast Address on a Dummy
# Anycast address for a service (for example, DNS)
set interfaces dummy dum0 address 10.10.10.10/32
set interfaces dummy dum0 description 'Anycast DNS service'
# Advertise into OSPF
set protocols ospf area 0 network 10.10.10.10/32
# Or into BGP
set protocols bgp address-family ipv4-unicast network 10.10.10.10/32
commit
saveNow all routers with an identical configuration advertise 10.10.10.10, and clients will be directed to the nearest router.
Monitoring and Diagnostics
Viewing Dummy Interfaces
# Show all dummy interfaces
show interfaces dummy
# Detailed information
show interfaces dummy dum0
# Statistics (usually zero for a dummy)
show interfaces dummy dum0 statisticsChecking the State
# The dummy should always be up
show interfaces dummy dum0
# Output:
# dum0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500
# inet 192.168.255.1/32Checking Routing
# Check that the dummy address is in the routing table
show ip route
# Ping the dummy address (from the router itself)
ping 192.168.255.1
# Traceroute (to verify routing)
traceroute 192.168.255.1Checking in Routing Protocols
# OSPF - the dummy in the database
show ip ospf database
# BGP - the dummy is advertised
show ip bgp
show ip bgp 192.168.255.1/32
# Neighbors use the dummy
show ip bgp neighborsLogging
# Interface logs
show log | match dum0
# Kernel messages
dmesg | grep dumTroubleshooting
Problem: The Dummy Interface Is Not Created
Diagnostics:
# Check the configuration
show configuration interfaces dummy
# Check the state
show interfaces dummySolution:
# Make sure the configuration is applied
commit
save
# Check the kernel module (usually loaded by default)
lsmod | grep dummy
# If it is not - load it (usually not required)
sudo modprobe dummyProblem: The Dummy Address Is Unreachable from Other Devices
Cause: The dummy address is not advertised in a routing protocol.
Solution:
# Add the dummy to OSPF
set protocols ospf area 0 network 192.168.255.1/32
# Or to BGP
set protocols bgp address-family ipv4-unicast network 192.168.255.1/32
# Or a static route on the other routers
set protocols static route 192.168.255.1/32 next-hop 10.0.0.1
commit
saveProblem: BGP Neighbors Do Not Use the Dummy as Source
Diagnostics:
# Check the BGP neighbors
show ip bgp neighbors
# Check the source address in the configuration
show configuration protocols bgp neighborSolution:
# Explicitly specify update-source
set protocols bgp neighbor 10.0.0.2 update-source dum0
# Make sure the dummy address is reachable through the IGP
set protocols ospf area 0 network 192.168.255.1/32
commit
saveProblem: Blackhole Routing Does Not Work
Diagnostics:
# Check the routes
show ip route 10.0.0.0/8
# Traceroute to verify
traceroute 10.1.1.1Solution:
Use blackhole instead of a dummy for efficient dropping:
# Instead of:
# set protocols static route 10.0.0.0/8 interface dum0
# Use:
set protocols static route 10.0.0.0/8 blackhole distance 254
commit
saveProblem: A Dummy in a VRF Does Not Work
Diagnostics:
# Check the VRF
show vrf TEST-VRF
# Check the interface in the VRF
show interfaces dummy dum0Solution:
# Make sure the dummy is bound to the VRF
set interfaces dummy dum0 vrf TEST-VRF
# Check routing in the VRF
show ip route vrf TEST-VRF
commit
saveBest Practices
1. Use Loopback for the Production Router ID
For the production router ID, loopback is preferable:
# Better:
set interfaces loopback lo address 10.255.255.1/32
set protocols ospf parameters router-id 10.255.255.1
# Than:
set interfaces dummy dum0 address 10.255.255.1/32
set protocols ospf parameters router-id 10.255.255.12. Dummy for Temporary/Test Tasks
Use a dummy for testing and temporary configurations:
set interfaces dummy dum0 address 192.168.100.1/24
set interfaces dummy dum0 description 'TEST - Remove after testing'3. Describe the Purpose
Always add a description:
set interfaces dummy dum0 description 'BGP peering endpoint'
set interfaces dummy dum1 description 'Test network simulation'4. Use /32 for Endpoint Addresses
For Router IDs and stable endpoints, use /32:
set interfaces dummy dum0 address 10.255.0.1/325. Blackhole via the blackhole Keyword
For blackhole routing, use the built-in blackhole:
# Preferred:
set protocols static route 10.0.0.0/8 blackhole distance 254
# Instead of:
set protocols static route 10.0.0.0/8 interface dum06. Document Test Dummies
Document all dummy interfaces:
# /config/dummy-interfaces.txt
# dum0: BGP peering endpoint (10.255.0.1/32)
# dum1: Test VLAN 10 simulation (192.168.10.1/24)
# dum2: Anycast DNS service (10.10.10.10/32)7. Remove Unused Dummies
Clean up old dummies from the configuration:
# Remove an unused dummy
delete interfaces dummy dum5
commit
save8. Use Consistent Naming
Use a consistent naming scheme:
# dum0 - Router ID / BGP endpoint
# dum1-dum9 - Test networks
# dum10+ - Special purposes9. Monitor Dummy Usage
Track which dummies are in use:
show interfaces dummy
show configuration interfaces dummy10. Security
For dummies with real IPs, do not forget the firewall:
set firewall ipv4 name LOCAL_IN rule 100 action accept
set firewall ipv4 name LOCAL_IN rule 100 destination address 192.168.255.1
set firewall ipv4 name LOCAL_IN rule 100 protocol tcp
set firewall ipv4 name LOCAL_IN rule 100 destination port 179 # BGPUseful Commands
# Show all dummy interfaces
show interfaces dummy
# Details of a specific dummy
show interfaces dummy dum0
# Configuration
show configuration interfaces dummy
# Create a dummy
set interfaces dummy dum0 address 192.168.255.1/32
# Add a description
set interfaces dummy dum0 description 'My description'
# Delete a dummy
delete interfaces dummy dum0
# Check the state
show interfaces dummy dum0
# Ping the dummy address
ping 192.168.255.1
# Check in the routing table
show ip route 192.168.255.1
# OSPF database
show ip ospf database | match 192.168.255.1
# BGP routes
show ip bgp 192.168.255.1/32
# Kernel interface details
ip addr show dum0
# Logs
show log | match dumReal-World Use Cases
Anycast DNS with a Dummy
Several routers advertise the same IP for a DNS service:
Router 1:
set interfaces dummy dum0 address 10.10.10.10/32
set protocols ospf area 0 network 10.10.10.10/32
# The DNS server listens on this IP
# (configure the DNS server separately)Router 2 (identical configuration):
set interfaces dummy dum0 address 10.10.10.10/32
set protocols ospf area 0 network 10.10.10.10/32Clients are directed to the nearest router based on the OSPF metric.
Testing Firewall Rules
# The dummy simulates the protected network
set interfaces dummy dum0 address 192.168.50.1/24
set interfaces dummy dum0 description 'Firewall test network'
# Firewall rules for the dummy
set firewall ipv4 name DUMMY_IN default-action drop
set firewall ipv4 name DUMMY_IN rule 10 action accept
set firewall ipv4 name DUMMY_IN rule 10 state established
set firewall ipv4 name DUMMY_IN rule 10 state related
set interfaces dummy dum0 firewall in name DUMMY_IN
# Testing from another interface
# ping 192.168.50.1Development and Debugging
# Multiple dummies for development
set interfaces dummy dum0 address 172.16.0.1/24
set interfaces dummy dum0 description 'Dev: Frontend network'
set interfaces dummy dum1 address 172.16.1.1/24
set interfaces dummy dum1 description 'Dev: Backend network'
set interfaces dummy dum2 address 172.16.2.1/24
set interfaces dummy dum2 description 'Dev: Database network'
# Now you can test routing between the "networks"
set protocols static route 172.16.1.0/24 next-hop 172.16.0.254Conclusion
Dummy interfaces in VyOS are a versatile tool for a wide range of tasks, from testing to production routing. They provide stable, always-available interfaces that are not tied to physical hardware.
Key advantages of dummy interfaces:
- Always in the “up” state
- Do not require physical hardware
- Flexible in use (Router ID, BGP endpoint, blackhole, testing)
- Easy to configure
- VRF support
Recommendations:
- Use Loopback for the production Router ID
- Use Dummy for testing and special tasks
- Always add a description
- Document the purpose of each dummy
- Remove unused dummies
- Use /32 for endpoint addresses
- Prefer the blackhole keyword for blackhole routing
Dummy interfaces are a powerful tool in a network engineer’s arsenal, providing flexibility and reliability across a variety of scenarios, from development to production environments.