From owner-freebsd-net@FreeBSD.ORG Fri Mar 29 14:37:23 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2F1F1DC5 for ; Fri, 29 Mar 2013 14:37:23 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ob0-x236.google.com (mail-ob0-x236.google.com [IPv6:2607:f8b0:4003:c01::236]) by mx1.freebsd.org (Postfix) with ESMTP id F0C0F91D for ; Fri, 29 Mar 2013 14:37:22 +0000 (UTC) Received: by mail-ob0-f182.google.com with SMTP id ef5so448325obb.13 for ; Fri, 29 Mar 2013 07:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=/sT91mjk2oNnlT3qzP1mI5WfI5y3u40SNiaqLlC3sNg=; b=ETd5LaoMJh/DPRUPf+2hiQ9wz3B7YG8wI6uhhGUPhgLxxKwDBglFr0kfgNG0jWNd7q /QSA6HS0aBwFyCgxNe/yT3LWF5NhFC3qDz5Avy9HL1SJNA11o7v5ge23Vvp4egHXKGj8 lDhZLQMD/bvmdb+e3+YOjX9qd8rLiHznimc4JEgJTDkes3pV2IHiHkeRY7u+JZva8Qhb 6JWdaN0z7rXx28Iiiyf7ip3cipJFIyeK06+JyLT3relb3yYxxLvab7bnrNwSpnnEF+Xe Uazp+1B07wTsamcZ8eI5k/q3m8TV/6p3bAgiK749CF3z7+HabyoALl1c9Umc625QUgJZ 0JGg== MIME-Version: 1.0 X-Received: by 10.60.172.84 with SMTP id ba20mr938614oec.10.1364567842569; Fri, 29 Mar 2013 07:37:22 -0700 (PDT) Received: by 10.76.109.236 with HTTP; Fri, 29 Mar 2013 07:37:22 -0700 (PDT) In-Reply-To: <51559F9B.3060608@semihalf.com> References: <1364561838.74177.YahooMailClassic@web121605.mail.ne1.yahoo.com> <51559F9B.3060608@semihalf.com> Date: Fri, 29 Mar 2013 10:37:22 -0400 Message-ID: Subject: Re: vlan with modified MAC fails to communicate From: Ryan Stone To: Pablo Ribalta Lorenzo Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Barney Cordoba , freebsd-net 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:37:23 -0000 On Fri, Mar 29, 2013 at 10:05 AM, Pablo Ribalta Lorenzo 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 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. >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.