nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Linux vlan configuration

This is a discussion on Linux vlan configuration within the Networking, Firewalls and Security forums, part of the Mastering Servers category; 1. Connect the eth0 interface of your linux machine to the switch. 2. Remove the IP Address information on the ...


Go Back   nixCraft Linux Forum > Mastering Servers > Networking, Firewalls and Security

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 12-28-2007, 10:56 AM
Junior Member
User
 
Join Date: Dec 2007
My distro: Redhat
Posts: 3
Rep Power: 0
unixfoo is on a distinguished road
Default Linux vlan configuration

1. Connect the eth0 interface of your linux machine to the switch.
2. Remove the IP Address information on the eth0 interface

# ifconfig eth0 0.0.0.0
# ifconfig eth0 up

3. Configure 2 VLANs on the eth0 interface using vconfig as follows (100,200 are the VLAN id'.
If the 8021q.o module is not loaded, the vconfig command (when invoked first time) will automatically load the module.

# vconfig add eth0 100
# vconfig add eth0 200

4. Configure IP on the VLAN interfaces

# ifconfig eth0.100 xxx.xxx.xxx.xxx netmask 255.255.252.0 up
# ifconfig eth0.200 yyy.yyy.yyy.yyy netmask 255.255.255.0 up

5. Preserve the vlan configuration across reboots by adding it to configuration files. Create the appropriate ifcfg files for eth0, eth0.100 and eth0.200 in /etc/sysconfig/network-scripts/

# cd /etc/sysconfig/network-scripts/

Contents of ifcfg-eth0
DEVICE=eth0
ONBOOT=no
TYPE=Ethernet

Contents of ifcfg-eth0.100
DEVICE=eth0.100
IPADDR=xxx.xxx.xxx.xxx
NETMASK=255.255.252.0
VLAN=yes
ONBOOT=yes
BOOTPROTO=none

Contents of ifcfg-eth0.200
DEVICE=eth0.200
IPADDR=yyy.yyy.yyy.yyy
NETMASK=255.255.0.0
VLAN=yes
ONBOOT=yes
BOOTPROTO=none

Update /etc/sysconfig/network file to make the GATEWAYDEV use the public vlan interface.

Contents of /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=un1xf00
GATEWAY=xxx.xxx.xxx.1
DOMAINNAME=dev.un1xf00.com
GATEWAYDEV=eth0.100


6. The VLAN configuration on the server can be verified in the file /proc/net/vlan/config. Sample contents are shown below.

VLAN Dev name | VLAN ID
Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
eth0.100 | 100 | eth0
eth0.200 | 200 | eth0

More at unix linux & storage
Reply With Quote
Sponsored Links
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Fedora Linux 7 wireless card configuration adahan Linux hardware 3 12-08-2007 12:50 AM
DNS Configuration on Red Hat Linux AS4 shilpigoel1 Linux software 2 07-06-2007 05:06 PM
eth0.1 vlan linux config command chimu Linux software 1 07-19-2006 10:44 PM
Linux Change the time zone configuration after installation raj Linux software 1 07-17-2006 02:11 AM
Linux Change the network configuration after installation jerry Linux software 2 06-14-2006 03:58 PM


All times are GMT +5.5. The time now is 04:23 AM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36