vlan with modified MAC fails to communicate

Ryan Stone rysto32 at gmail.com
Fri Mar 29 14:37:23 UTC 2013


On Fri, Mar 29, 2013 at 10:05 AM, Pablo Ribalta Lorenzo <rlp at semihalf.com>wrote:

> Thanks for your answer Barney,
>
> I'm going to extend a little bit the explanation of the issue as it may be
> too brief.
>
> First of all, ifconfig shows me this (mge being the NIC):
>
> mge1: flags=8843<UP,BROADCAST,**RUNNING,SIMPLEX,MULTICAST> metric 0 mtu
> 1500
>         options=8000b<RXCSUM,TXCSUM,**VLAN_MTU,LINKSTATE>
>         ether 00:01:01:58:31:30
>         inet 192.168.126.9 netmask 0xffffff00 broadcast 192.168.126.255
>         media: Ethernet autoselect (1000baseT <full-duplex,master>)
>         status: active
> vlan1: flags=8843<UP,BROADCAST,**RUNNING,SIMPLEX,MULTICAST> metric 0 mtu
> 1500
>         ether 00:01:01:58:31:30
>         media: Ethernet autoselect (1000baseT <full-duplex,master>)
>         status: active
>         vlan: 100 parent interface: mge1
>
>
> Once I set up the ip for vlan1, I'm able to ping outside:
>
> #ifconfig vlan1 inet 172.18.0.254
>
> #ping 172.18.0.1
> PING 172.18.0.1 (172.18.0.1): 56 data bytes
> 64 bytes from 172.18.0.1: icmp_seq=0 ttl=64 time=2.511 ms
> ^C
> --- 172.18.0.1 ping statistics ---
> 1 packets transmitted, 1 packets received, 0.0% packet loss
>
>
> I change MAC address for vlan1 :
> #ifconfig vlan1 ether 00:0d:01:58:51:30
>
> mge1: flags=8843<UP,BROADCAST,**RUNNING,SIMPLEX,MULTICAST> metric 0 mtu
> 1500
>         options=8000b<RXCSUM,TXCSUM,**VLAN_MTU,LINKSTATE>
>         ether 00:01:01:58:31:30
>         inet 192.168.126.9 netmask 0xffffff00 broadcast 192.168.126.255
>         media: Ethernet autoselect (1000baseT <full-duplex,master>)
>         status: active
> vlan1: flags=8843<UP,BROADCAST,**RUNNING,SIMPLEX,MULTICAST> metric 0 mtu
> 1500
>         ether 00:0d:01:58:51:30
>         inet 172.18.0.254 netmask 0xffff0000 broadcast 172.18.255.255
>         media: Ethernet autoselect (1000baseT <full-duplex,master>)
>         status: active
>         vlan: 100 parent interface: mge1
>
> And here is where the problems start, as I'm not able to contact with
> vlan1 from the outside unless:
>
> - Restore the MAC address to be 00:01:01:58:31:30 again
> - Set up promisc mode
>
> As I said, since I was able to see this issue in other platforms and with
> more mature drivers than my 'mge',
> I don't know if this is the expected behavior, or my NIC driver is missing
> something to be able to deal
> with this situation.
>
> However thanks for your hint, I feel I need a little bit of perspective in
> this issue.


>From a quick glance at if_vlan.c, it doesn't do anything intelligent when
you change its MAC address.  I also don't know of any ethernet driver in
FreeBSD that allows you to use multiple unicast MACs at once (I have some
patches for ixgbe, but they aren't ready for prime-time).  If you really
want to have a different MAC on your vlan interface from its parent you
will have to put the parent into promiscuous mode.


More information about the freebsd-net mailing list