Alternative Methods to Create VLAN Interfaces Without vconfig in Linux


4 views

When working with network virtualization on Linux systems, many administrators reach for the vconfig tool by default. However, in environments where package installation isn't possible (like isolated KVM consoles) or when working with modern Linux distributions, we need alternative approaches.

The ip command from iproute2 has become the standard for network configuration:

# Add VLAN 100 with parent interface eth0
ip link add link eth0 name eth0.100 type vlan id 100

# Bring the interface up
ip link set dev eth0.100 up

# Verify the configuration
ip -d link show eth0.100

For persistent configuration in /etc/network/interfaces:

auto eth0.100
iface eth0.100 inet static
    address 192.168.100.2
    netmask 255.255.255.0
    vlan-raw-device eth0

If NetworkManager is available:

nmcli con add type vlan ifname eth0.100 dev eth0 id 100
nmcli con mod vlan-eth0.100 ipv4.addresses 192.168.100.2/24
nmcli con up vlan-eth0.100

If VLAN interfaces won't come up:

  • Verify the physical interface supports VLAN tagging: ethtool -k eth0 | grep tx-vlan
  • Check kernel module loading: lsmod | grep 8021q
  • For legacy systems, manually load the module: modprobe 8021q

For complex setups with bonded interfaces:

ip link add link bond0 name bond0.200 type vlan id 200
ip addr add 10.0.200.2/24 dev bond0.200
ip link set bond0.200 up

When working with legacy systems or restricted environments where package installation isn't possible, traditional VLAN configuration using vconfig becomes problematic. This frequently occurs in:

  • KVM/QEMU virtual machines with console-only access
  • Production servers with no internet connectivity
  • Minimal Linux installations missing VLAN utilities

The Linux kernel has built-in VLAN support through the 8021q module. Verify its availability:

lsmod | grep 8021q
modprobe 8021q

Direct kernel-level VLAN interface creation without vconfig:

ip link add link eth0 name eth0.100 type vlan id 100
ip link set eth0.100 up
ip addr add 192.168.100.2/24 dev eth0.100

For Debian-based systems, a working configuration example:

auto eth0.100
iface eth0.100 inet static
    address 192.168.100.2
    netmask 255.255.255.0
    vlan-raw-device eth0
    gateway 192.168.100.1

When VLAN interfaces don't come up automatically:

  1. Verify 8021q module loading at boot: echo "8021q" >> /etc/modules
  2. Check physical interface status: ip link show eth0 must show UP state
  3. Test manual creation before adding to configuration files

For systems with NetworkManager but no vconfig:

nmcli con add type vlan ifname eth0.200 dev eth0 id 200
nmcli con mod vlan-eth0.200 ipv4.addresses 10.0.200.5/24
nmcli con up vlan-eth0.200

Confirm VLAN configuration:

ip -d link show eth0.100
cat /proc/net/vlan/config