VLAN-INTERFACES(5)

πŸ“¦
version 2.0.5ubuntu5 Β· 2 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

✨ VLAN-INTERFACES ✨ (that's the vlan manpage bestie πŸ’…)

okay so this is the manual page for vlan β€” it's a file format page, sitting at section 5, and it's all about the vlan glow-up for /etc/network/interfaces. πŸ¦‹


🌸 NAME 🌸

/etc/network/interfaces (vlan) β€” the vlan extensions for the interfaces(5) file format. that's it, that's the name, no notes. πŸ’–


πŸ’« DESCRIPTION πŸ’«

/etc/network/interfaces is where all the network interface configuration lives, and it's what ifup(8) and ifdown(8) read when they do their thing. ✨

this page is specifically about the vlan extensions to the standard interfaces(5) format. not the whole format, just the vlan part. iykyk. πŸŽ€

so there's two kinds of extensions going on here:

  • primary extensions β€” these make vlan interfaces and destroy vlan interfaces. the main characters. πŸ‘‘
  • secondary extensions β€” these do ipv4 interface manipulation, and you lowkey generally need them when you're running (a lot of) vlans.

🧚 VLAN CREATION 🧚

a vlan interface definition is made of two things: the vlan interface name, and an optional raw-device parameter. that's the whole recipe bestie. πŸ“

vlan interfaces are numbered 1 to 4095. ⭐

and here's the fun part β€” you get to choose how your interface names look: you can have them zero-padded to 4 numbers, or just the plain digits with no leading zero. both are valid, they just give you different names.

the following example shows four ways to create a vlan with id 1 on interface eth0. and no cap β€” they all result in different names. πŸ’€

 iface eth0.1 inet static
      address 192.168.1.1
      netmask 255.255.255.0

 iface vlan1 inet static
      vlan-raw-device eth0
      address 192.168.1.1
      netmask 255.255.255.0

 iface eth0.0001 inet static
      address 192.168.1.1
      netmask 255.255.255.0

 iface vlan0001 inet static
      vlan-raw-device eth0
      address 192.168.1.1
      netmask 255.255.255.0

 # We don't have br support out of the box
 iface br0.2 inet static
      vlan-raw-device br0
      address 192.168.1.1
      netmask 255.255.255.0

 # Aliases are ignored
 iface br0.2:1 inet static
      address 192.168.1.1
      netmask 255.255.255.255

see how eth0.1 and vlan1 and eth0.0001 and vlan0001 are all the same vlan id but four totally different names? that's the zero-padding situation right there. 🫢

also peep the comments: no br support out of the box, and aliases are ignored. noted. πŸ“


πŸ’… EXTRA IFACE OPTIONS πŸ’…

usually if you're out here using vlans, you also wanna do some other little manipulations with the ip stack or the interface. relatable honestly. so here's the extra options:

  • vlan-raw-device devicename β€” tells it which device to create the vlan on. ⚠️ this one gets ignored when the devicename is already part of the vlan interface name. so if it's in the name, you don't need to say it again.
  • ip-proxy-arp 0|1 β€” turns proxy-arp off (0) or on (1) for this specific interface. and yes bestie, this also works on plain ethernet-like devices. ✨
  • ip-rp-filter 0|1|2 β€” sets the return path filter for this specific interface. same deal, this also works on plain ethernet-like devices. 🌈
  • hw-mac-address mac-address β€” this sets the mac address of the interface before bringing it up. works on any device that lets you set the hardware address with the ip command. πŸ”₯

πŸŽ€ AUTHOR πŸŽ€

this manpage was adapted from interfaces(5) by Ard van Breemen <ard@kwaak.net> β€” shoutout to them, real ones. πŸ’œ


πŸ” SEE ALSO πŸ”


πŸ’– and that's the whole page bestie, you ate it. go forth and vlan responsibly. πŸ’…βœ¨

so this page is from the vlan manual and it's dated September 30 2007 β€” yeah it's giving vintage but it still serves. mwah. πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from