vlan

Setting up DHCP on an Enslaved VLAN Bridge on CentOS Linux

I had to setup a single interface on a server, with dual DHCP IP addresses that were obtained on the native untagged interface along with a tagged interface enslaved to VLAN bridge in order to rollout Enomaly SpotCloud. Thus the primary interface obtains its IP address via DHCP along with the bridged interface on a VLAN. To set this up :

1. cd /etc/sysconfig/network-scripts

2. vi ifcfg-eth0 so it looks like (change your MAC address accordingly):

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
HWADDR=f4:ce:46:82:55:f4

3. Then create your VLAN interface configuration. So vi ifcfg-eth0.1051:

DEVICE=eth0.1051
BOOTPROTO=dhcp
VLAN=yes
BRIDGE=virbr0
ONBOOT=yes

4. Then create your bridge interface configuration: So vi ifcfg-virbr0:

DEVICE=virbr0
TYPE=Bridge
ONBOOT=yes
DELAY=0
BOOTPROTO=dhcp

Note that TYPE must be Bridge with a capital B – otherwise it won’t work. And there you have it – when the box boots it gets a DHCP lease on eth0 and on virbr0 which is on VLAN 1051.

Tags: , ,

Wednesday, June 1st, 2011 Linux, System Administration No Comments

Translate

EnglishFrenchGermanItalianPortugueseRussianSpanish

Find us on Facebook