vlan ip lost after netif restart

Hi,
Got in situation, when I get my vlans lose their IP addreses after I execute the [cmd=]/etc/rc.d/netif restart && /etc/rc.d/routing restart[/cmd] command. I've got some vlans configured in /etc/rc.conf.

Code:
ifconfig_igb0="up"
cloned_interfaces="vlan5 vlan20 vlan25 vlan1110"
ifconfig_vlan5="inet 10.128.50.1 netmask 255.255.255.0 vlan 5 vlandev igb0"
ifconfig_vlan1110="inet 192.168.250.1 netmask 255.255.255.0 vlan 1110 vlandev igb0"
ifconfig_vlan20="inet 192.168.251.1 netmask 255.255.255.0 vlan 20 vlandev igb0"
ifconfig_vlan25="inet 192.168.255.253 netmask 255.255.255.252 vlan 25 vlandev igb0"

after the netif restart all of them are loosing their IP addresses:

Code:
igb0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=1bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4>
        ether 98:4b:e1:64:25:06
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
vlan5: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3<RXCSUM,TXCSUM>
        ether 98:4b:e1:64:25:06
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        vlan: 5 parent interface: igb0
vlan20: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3<RXCSUM,TXCSUM>
        ether 98:4b:e1:64:25:06
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        vlan: 20 parent interface: igb0
vlan25: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3<RXCSUM,TXCSUM>
        ether 98:4b:e1:64:25:06
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        vlan: 25 parent interface: igb0
vlan1110: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3<RXCSUM,TXCSUM>
        ether 98:4b:e1:64:25:06
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        vlan: 1110 parent interface: igb0

Any ideas to solve this?

UPD:
Code:
ifconfig: create: bad value
ifconfig: create: bad value
ifconfig: create: bad value
ifconfig: create: bad value
ifconfig: SIOCSETVLAN: Device busy
ifconfig: SIOCSETVLAN: Device busy
ifconfig: SIOCSETVLAN: Device busy
ifconfig: SIOCSETVLAN: Device busy

Seems, like the netif script doesn't destroy the vlan interfaces before revoking them. If I destroy vlans manually and then revoke the netif script, it creates those vlans.

Any patch somewhere there? :)

UPD:
as a simple workaround one could use this line (or create simple sh script)
[CMD=]/etc/rc.d/netif restart && /etc/rc.d/netif clonedown && /etc/rc.d/netif cloneup && /etc/rc.d/routing restart[/CMD]
 
Hello,

If you're using a new release of FreeBSD you should use the "new way" of setting vlans during boot. You can take a look at rc.conf(5) or /etc/defaults/rc.conf for examples.

Code:
vlans_age0="5 6 7"
ifconfig_age0_5="inet 10.6.6.5/24"
ifconfig_age0_6="inet 10.7.7.5/24"
ifconfig_age0_7="inet 10.8.8.5/24"

Code:
age0.5: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=103<RXCSUM,TXCSUM,TSO4>
        ether 00:1e:8c:80:fa:22
        inet 10.6.6.5 netmask 0xffffff00 broadcast 10.6.6.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        vlan: 5 parent interface: age0
age0.6: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=103<RXCSUM,TXCSUM,TSO4>
        ether 00:1e:8c:80:fa:22
        inet 10.7.7.5 netmask 0xffffff00 broadcast 10.7.7.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        vlan: 6 parent interface: age0
age0.7: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=103<RXCSUM,TXCSUM,TSO4>
        ether 00:1e:8c:80:fa:22
        inet 10.8.8.5 netmask 0xffffff00 broadcast 10.8.8.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        vlan: 7 parent interface: age0

Code:
vlans_age0="vlan8 vlan9 vlan10"
create_args_vlan8="vlan 8 inet 10.9.9.5/24"
create_args_vlan9="vlan 9 inet 10.10.10.5/24"
create_args_vlan10="vlan 10 inet 10.11.11.5/24"

Code:
vlan8: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=103<RXCSUM,TXCSUM,TSO4>
        ether 00:1e:8c:80:fa:22
        inet 10.9.9.5 netmask 0xffffff00 broadcast 10.9.9.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        vlan: 8 parent interface: age0
vlan9: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=103<RXCSUM,TXCSUM,TSO4>
        ether 00:1e:8c:80:fa:22
        inet 10.10.10.5 netmask 0xffffff00 broadcast 10.10.10.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        vlan: 9 parent interface: age0
vlan10: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=103<RXCSUM,TXCSUM,TSO4>
        ether 00:1e:8c:80:fa:22
        inet 10.11.11.5 netmask 0xffffff00 broadcast 10.11.11.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        vlan: 10 parent interface: age0
 
romeor said:
how do i mark this thread as solved?

Edit the first post of the thread, click on "Go Advanced". There you can set the the thread to "Solved". It's right next to the thread's title.
 
quintessence you are an internet hero. I've been fighting with VLANs for a couple of days and your pointer to /etc/defaults/rc.conf made all of the difference. Plus, your examples still work! 13 years. I hope the breadcrumb trail I've left for others is as helpful in 2037.
 
Back
Top