Linux VLAN Trunking
Jump to navigation
Jump to search
Basic VLAN Trunking for Linux.
- Goal of Lab
- Create sub-interfaces with VLAN tagging enabled
Scenario
Step 1
The first thing you'll want to do is install the VLAN package using aptitude.
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
- modprobe 8021q
Then verify the module has been loaded into the kernel
- lsmod | grep 8021q
The output on your screen should look similar:
Step 3
Use vconfig to add VLANS
- vconfig add "interface" "VLAN"
- VLAN's 10, 20, 30, and 40 are now created (as sub-interfaces), labeled as eth0.10, eth0.20, eth0.30, eth0.40
- Verify the VLANS / Sub-interfaces are up by running the ifconfig command
Step 4
Configure IP Addresses on the VLANS / sub-interfaces.
- ifconfig "interface.VLAN" "ip address" netmask "subnet mask"
Step 5
Configure the default gateway (add a route) for each VLAN / sub-interface
- route add -net "network address" netmask "subnet mask" gw "default gateway"
- The server should now be trunking VLANS 10,20,30, and 40 over eth0