Linux: Configure an interface for a tagged vlan by ifconfig

Hi,

your linux box is connected to an ethernet switch where vlan tagging is configured (trunc) and you want to configure your network manually by ifconfig?

Load the module for tagged vlans 802.1q.

root@debdev ~# modprobe 8021q

Add the vlan to the interface. In this example VLAN ID 11 at Interface eth0

root@debdev ~# vconfig add eth0 11
Added VLAN with VID == 11 to IF -:eth0:-

Configure IP Address

root@debdev ~# ifconfig eth0.11 192.168.254.11 netmask 255.255.255.0 up

And add a (default) route if necessary

root@debdev ~# route add default gw 192.168.254.1

Leave a Reply Cancel reply