From owner-freebsd-net@FreeBSD.ORG Fri Mar 29 14:05:19 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 123CDCA4 for ; Fri, 29 Mar 2013 14:05:19 +0000 (UTC) (envelope-from rlp@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 88BB1779 for ; Fri, 29 Mar 2013 14:05:18 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 9BB19C62A5; Fri, 29 Mar 2013 15:05:16 +0100 (CET) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id 87wqTbXfYs-s; Fri, 29 Mar 2013 15:05:15 +0100 (CET) Received: from [10.0.2.212] (cardhu.semihalf.com [213.17.239.108]) by smtp.semihalf.com (Postfix) with ESMTPSA id 03E61C5842; Fri, 29 Mar 2013 15:05:15 +0100 (CET) Message-ID: <51559F9B.3060608@semihalf.com> Date: Fri, 29 Mar 2013 15:05:15 +0100 From: Pablo Ribalta Lorenzo User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 To: Barney Cordoba Subject: Re: vlan with modified MAC fails to communicate References: <1364561838.74177.YahooMailClassic@web121605.mail.ne1.yahoo.com> In-Reply-To: <1364561838.74177.YahooMailClassic@web121605.mail.ne1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Mar 2013 14:05:19 -0000 On 03/29/2013 01:57 PM, Barney Cordoba wrote: > > --- On Fri, 3/29/13, Pablo Ribalta Lorenzo wrote: > >> From: Pablo Ribalta Lorenzo >> 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 metric 0 mtu 1500 options=8000b ether 00:01:01:58:31:30 inet 192.168.126.9 netmask 0xffffff00 broadcast 192.168.126.255 media: Ethernet autoselect (1000baseT ) status: active vlan1: flags=8843 metric 0 mtu 1500 ether 00:01:01:58:31:30 media: Ethernet autoselect (1000baseT ) 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 metric 0 mtu 1500 options=8000b ether 00:01:01:58:31:30 inet 192.168.126.9 netmask 0xffffff00 broadcast 192.168.126.255 media: Ethernet autoselect (1000baseT ) status: active vlan1: flags=8843 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 ) 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