Suse Linux 11: How to configure VLANs

Today I needed to add vlans on a suse11 box.

Following stuff I did:

In YAST you enter network devices and change the config of the Hardware Ethernet Adapter to its IP adress.
Then you add a new device of the catogory “VLAN” and after that you can configure its ip addresses.

When you restart the network (rcnetwork restart) you will find all the interfaces online, though the ping might take a bit to work (even if portfast is configured on the switch). So no panic if the first pings do not work šŸ™‚

What you might need to add manually is the vlan tagging method. I used 802.1q and had to load the module on boot.
To achive this you have to edit /etc/sysconfig/kernel
In this configuration file you will find a a line with “MODULES_LOADED_ON_BOOT” and you just add “8021q” in this line.

So it will look like this:
MODULES_LOADED_ON_BOOT=”8021q”

After that you can (if you want) manually add the config for the VLAN.
The files under /etc/sysconfig/network will look like this (in the example eth1 is a trunked port):

ifcfg-eth1:
BOOTPROTO=’static’
BROADCAST=’192.168.200.255′
ETHERDEVICE=”
ETHTOOL_OPTIONS=”
IPADDR=’192.168.200.240′
MTU=”
NAME=”
NETWORK=’192.168.200.0′
REMOTE_IPADDR=”
STARTMODE=’onboot’
USERCONTROL=’no’
PREFIXLEN=”
NETMASK=’255.255.255.0′

 ifcfg-vlan2:
BOOTPROTO=’static’
BROADCAST=”
ETHERDEVICE=’eth1′
ETHTOOL_OPTIONS=”
IPADDR=’192.168.0.100′
MTU=”
NAME=”
NETMASK=’255.255.255.0′
NETWORK=’192.168.0.0′
REMOTE_IPADDR=”
STARTMODE=’auto’
USERCONTROL=’no’

ThatĀ“s it. Have fun with VLANs on linux

Advertisements
This entry was posted in Linux, SuSE and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.