Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Mar 2013 15:05:15 +0100
From:      Pablo Ribalta Lorenzo <rlp@semihalf.com>
To:        Barney Cordoba <barney_cordoba@yahoo.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: vlan with modified MAC fails to communicate
Message-ID:  <51559F9B.3060608@semihalf.com>
In-Reply-To: <1364561838.74177.YahooMailClassic@web121605.mail.ne1.yahoo.com>
References:  <1364561838.74177.YahooMailClassic@web121605.mail.ne1.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 03/29/2013 01:57 PM, Barney Cordoba wrote:
>
> --- On Fri, 3/29/13, Pablo Ribalta Lorenzo <rlp@semihalf.com> wrote:
>
>> From: Pablo Ribalta Lorenzo <rlp@semihalf.com>
>> Subject: vlan with modified MAC fails to communicate
>> To: freebsd-net@freebsd.org
>> Date: Friday, March 29, 2013, 7:53 AM
>> Hi there!
>>
>> Lately I've been investigating an issue that I would like to
>> share, as I feel I may have to attack it from a different
>> end.
>>
>> I have an ethernet interface from where I create a vlan.
>> Once I set up the ip address in the vlan I can ping
>> correctly on both
>> sides. The issue arrives when I try to change the MAC
>> address of the vlan, as from then on it fails to communicate
>> unless:
>>
>> - I restore vlan's MAC address to its previous value
>> - I enable promisc mode.
>>
>> It's also worth to mention that my current setup is FreeBSD
>> 8.3 and the NIC driver I'm using is not fully mature.
>>
>> I was wondering if this behavior is due to some limitations
>> in the NCI driver I'm using or if in fact it's the correct
>> way to
>> proceed, as it was possible to reproduce this same issue in
>> FreeBSD 8.3 and FreeBSD CURRENT versions, even using more
>> mature
>> NIC drivers as 'em' and 're'.
>>
>> Could somebody please shed some light in this? Thank you.
>>
> Without looking at the code, it's likely that you should be changing
> the MAC address BEFORE you set up the VLAN. The mac is probably being
> mapped into some table that being used to track the vlans.
>
> BC

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.


-- 
Pozdrawiam,
Pablo Ribalta Lorenzo




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51559F9B.3060608>