Linux VLAN Trunking: Difference between revisions

From ITCwiki
Jump to navigation Jump to search
(Created page with '=Basic VLAN Trunking in Debian based Linux.= ==Goals of Lab== *Enable 802.1Q Tagging *Create Virtual Interfaces == Scenario == middle ==Step 1== The f…')
 
No edit summary
Line 9: Line 9:
==Step 1==
==Step 1==
The first thing you'll want to do is install the VLAN package using aptitude.
The first thing you'll want to do is install the VLAN package using aptitude.
:"aptitude install vlan"
:aptitude install vlan
:[[File:Installvlan.jpg|middle]]
:[[File:Installvlan.jpg|middle]]
Note: if aptitude can't find the package, use the command "aptitude update" before trying to install the package.
Note: if aptitude can't find the package, use the command "aptitude update" before trying to install the package.


==Step 2==
==Step 2==
Load the module that enables 802.1Q into the kernel
Load the 802.1Q module into the kernel
:"sudo modprobe 8021q"
:sudo modprobe 8021q
Then verify the module has been loaded into the kernel
Then verify the module has been loaded into the kernel
:"lsmod | grep 8021q"
:lsmod | grep 8021q


The output on your screen should look similar:
The output on your screen should look similar:
Line 23: Line 23:


==Step 3==
==Step 3==
Use vconfig to add
Use vconfig to add virtual interfaces / VLANS
:vconfig add eth0 10
:vconfig add eth0 20
:vconfig add eth0 30
:vconfig add eth0 40
 
:[[File:Vconfig.jpg|middle]]
 
==Step 4==
Configure IP Addresses on the virtual interfaces.
:ifconfig etho.10 10.0.1.2 netmask 255.255.255.0
:ifconfig etho.20 10.0.2.2 netmask 255.255.255.0
:ifconfig etho.30 10.0.3.2 netmask 255.255.255.0
:ifconfig etho.40 10.0.4.2 netmask 255.255.255.0
 
:[[File:Configvlanip.jpg|middle]]
 
==Step 5==
Configure the default gateway for each virtual interface / VLAN
 
:route add -net 10.0.1.0 netmask 255.255.255.0 gw 10.0.1.1
:route add -net 10.0.2.0 netmask 255.255.255.0 gw 10.0.2.1
:route add -net 10.0.3.0 netmask 255.255.255.0 gw 10.0.3.1
:route add -net 10.0.4.0 netmask 255.255.255.0 gw 10.0.4.1
 
:[[File:Defaultroute.jpg|middle]]

Revision as of 02:23, 7 May 2010

Basic VLAN Trunking in Debian based Linux.

Goals of Lab

  • Enable 802.1Q Tagging
  • Create Virtual Interfaces

Scenario

Linuxproject.jpg

Step 1

The first thing you'll want to do is install the VLAN package using aptitude.

aptitude install vlan
Installvlan.jpg

Note: if aptitude can't find the package, use the command "aptitude update" before trying to install the package.

Step 2

Load the 802.1Q module into the kernel

sudo modprobe 8021q

Then verify the module has been loaded into the kernel

lsmod | grep 8021q

The output on your screen should look similar:

Modprobe.jpg

Step 3

Use vconfig to add virtual interfaces / VLANS

vconfig add eth0 10
vconfig add eth0 20
vconfig add eth0 30
vconfig add eth0 40
Vconfig.jpg

Step 4

Configure IP Addresses on the virtual interfaces.

ifconfig etho.10 10.0.1.2 netmask 255.255.255.0
ifconfig etho.20 10.0.2.2 netmask 255.255.255.0
ifconfig etho.30 10.0.3.2 netmask 255.255.255.0
ifconfig etho.40 10.0.4.2 netmask 255.255.255.0
Configvlanip.jpg

Step 5

Configure the default gateway for each virtual interface / VLAN

route add -net 10.0.1.0 netmask 255.255.255.0 gw 10.0.1.1
route add -net 10.0.2.0 netmask 255.255.255.0 gw 10.0.2.1
route add -net 10.0.3.0 netmask 255.255.255.0 gw 10.0.3.1
route add -net 10.0.4.0 netmask 255.255.255.0 gw 10.0.4.1
Defaultroute.jpg