Linux: Configure an interface for a tagged vlan by ifconfig


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 netmask up

And add a (default) route if necessary

root@debdev ~# route add default gw
Advertisment to support

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.