Configuring VLANs for the MZ912 in the OS
The MZ912 allows tagged and untagged packets to pass through. You can set the VLAN ID in the OS or keep packets untagged.
To configure VLANs in SLES 11, perform the following steps:
- Run the modprobe 8021q command to load the 802.1q module.
- Run the ifconfig –a and yast2 lan commands to locate the MZ912 NIC ports.
- Run the vconfig add eth[num] [vlan id] command to add VLANs for the ports. For example, to add VLANs 100 and 200 for port eth13, run the following commands:
#vconfig add eth13 100 #vconfig add eth13 200
- Run the ifconfig eth[num] [ip address] netmask [netmask] command to set IP addresses for the VLANs, which are equivalent to the IP addresses of ports eth[num].
#ifconfig eth13.100 192.168.100.10 netmask 255.255.255.0 #ifconfig eth13.200 192.168.200.10 netmask 255.255.255.0
- Add the VLAN configuration to the configuration file. The OS will automatically load the VLAN configuration after resetting or powering off and then on.
- Run the echo command to configure the system to load the 802.1q module upon startup.
#echo "modprobe 8021q">>/etc/rc.local
- Back up the interfaces file in /etc/network/.
#cp /etc/network/interfaces /etc/network/interfaces.default
- Add the VLAN configuration to the interfaces file in /etc/network/.
#vim /etc/network/interfaces
Add the following information to the interfaces file:
auto lo eth13 iface lo inet loopback iface eth13.100 inet static address 192.168.100.10 netmask 255.255.255.0 iface eth13.200 inet static address 192.168.200.10 netmask 255.255.255.0
IP addresses that belong to different VLANs must be configured on different network segments.
- Run the echo command to configure the system to load the 802.1q module upon startup.