# rc.conf VLAN and dhclient ?



## lbl (Sep 27, 2009)

Hi

I have been trying to create 3 vlans in the rc.conf and make one of them static and 2 of them dynamic.

```
cloned_interfaces="vlan100 em0.110 em0.120"
ifconfig_em0="up"
ifconfig_vlan100="inet 10.20.5.52 netmask 255.255.255.0 vlan 100 vlandev re0"
ifconfig_em0.110="DHCP"
ifconfig_em0.120="DHCP"
```
This should do the trick ... but it dosent ?

/lbl


----------



## Alt (Sep 27, 2009)

There is no parent device for em0.110 and em0.120 so they will not work


----------



## lbl (Sep 27, 2009)

In FreeBSD 7.2 and 8.0-RC1 they will get parrents if you name en like this i dont know about older versions.

/lbl


----------



## Alt (Sep 27, 2009)

If they get their parents it is showing in ifconfig? The problem in vlan/dhcp order then ?


----------



## lbl (Sep 27, 2009)

They get thier parents and vlan's set so i think you are right.

The only problem is that i dont know how to change the order ... the box will be running natd and ipfw aswell so the only important thing is that they get ip's before those 2 services start.


----------



## lbl (Sep 27, 2009)

Hmm

I tested it thrug now and it seems that the rc scripts cant find the command "ifconfig_em.110=dhcp" ...

Anyway i got it working now ...

```
cloned_interfaces="vlan100 vlan110 vlan120"
ifconfig_em0="up"
ifconfig_vlan100="inet 10.20.5.52 netmask 255.255.255.0 vlan 100 vlandev re0"
ifconfig_vlan110="vlan 110 vlandev re0 dhcp"
ifconfig_vlan120="vlan 120 vlandev re0 dhcp"
```
But it seems like the rc scripts wont allow a "." in the interface names if it needs to do some dhcp magic on it.

/lbl


----------

