VyOSVII · Interface FundamentalsInterfaces
IP addressing on interfaces — static, DHCP, and address-less
What you'll learn
- Configure static IPv4 and IPv6 addresses on VyOS Ethernet interfaces
- Configure DHCP client and DHCPv6 client on interfaces
- Recognise the address-less interface pattern (for L3-only use)
- Diagnose the addressing failure modes the operator must handle
Prerequisites
Verified against VyOS 1.5.x LTS (circinus) · VyOS 1.4.x (sagitta) — legacy · FRRouting 10.x (VyOS 1.5) · Linux kernel 6.6 LTS (VyOS 1.5 base) · strongSwan 5.9.x (IPsec) · WireGuard 1.0.x (kernel module + userspace tooling) · 2026-08-15
IP addressing on interfaces — static, DHCP, and address-less
An Ethernet interface has three addressing modes: static operator-configured address, DHCP client (the interface dynamically gets an address from a server), and address-less (the interface is up but has no L3 address, used for bridging or L2-only purposes). This lesson covers all three and the failure modes that surface when an addressing mistake locks the operator out.
Static IPv4 addressing
[edit]
vyos@vyos# set interfaces ethernet eth0 address '192.0.2.1/24'
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# save
The interface is configured with 192.0.2.1/24. The kernel
notifies the connected route is installed in the routing table.
vyos@vyos:~$ show interface ethernet eth0
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
inet 192.0.2.1/24 brd 192.0.2.255 scope global eth0
valid_lft forever preferred_lft forever
The inet 192.0.2.1/24 line confirms the address is installed.
DHCP client
[edit]
vyos@vyos# set interfaces ethernet eth0 address 'dhcp'
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# save
The interface runs a DHCP client. The client sends DHCPDISCOVER, receives DHCPOFFER, sends DHCPREQUEST, receives DHCPACK. The address, gateway, and DNS are populated.
vyos@vyos:~$ show dhcp client leases
Interface eth0
IP address 203.0.113.42/24
Gateway 203.0.113.1
DNS server 1.1.1.1, 9.9.9.9
Lease obtained 2026-08-15 14:23:01
Lease expires 2026-08-15 22:23:01
The show dhcp client leases output shows the lease details.
Static IPv6 addressing
[edit]
vyos@vyos# set interfaces ethernet eth0 address '2001:db8::1/64'
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# save
IPv6 addresses follow the same syntax as IPv4. The /64 prefix
is the standard for a single subnet.
DHCPv6 client
[edit]
vyos@vyos# set interfaces ethernet eth0 address 'dhcpv6'
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# save
The interface runs a DHCPv6 client. DHCPv6 is stateless for address assignment (the prefix comes from Router Advertisements) but stateful for DNS and other options.
Multiple addresses on a single interface
[edit]
vyos@vyos# set interfaces ethernet eth0 address '192.0.2.1/24'
[edit]
vyos@vyos# set interfaces ethernet eth0 address '192.0.2.10/24'
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# save
Multiple addresses on a single interface are valid. The kernel adds both; the routing table shows two connected routes for the same subnet (the more specific one wins for traffic from those addresses, but both routes cover the subnet).
Address-less interfaces
[edit]
vyos@vyos# set interfaces ethernet eth0
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# save
An interface with no address directive is address-less. The
interface is up at L2 but has no L3 address. Use cases:
- Bridging: the interface is part of a bridge; the bridge has the address.
- Trunk port: the interface is a VLAN trunk; the VLAN sub-interfaces have the addresses.
- Transit-only: the interface forwards traffic but is not the source or destination.
How the result is validated
show interface ethernet
ip addr show
show dhcp client leases
show dhcpv6 client leases
show ip route 192.0.2.0/24
The first shows the VyOS view; the second shows the kernel view; the third/fourth show DHCP state; the fifth shows the connected route.
How it fails
The production failure modes the engineer must recognise:
- Address on the wrong interface. A box configured with the
LAN address on
eth0and the WAN address oneth1is unreachable from the WAN. - Duplicate address. Two interfaces configured with the same address. The kernel accepts the second but traffic is unpredictable.
- Wrong prefix length. A
/24configured as/32produces a host route, not a subnet route. Traffic to the subnet does not go through the box. - DHCP client never receives a lease. The client retries indefinitely; the interface stays without an address. The operator must verify the upstream DHCP server is reachable.
- Address-less interface used for routing. An interface configured as a routed interface but without an address has no connected route and no routing entry. Routing breaks.
Rollback
The recovery from a bad address configuration:
- Wrong static:
delete interfaces ethernet eth0 address '192.0.2.1/24'; set interfaces ethernet eth0 address '192.0.2.5/24'; commit; save. - Wrong DHCP/static mix:
delete interfaces ethernet eth0 address 'dhcp'; set interfaces ethernet eth0 address '192.0.2.1/24'; commit; save. - Duplicate address:
deletethe duplicate,commit; save.
Production discipline
Cross-course references
The Linux course’s XIX-Linux-NetFoundations covers the kernel
side of IP addressing. The OPNsense course’s
VII-OPNsense-Interfaces covers the equivalent configuration on
the firewall side. The Observability course’s
LX-Observability-NetworkObs covers how to alert on interface
state changes.
Quiz
Knowledge check · 4 questions
Q1. Which configuration runs a DHCP client on `eth0`?
Q2. Multiple IPv4 addresses on a single interface are valid and produce multiple connected routes.
Q3. An operator configures `eth0` with `address '192.0.2.1/32'`. Traffic to the rest of the subnet does not go through the box. What is the most likely cause?
A `/32` prefix is a host route, not a subnet route. The connected route is for `192.0.2.1/32`, not `192.0.2.0/24`. Traffic to other hosts in the subnet has no route.
Q4. A box has two interfaces configured with the same IP address. Traffic is unpredictable. What is the recovery?
The operator accidentally configured `eth0` and `eth1` with the same `192.0.2.1/24` address. The kernel accepts both but routing is unpredictable.
Passing score: 75%. Answers are checked in this browser.