Ethernet Interfaces in VyOS
Ethernet interfaces are the primary type of physical network interface in VyOS.
Basic Configuration
IP Addressing
Static IPv4 address:
set interfaces ethernet eth0 address 192.168.1.1/24Static IPv6 address:
set interfaces ethernet eth0 address 2001:db8::1/64Multiple addresses:
set interfaces ethernet eth0 address 192.168.1.1/24
set interfaces ethernet eth0 address 192.168.2.1/24
set interfaces ethernet eth0 address 2001:db8::1/64DHCP Client
DHCPv4:
set interfaces ethernet eth0 address dhcpDHCPv6:
set interfaces ethernet eth0 address dhcpv6Interface Description
set interfaces ethernet eth0 description 'Primary LAN Interface'MAC Address
Changing the MAC address:
set interfaces ethernet eth0 mac '00:50:56:00:00:01'Physical Parameters
Speed and Duplex
Automatic detection (default):
set interfaces ethernet eth0 speed auto
set interfaces ethernet eth0 duplex autoFixed values:
set interfaces ethernet eth0 speed 1000
set interfaces ethernet eth0 duplex fullAvailable speeds:
10- 10 Mbps100- 100 Mbps1000- 1 Gbps2500- 2.5 Gbps5000- 5 Gbps10000- 10 Gbps25000- 25 Gbps40000- 40 Gbps50000- 50 Gbps100000- 100 Gbpsauto- autodetection
Duplex modes:
half- half duplexfull- full duplexauto- autodetection
MTU (Maximum Transmission Unit)
set interfaces ethernet eth0 mtu 1500Typical MTU values:
1500- standard Ethernet9000- Jumbo frames (requires hardware support)1492- for PPPoE (accounts for the 8-byte overhead)
Flow Control
Data flow control to prevent congestion:
set interfaces ethernet eth0 flow-control enableOffloading (Hardware Acceleration)
Generic Receive Offload (GRO)
set interfaces ethernet eth0 offload groGeneric Segmentation Offload (GSO)
set interfaces ethernet eth0 offload gsoLarge Receive Offload (LRO)
set interfaces ethernet eth0 offload lroScatter-Gather (SG)
set interfaces ethernet eth0 offload sgTCP Segmentation Offload (TSO)
set interfaces ethernet eth0 offload tsoUDP Fragmentation Offload (UFO)
set interfaces ethernet eth0 offload ufoNote: Offload features can improve performance, but in some cases they may cause problems with certain traffic types or when using tunnels.
Ring Buffer
Configuring the size of the ring buffers to optimize performance:
set interfaces ethernet eth0 ring-buffer rx 512
set interfaces ethernet eth0 ring-buffer tx 512Increasing the buffer size can help when handling high loads.
VLAN (802.1Q)
Creating a VLAN Interface
set interfaces ethernet eth0 vif 100 address 192.168.100.1/24
set interfaces ethernet eth0 vif 100 description 'VLAN 100 - Guests'Multiple VLANs
set interfaces ethernet eth0 vif 10 address 192.168.10.1/24
set interfaces ethernet eth0 vif 10 description 'VLAN 10 - Management'
set interfaces ethernet eth0 vif 20 address 192.168.20.1/24
set interfaces ethernet eth0 vif 20 description 'VLAN 20 - Servers'
set interfaces ethernet eth0 vif 30 address 192.168.30.1/24
set interfaces ethernet eth0 vif 30 description 'VLAN 30 - Workstations'QinQ (802.1ad)
Double VLAN tagging:
set interfaces ethernet eth0 vif-s 100 vif-c 200 address 10.0.0.1/24Advanced IPv4 Settings
ARP
ARP cache timeout:
set interfaces ethernet eth0 ip arp-cache-timeout 3600Proxy ARP:
set interfaces ethernet eth0 ip enable-proxy-arpARP announce:
set interfaces ethernet eth0 ip enable-arp-announceARP ignore:
set interfaces ethernet eth0 ip enable-arp-ignoreSource Validation
Source address validation to prevent spoofing:
set interfaces ethernet eth0 ip source-validation strictModes:
strict- strict mode (RFC 3704)loose- loose modedisable- disabled
Disable Forwarding
Disabling IP forwarding on the interface:
set interfaces ethernet eth0 ip disable-forwardingAdvanced IPv6 Settings
Autoconfiguration (SLAAC)
set interfaces ethernet eth0 ipv6 address autoconfDuplicate Address Detection (DAD)
Number of attempts to detect duplicate addresses:
set interfaces ethernet eth0 ipv6 dup-addr-detect-transmits 1Disabling IPv6
set interfaces ethernet eth0 ipv6 disableDisable Forwarding
set interfaces ethernet eth0 ipv6 disable-forwardingDHCP Options
DHCPv4 Client
Client ID:
set interfaces ethernet eth0 dhcp-options client-id 'my-client-id'Hostname:
set interfaces ethernet eth0 dhcp-options host-name 'vyos-router'Vendor class ID:
set interfaces ethernet eth0 dhcp-options vendor-class-id 'vyos'Default route distance:
set interfaces ethernet eth0 dhcp-options default-route-distance 210Rejecting the default route from DHCP:
set interfaces ethernet eth0 dhcp-options no-default-routeDHCPv6 Client
Prefix delegation:
set interfaces ethernet eth0 dhcpv6-options pd 0 interface eth1 address 1
set interfaces ethernet eth0 dhcpv6-options pd 0 length 56Rapid commit:
set interfaces ethernet eth0 dhcpv6-options rapid-commitTemporary addresses:
set interfaces ethernet eth0 dhcpv6-options temporaryBinding to a VRF
set interfaces ethernet eth0 vrf REDTraffic Mirroring
Inbound traffic:
set interfaces ethernet eth0 mirror ingress eth1Outbound traffic:
set interfaces ethernet eth0 mirror egress eth1Traffic Policies (QoS)
set interfaces ethernet eth0 traffic-policy in MY-SHAPER
set interfaces ethernet eth0 traffic-policy out MY-LIMITEROperational Commands
Viewing State
All Ethernet interfaces:
show interfaces ethernetA specific interface:
show interfaces ethernet eth0Brief information:
show interfaces ethernet eth0 briefPhysical Parameters
show interfaces ethernet eth0 physicalThe output includes:
- Speed and duplex
- Auto-negotiation status
- Link state (link up/down)
- Error statistics
Interface Counters
show interfaces ethernet eth0 statisticsClearing Counters
clear interfaces ethernet eth0 countersTraffic Monitoring
monitor interfaces ethernet eth0 trafficTraffic Capture
monitor traffic interface eth0
monitor traffic interface eth0 filter 'port 80'Configuration Examples
Simple LAN Interface
set interfaces ethernet eth0 address 192.168.1.1/24
set interfaces ethernet eth0 description 'LAN'
set interfaces ethernet eth0 speed 1000
set interfaces ethernet eth0 duplex fullWAN Interface with DHCP
set interfaces ethernet eth1 address dhcp
set interfaces ethernet eth1 description 'WAN'
set interfaces ethernet eth1 dhcp-options default-route-distance 210Trunk Port with Multiple VLANs
set interfaces ethernet eth2 description 'Trunk to switch'
set interfaces ethernet eth2 mtu 1500
set interfaces ethernet eth2 vif 10 address 192.168.10.1/24
set interfaces ethernet eth2 vif 10 description 'VLAN 10 - Management'
set interfaces ethernet eth2 vif 20 address 192.168.20.1/24
set interfaces ethernet eth2 vif 20 description 'VLAN 20 - Data'
set interfaces ethernet eth2 vif 30 address 192.168.30.1/24
set interfaces ethernet eth2 vif 30 description 'VLAN 30 - Voice'Interface with Jumbo Frames
set interfaces ethernet eth3 address 10.0.0.1/24
set interfaces ethernet eth3 description 'Storage network'
set interfaces ethernet eth3 mtu 9000
set interfaces ethernet eth3 speed 10000
set interfaces ethernet eth3 duplex fullDual-Stack (IPv4 + IPv6)
set interfaces ethernet eth0 address 192.168.1.1/24
set interfaces ethernet eth0 address 2001:db8:1::1/64
set interfaces ethernet eth0 description 'Dual-stack LAN'
set interfaces ethernet eth0 ipv6 dup-addr-detect-transmits 1Troubleshooting
Interface in Down State
Check the physical connection:
show interfaces ethernet eth0 physicalCheck whether the interface is disabled:
show interfaces ethernet eth0 | grep disableEnable the interface if it is disabled:
delete interfaces ethernet eth0 disable
commitPerformance Problems
Check for errors and collisions:
show interfaces ethernet eth0 statisticsTry disabling offload:
delete interfaces ethernet eth0 offload
commitIncrease the ring buffer:
set interfaces ethernet eth0 ring-buffer rx 1024
set interfaces ethernet eth0 ring-buffer tx 1024
commitAuto-negotiation Problems
Fix the speed and duplex:
set interfaces ethernet eth0 speed 1000
set interfaces ethernet eth0 duplex full
commitVLAN Problems
Make sure the parent interface is active:
show interfaces ethernet eth0Check the VLAN ID:
show interfaces ethernet eth0 vifBest Practices
- Use descriptions for all interfaces and VLANs
- Fix the speed/duplex for critical connections
- Plan the MTU - account for the VLAN tag (4 bytes)
- Test offload - it may cause problems with some hardware
- Monitor errors - check the counters regularly
- Document VLANs - use clear descriptions
- Back up the configuration before making changes