IFCFG-VLAN(5)
π ifcfg-vlan(5) β virtual LAN interface configuration
okay bestie, buckle up π you're reading ifcfg-vlan(5), one of the Network configuration girlies (section 5 of the manual, iykyk). this is the page about virtual LAN interface configuration, and it's honestly not that deep once you see it. let's go π¦
β¨ SYNOPSIS β¨
/etc/sysconfig/network/ifcfg-*
that's it. that's the whole vibe. config files in /etc/sysconfig/network/ named ifcfg- something. slay π
πΈ Virtual LANs (802.1q) πΈ
the bare minimum, no cap
so to set up a vlan interface you need a config file, and that file has to contain at least this one mandatory variable:
ETHERDEVICEβ the real interface that's used for the virtual LAN. like, the actual physical one underneath. noETHERDEVICE, no vlan, periodt.
the optional extras π
your file may also contain this optional variable:
VLAN_PROTOCOLβ set it to one of the supported protocols:"ieee802-1Q","ieee802-1ad". pick your fighter.
and it may also contain this optional one:
VLAN_IDβ specifies the VLAN ID. which is kind of the whole point, but go off.
where does the VLAN ID come from if you don't set it?? π
by default β and literally anytime VLAN_ID is not set β the number at the end of the interface name is the VLAN ID. the name tells you. iconic behaviour honestly.
naming schemes (types) π
preferably the interface name and the configuration file follow the VLAN interface name schemes (types), which is either:
ifcfg-name.<VLAN-ID> (e.g. ifcfg-eth0.42)
or
ifcfg-vlan<VLAN-ID> (e.g. ifcfg-vlan42)
the ifcfg-name.<VLAN-ID> scheme is default on Linux. π
β οΈ also note, bestie: theifcfg-vlan<VLAN-ID>scheme makes it impossible to use the same VLAN-ID on more than one interface (e.g.ifcfg-eth0.42andifcfg-eth1.42). so likeβ¦ pick the other scheme if you need that. π
the VLAN-ID can also be 0-padded, no stress (e.g. ifcfg-vlan0042 or ifcfg-eth0.0042). β¨
custom names (yes you can, but hear me out) π«Ά
also, in case of custom names, trailing digits are interpreted as VLAN-ID by default (e.g. ifcfg-dmz42). but when VLAN_ID is set in the config, the interface name can have any name at all (e.g. ifcfg-foobar). free the naming, live your truth.
π note: the drawback of custom interface names and VLAN_ID usage is that a rename of the interface is required, and that they violate the vlan name scheme. so it's giving "works but the linter is crying". still valid though.
don't forget the parent interface!! π
an ifcfg- file for the interface specified by ETHERDEVICE must also be provided. in the most basic case, it should at least contain STARTMODE='auto'. that's the bare minimum bestie, please don't skip it.
the rest is literally just normal interface stuff
the rest of the VLAN interface IP and routes configuration do not differ from ordinary interfaces. see also man ifcfg and man routes for details. π§
π EXAMPLES π
sets up eth0.3 vlan interface on top of eth0:
ifcfg-eth0.3
STARTMODE='auto'
ETHERDEVICE='eth0'
IPADDR='192.168.3.27/24'
sets up vlan3 vlan interface on top of eth0:
ifcfg-vlan3
STARTMODE='auto'
ETHERDEVICE='eth0'
IPADDR='192.168.3.27/24'
sets up lan1 vlan interface with ID 42 on top of eth0:
ifcfg-lan1
STARTMODE='auto'
ETHERDEVICE='eth0'
VLAN_ID='42'
IPADDR='192.168.3.27/24'
see how lan1 doesn't end in 42? that's the VLAN_ID doing its lil main character thing π no trailing-digit guessing needed.
π BUGS π
found a bug? please report bugs as described at <https://bugs.opensuse.org> β the maintainers genuinely want to know, fr fr. π«Ά
π AUTHOR π
- Mads Martin Joergensen
<mmj@suse.de> - Marius Tomaschewski
<mt@suse.de>
legends, both of them. π
π SEE ALSO π
routes(5), ifcfg(5), wicked(8).
and that's the whole page bestie!! go forth and vlan responsibly π
β this page came to you courtesy of wicked, dated January 2014 β yes it's vintage, yes it still ate. β
π¦ where this page comes from
- opensuse-leap 16.0: wicked 0.6.80-bp160.2.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: wicked 0.6.80-bp160.2.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: wicked 0.6.80-bp160.2.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: wicked 0.6.80-bp160.2.1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms