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<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=98<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> ether 00:0c:f1:6c:37:4c inet 192.168.16.30 netmask 0xffffff00 broadcast 192.168.16.255 media: Ethernet autoselect (100baseTX <full-duplex>) status: active tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500 ether 00:bd:3e:24:00:00 bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> ifmaxaddr 0 port 7 priority 128 path cost 2000000 member: em0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> 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<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=98<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> ether 00:0c:f1:6c:37:4c media: Ethernet autoselect (100baseTX <full-duplex>) status: active tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500 ether 00:bd:3e:24:00:00 bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> ifmaxaddr 0 port 7 priority 128 path cost 2000000 member: em0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> 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! WBR -- Boris Samorodov (bsam) Research Engineer, http://www.ipt.ru Telephone & Internet SP FreeBSD committer, http://www.FreeBSD.org The Power To Serve
On Wed, May 28, 2008 at 02:15:18AM +0400, Boris Samorodov wrote:> Hello list! > > > When em0 has an inet address while bridge0 doesn't, it seems to be OK:[...]> Did I miss something? Thanks!I discovered the same thing while experimenting with qemu and bridgeng. I think it simply works different from (for example) widnows bridging. I think it's meant to be like that. It also looks more logical either. I think of the bridge as just a packet router, which routes them to all the interfaces(physical and virtual as well) so if the bridge intercepts them with it's own address they can't ereach other interfaces, obviosusly. Maybe I'm wrong here? -- Guido Falsi <mad@madpilot.net>
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<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 > mtu 1500 options=98<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> > ether 00:0c:f1:6c:37:4c > inet 192.168.16.30 netmask 0xffffff00 broadcast 192.168.16.255 > media: Ethernet autoselect (100baseTX <full-duplex>) > status: active > tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric > 0 mtu 1500 ether 00:bd:3e:24:00:00 > bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> > ifmaxaddr 0 port 7 priority 128 path cost 2000000 > member: em0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> > 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<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 > mtu 1500 options=98<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> > ether 00:0c:f1:6c:37:4c > media: Ethernet autoselect (100baseTX <full-duplex>) > status: active > tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric > 0 mtu 1500 ether 00:bd:3e:24:00:00 > bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> > ifmaxaddr 0 port 7 priority 128 path cost 2000000 > member: em0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> > 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
Hi List! Well, it took me a while to discover the case... Provider attached my ethernet line to a switch and set up port security to restrict to three MAC addresses which were already used by two computers and a network printer. As soon as provider deletted those restrictions all went well. Thanks for all who helped me. On Wed, 28 May 2008 02:15:18 +0400 Boris Samorodov wrote:> 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<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500 > options=98<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> > ether 00:0c:f1:6c:37:4c > inet 192.168.16.30 netmask 0xffffff00 broadcast 192.168.16.255 > media: Ethernet autoselect (100baseTX <full-duplex>) > status: active > tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500 > ether 00:bd:3e:24:00:00 > bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> > ifmaxaddr 0 port 7 priority 128 path cost 2000000 > member: em0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> > 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<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500 > options=98<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> > ether 00:0c:f1:6c:37:4c > media: Ethernet autoselect (100baseTX <full-duplex>) > status: active > tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500 > ether 00:bd:3e:24:00:00 > bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> > ifmaxaddr 0 port 7 priority 128 path cost 2000000 > member: em0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP> > 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!WBR -- Boris Samorodov (bsam) Research Engineer, http://www.ipt.ru Telephone & Internet SP FreeBSD committer, http://www.FreeBSD.org The Power To Serve