Sunday, August 12, 2018

VLAN Support | Debian Linux

To enable the VLAN support in Linux we need to install a module.

Check if already enabled and supported:

~ $lsmod |grep 802

Then install 802.1q module:

~ $modprobe 8021q

Before we can use the VLANs in Linux we will have to create the virtual interfaces (in similar way like Cisco devices).

First bring the physical interface up without IP address:

~ $ifconfig eth0 0.0.0.0 up
 Now Create a VLAN and bind it on the physical interface. It will create a virtual one automatically.
~ $vconfig add eth0 2
Added VLAN with VID == 2 to IF -:eth0:-

~ $vconfig add eth0 100
Added VLAN with VID == 100 to IF -:eth0:-
 Assign IP address to the virtual interface. 
Each VLAN has to be in a different subnet!
 
~ $ifconfig eth1.2 10.11.10.254 netmask 255.255.255.0 up

If you don't have already = make /etc/rc.local  executable and add all the steps we've done above.

chmod +x /etc/rc.local

nano /etc/rc.local
.
.
.
.
.
.
.


;) 



No comments:

Post a Comment

Thank you for your comment. Will try to react as soon as possible.

Regards,

Networ King