VLANs on Linux
Before you begin configuration, make sure the IP address of the switch falls within the new management subnet. The IP configuration is associated with a virtual interface. This is normally VLAN1.
Listing 6. IP Address for VLAN1
interface VLAN1 ip address 10.0.0.2 255.255.255.224
The firewall is connected to port 1 on the switch, which is referred to as FastEthernet 0/1 in IOS notation. The first task is to set the encapsulation and native VLAN, then you can enable the trunk.
Listing 7. Enabling the Trunk
interface FastEthernet 0/1 switchport trunk encapsulation dot1q switchport trunk native vlan 1 switchport mode trunk
Once the trunk is active, you need to move ports from the default VLAN into their new one. This is done by entering the interface configuration and issuing switchport access vlan <vlan id>. Although not necessary, it is helpful to physically group VLANs to make them easier to manage.
Listing 8. Moving the Ports
interface FastEthernet0/2 switchport access vlan 2 interface FastEthernet0/3 switchport access vlan 2 interface FastEthernet0/4 switchport access vlan 3 interface FastEthernet0/5 switchport access vlan 3 interface FastEthernet0/2 switchport access vlan 3
Once your changes are complete, you can see which ports are in which VLAN by using the show vlan command.
The first order of business is to test whether you can move packets of all sizes successfully without MTU issues. Packets above 1,476 bytes should trigger any MTU issue you have. This can be tested by pinging from the firewall to a machine on a non-native VLAN. If small packets work but large packets do not, you most likely have an MTU issue.
Because you are using DHCP, you now need to update your dhcpd.conf file to reflect the new subnets. Once it is restarted, client machines start to receive their new IP addresses.
Without a policy, a firewall is useless. Unfortunately, defining that policy is beyond the scope of this article. However, a variety of effective tools are freely available for this purpose.
Now that everything is working, we need to make sure the switch's new configuration is written to memory. This is done from enable mode using the write memory command.
As you can see, VLAN trunking can be a valuable tool. I hope you have learned where it can be useful, the risks and benefits of using it and the basics of its configuration. Even though this document focuses on a Cisco 2924 switch, it shouldn't be difficult to translate the configuration here to any switch that supports 802.1q trunks.
I would like to give special thanks to Cheryl Lehman for helping to make my first article readable and to Randall Shutt for reviewing the content.
Paul Frieden has been working with Linux for eight years. He currently works for Parkland College as a Network Specialist. If you have further questions, you can reach him at email@example.com.
- Readers' Choice Awards 2013
- Mars Needs Women
- RSS Feeds
- Sublime Text: One Editor to Rule Them All?
- December 2013 Issue of Linux Journal: Readers' Choice
- New Products
- IBM Will Minimize Impact of Future Disasters
- Raspberry Pi: the Perfect Home Server
- Advanced Hard Drive Caching Techniques
- Tech Tip: Really Simple HTTP Server with Python
- why is GNOME 3 in the fifth position at 14.1 %?
2 hours 14 min ago
- Sublime Is Brilliant!
7 hours 16 min ago
7 hours 36 min ago
- Rapid[Disk,Cache] better than native ram caching?
8 hours 1 min ago
- Nothing is perfect
8 hours 14 min ago
- Mixtapes Community
13 hours 53 min ago
- KDE is one true DE
14 hours 27 min ago
- Command Line Shells (Bash, Zsh, etc.) are 2nd place
14 hours 56 min ago
16 hours 51 min ago
- yes it's Jupiter Broadcasting
18 hours 10 min ago