Jump to content
Aerosol

Configuring VLANs on Debian

Recommended Posts

Posted

This will be the shortest tut made by me because need only few changes. On the begin we will install VLAN packet. This will be done using command:


# apt-get install vlan -y

After this we will load 8021q module into the kernel using command;


# sh -c 'grep -q 8021q /etc/modules || echo 8021q >> /etc/modules'

Now the only thing required is to add VLANs into the /etc/network/interfaces file as next example:


auto eth1
iface eth1 inet static
address 192.168.0.101
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.254
dns-nameserver 8.8.8.8

# VLAN 69
auto vlan69
iface vlan69 inet static
address 172.16.69.25
netmask 255.255.255.248
network 172.16.69.24
broadcast 172.16.69.31
vlan_raw_device eth2

# VLAN 96
auto vlan96
iface vlan96 inet static
address 10.10.96.1
netmask 255.255.255.0
network 10.10.96.0
broadcast 10.10.96.255
mtu 1500
vlan_raw_device eth2

Now for the job to be done we will restart networking and all will be done


# /etc/init.d/networking restart

* Reconfiguring network interfaces...
ssh start/running, process 1400

Set name-type for VLAN subsystem. Should be visible in /proc/net/vlan/config
Added VLAN with VID == 69 to IF -:eth2:-
ssh stop/waiting
ssh start/running, process 1465

Set name-type for VLAN subsystem. Should be visible in /proc/net/vlan/config
Added VLAN with VID == 96 to IF -:eth2:-
ssh stop/waiting
ssh start/running, process 1530
[ OK ]

To check if are up we will read file vlan/config using command # cat /proc/net/vlan/config. The output will be the next if all is good.


VLAN Dev name | VLAN ID
Name-Type: VLAN_NAME_TYPE_PLUS_VID_NO_PAD
vlan69 | 69 | eth2
vlan96 | 96 | eth2

Author: razvan1@hy

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...