From owner-freebsd-stable@FreeBSD.ORG Wed May 28 09:14:58 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2768106566C; Wed, 28 May 2008 09:14:58 +0000 (UTC) (envelope-from nvass@teledomenet.gr) Received: from smtp.teledomenet.gr (smtp.teledomenet.gr [213.142.128.2]) by mx1.freebsd.org (Postfix) with ESMTP id 256558FC12; Wed, 28 May 2008 09:14:58 +0000 (UTC) (envelope-from nvass@teledomenet.gr) Received: by smtp.teledomenet.gr (Postfix, from userid 58) id 9ABA21420B9; Wed, 28 May 2008 11:56:05 +0300 (EEST) X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on smtp.teledomenet.gr X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RDNS_NONE autolearn=no version=3.2.3 Received: from iris.teledomenet.local (unknown [192.168.1.71]) by smtp.teledomenet.gr (Postfix) with ESMTP id E473614205A; Wed, 28 May 2008 11:55:59 +0300 (EEST) From: Nikos Vassiliadis To: freebsd-stable@freebsd.org Date: Wed, 28 May 2008 11:54:56 +0300 User-Agent: KMail/1.9.7 References: <72197513@bs1.sp34.ru> In-Reply-To: <72197513@bs1.sp34.ru> X-NCC-RegID: gr.telehouse MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805281154.57305.nvass@teledomenet.gr> Cc: Boris Samorodov , stable@freebsd.org Subject: Re: 7-STABLE: bridge and em X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2008 09:14:58 -0000 On Wednesday 28 May 2008 01:15:18 Boris Samorodov wrote: > Hello list! > > > When em0 has an inet address while bridge0 doesn't, it seems to be OK: > ----- > bs1% uname -a > FreeBSD bs1.sp34.ru 7.0-STABLE FreeBSD 7.0-STABLE #0: Sun May 25 > 20:15:26 MSD 2008 root@bs1.sp34.ru:/usr/obj/usr/src/sys/BSM i386 > bs1% ifconfig em0; ifconfig tap0; ifconfig bridge0 > em0: flags=8943 metric 0 > mtu 1500 options=98 > ether 00:0c:f1:6c:37:4c > inet 192.168.16.30 netmask 0xffffff00 broadcast 192.168.16.255 > media: Ethernet autoselect (100baseTX ) > status: active > tap0: flags=8943 metric > 0 mtu 1500 ether 00:bd:3e:24:00:00 > bridge0: flags=8843 metric 0 mtu > 1500 ether ea:8b:1f:65:2a:5c > id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 > maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200 > root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0 > member: tap0 flags=143 > ifmaxaddr 0 port 7 priority 128 path cost 2000000 > member: em0 flags=143 > ifmaxaddr 0 port 1 priority 128 path cost 2000000 > bs1% netstat -rn > Routing tables > > Internet: > Destination Gateway Flags Refs Use Netif > Expire default 192.168.16.254 UGS 0 357 > em0 127.0.0.1 127.0.0.1 UH 0 3934 lo0 > 192.168.16.0/24 link#1 UC 0 0 em0 > 192.168.16.1 00:07:e9:80:33:bc UHLW 1 16 em0 > 951 192.168.16.254 00:07:e9:80:33:bc UHLW 2 0 em0 > 1002 > > Internet6: > Destination Gateway Flags > Netif Expire > > ::1 ::1 UHL > :: lo0 > > fe80::%lo0/64 fe80::1%lo0 U > lo0 fe80::1%lo0 link#5 > UHL lo0 ff01:5::/32 fe80::1%lo0 > UC lo0 ff02::%lo0/32 fe80::1%lo0 > UC lo0 bs1% ping -c 3 192.168.16.254 > PING 192.168.16.254 (192.168.16.254): 56 data bytes > 64 bytes from 192.168.16.254: icmp_seq=0 ttl=64 time=0.316 ms > 64 bytes from 192.168.16.254: icmp_seq=1 ttl=64 time=0.263 ms > 64 bytes from 192.168.16.254: icmp_seq=2 ttl=64 time=0.266 ms > > --- 192.168.16.254 ping statistics --- > 3 packets transmitted, 3 packets received, 0.0% packet loss > round-trip min/avg/max/stddev = 0.263/0.282/0.316/0.024 ms > ----- > > But if I move ip address from em0 to bridge0: > ----- > bs1% sudo ifconfig em0 inet 192.168.16.30 netmask 0xffffff00 delete > bs1% sudo ifconfig bridge0 inet 192.168.16.30 netmask 0xffffff00 > bs1% sudo route add default 192.168.16.254 > add net default: gateway 192.168.16.254 > bs1% ifconfig em0; ifconfig tap0; ifconfig bridge0 > em0: flags=8943 metric 0 > mtu 1500 options=98 > ether 00:0c:f1:6c:37:4c > media: Ethernet autoselect (100baseTX ) > status: active > tap0: flags=8943 metric > 0 mtu 1500 ether 00:bd:3e:24:00:00 > bridge0: flags=8843 metric 0 mtu > 1500 ether ea:8b:1f:65:2a:5c > inet 192.168.16.30 netmask 0xffffff00 broadcast 192.168.16.255 > id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 > maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200 > root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0 > member: tap0 flags=143 > ifmaxaddr 0 port 7 priority 128 path cost 2000000 > member: em0 flags=143 > ifmaxaddr 0 port 1 priority 128 path cost 2000000 > bs1% netstat -rn > Routing tables > > Internet: > Destination Gateway Flags Refs Use Netif > Expire default 192.168.16.254 UGS 0 0 > bridge 127.0.0.1 127.0.0.1 UH 0 3934 > lo0 192.168.16.0/24 link#6 UC 0 0 bridge > 192.168.16.254 link#6 UHLW 2 0 bridge > > Internet6: > Destination Gateway Flags > Netif Expire > > ::1 ::1 UHL > :: lo0 > > fe80::%lo0/64 fe80::1%lo0 U > lo0 fe80::1%lo0 link#5 > UHL lo0 ff01:5::/32 fe80::1%lo0 > UC lo0 ff02::%lo0/32 fe80::1%lo0 > UC lo0 bs1% ping -c 3 192.168.16.254 > PING 192.168.16.254 (192.168.16.254): 56 data bytes > > --- 192.168.16.254 ping statistics --- > 3 packets transmitted, 0 packets received, 100.0% packet loss > ----- > > Did I miss something? Thanks! Yes, if_bridge uses its own MAC address, so the first time that host 192.168.16.30 pinged host 192.168.16.254, it used MAC address 00:0c:f1:6c:37:4c. When you did assign the IP address on the bridge0 interface, it used the bridge0's MAC address. If host 192.168.16.254 is a bit stubborn about 192.168.16.30's MAC address things will not work(for some time). Nevertheless there is no reason(apparent to me) moving around IP addresses, so if you assign your IP to the bridge interface, things will work. HTH, Nikos