Linux VLAN Trunking: Difference between revisions

From ITCwiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
=Basic VLAN Trunking in Debian based Linux.=
=Basic VLAN Trunking in Debian based Linux.=
==Goals of Lab==
==Goal of Lab==
*Enable 802.1Q Tagging
*Create sub-interfaces with VLAN tagging enabled
*Create Virtual Interfaces


== Scenario ==
== Scenario ==
Line 23: Line 22:


==Step 3==
==Step 3==
Use vconfig to add virtual interfaces / VLANS
Use vconfig to add sub-interfaces / VLANS
:vconfig add eth0 10
:vconfig add eth0 10
:vconfig add eth0 20
:vconfig add eth0 20
Line 32: Line 31:


==Step 4==
==Step 4==
Configure IP Addresses on the virtual interfaces.
Configure IP Addresses on the sub-interfaces.
:ifconfig etho.10 ''ip address'' netmask ''subnet mask''
:ifconfig etho.10 ''ip address'' netmask ''subnet mask''


Line 38: Line 37:


==Step 5==
==Step 5==
Configure the default gateway for each virtual interface / VLAN
Configure the default gateway for each sub-interface / VLAN


:route add -net ''ip address'' netmask ''subnet mask'' gw ''default gateway''
:route add -net ''ip address'' netmask ''subnet mask'' gw ''default gateway''

Revision as of 04:46, 7 May 2010

Basic VLAN Trunking in Debian based Linux.

Goal of Lab

  • Create sub-interfaces with VLAN tagging enabled

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 sub-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 sub-interfaces.

ifconfig etho.10 ip address netmask subnet mask
Configvlanip.jpg

Step 5

Configure the default gateway for each sub-interface / VLAN

route add -net ip address netmask subnet mask gw default gateway
Defaultroute.jpg
The server should now be trunking VLANS 10,20,30, and 40 on eth0