vlan routing

Виталий Туровец corebug at corebug.net
Sun Mar 10 06:17:26 UTC 2013

2013/3/10  <doug at safeport.com>:
> I am trying set this up. First I munged the IP addresses. Not to worry if I
> hit yours. I did the following commands:
>    ifconfig vlan0 create
>    ifconfig vlan0 vlan 95 vlandev fxp0
>    ifconfig vlan0 inet netmask
>    ifconfig fxp0 add netmask
>    route add -inet
> ifconfig shows:
> fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
>         options=8<VLAN_MTU>
>         ether 00:d0:b7:56:cf:ab
>         inet netmask 0xfffffc00 broadcast
>         inet netmask 0xffffffff broadcast
>         inet netmask 0xffffff00 broadcast
>         media: Ethernet autoselect (100baseTX <full-duplex>)
>         status: active
> bge0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
>         ether 00:09:5b:60:e4:1f
>         media: Ethernet autoselect (none)
>         status: no carrier
> vlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
>         ether 00:d0:b7:56:cf:ab
>         inet netmask 0xffffff00 broadcast
>         media: Ethernet autoselect (100baseTX <full-duplex>)
>         status: active
>         vlan: 95 parent interface: fxp0
> Needless to say it does not work. The switch is programmed correctly (I am
> told). My questions are (1) it seems like the option got applied to the
> wrong interface; (2) what did I miss??
> I also tried booting the system with IP of but I did not get
> the rc.conf macros correctly. I do know I can not route through the switch
> without going the vlan commands.
> _____
> Douglas Denault
> http://www.safeport.com
> doug at safeport.com
> Voice: 301-217-9220
>   Fax: 301-217-9277
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"

I guess you shouldn't put the same IP address on two interfaces (vlan
and fxp0), you need to decide wherther you need tagged or untagged
vlan frames there and, depending on this decision put the IP address
on VLAN interface (tagged variant) or fxp0 (untagged one).

If i understand your task correctly, then this line is faulty from
your configuration:
>    ifconfig fxp0 add netmask
You don't need it.

>    route add -inet
This is smth absoulutely wrong:)

Basically, if you only need a vlan interface that could be used for
routing, you need these commands only:

ifconfig vlan95 create
ifconfig vlan95 inet vlan 95 vlandev fxp0

and in /etc/rc.conf you should put such strings:

ifconfig_vlan95="inet vlan 95 vlandev fxp0"

for the interface to be created on reboot.
Hope this helps.


Vitaliy Turovets
NOC Lead @TV-Net ISP
NOC Lead @Service Outsourcing company
X-NCC-RegID: ua.tv

More information about the freebsd-questions mailing list