From owner-freebsd-net@FreeBSD.ORG Mon Jun 9 09:19:52 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 850D837B401 for ; Mon, 9 Jun 2003 09:19:52 -0700 (PDT) Received: from relay.macomnet.ru (relay.macomnet.ru [195.128.64.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A5E543FBD for ; Mon, 9 Jun 2003 09:19:51 -0700 (PDT) (envelope-from maxim@macomnet.ru) Received: from news1.macomnet.ru (news1.macomnet.ru [195.128.64.14]) by relay.macomnet.ru (8.11.6/8.11.6) with ESMTP id h59GJhg7204835; Mon, 9 Jun 2003 20:19:44 +0400 (MSD) Date: Mon, 9 Jun 2003 20:19:43 +0400 (MSD) From: Maxim Konovalov To: ad@astral-on.net In-Reply-To: <20030609142309.GB37504@astral-on.net> Message-ID: <20030609201828.L95896@news1.macomnet.ru> References: <20030609142309.GB37504@astral-on.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org Subject: Re: Problem with bridge 802.1q frames X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2003 16:19:52 -0000 On Mon, 9 Jun 2003, 17:23+0300, Andrew Degtiariov wrote: > Hello FreeBSD users! > We'v tried to bridge Ethernet frames across rl0 and vlan0 interfaces and this > does not work. > > vlan4|-------| > |---------------| Host1 | > | p1 | | > -----=----- |-------| > | Switch | 192.168.3.100 > -----=----- > | p2 > | > | vlan0 > ---------- -------- > | | rl0 fxp0| | > |Host2 |-----------|Host3 | > | | | | > ---------- -------- > 192.168.3.15 > > Host1, Host2 and Host3 in the same VLAN (vlan 6). > Port p1 and port p2 on Swith is "trunk" or "tagged" (add/delete vlan tags). > Host2 is bridge. > On Host3 we execute ping 192.168.3.100. > If we do ifconfig vlan0 inet 192.168.3.254 netmask 255.255.255.0 on Host2 and > lanch ping 192.168.3.100 its work perfectly! > I can see on vlan0 and fxp0 frames that forwarded from Host3 to Host1 > Frames passed from host1 don't appeare on vlan0 but on fxp0 do!? > > There aren't packet filters on Host2 > > Some debug information about Host2: > > bash-2.05b# uname -spr > FreeBSD 5.1-RC1 i386 > bash-2.05b# > > bash-2.05b# ifconfig -au > fxp0: flags=8943 mtu 1500 > options=8 > ether 00:07:e9:0b:92:cf > media: Ethernet autoselect (100baseTX) > status: active > rl0: flags=8943 mtu 1500 > ether 00:00:21:29:2c:c7 > media: Ethernet autoselect (100baseTX ) > status: active > lo0: flags=8049 mtu 16384 > inet 127.0.0.1 netmask 0xff000000 > vlan0: flags=8943 mtu 1500 > ether 00:07:e9:0b:92:cf > media: Ethernet autoselect (100baseTX) > status: active > vlan: 6 parent interface: fxp0 > > bash-2.05b# sysctl net.link.ether > net.link.ether.inet.prune_intvl: 300 > net.link.ether.inet.max_age: 1200 > net.link.ether.inet.host_down_time: 20 > net.link.ether.inet.maxtries: 5 > net.link.ether.inet.useloopback: 1 > net.link.ether.inet.proxyall: 0 > net.link.ether.inet.log_arp_wrong_iface: 1 > net.link.ether.inet.log_arp_movements: 1 > net.link.ether.ipfw: 0 > net.link.ether.bridge_cfg: vlan0:1,rl0:1 > net.link.ether.bridge: 1 > net.link.ether.bridge_ipfw: 0 > net.link.ether.bridge_ipf: 0 > net.link.ether.bridge_ipfw_drop: 0 > net.link.ether.bridge_ipfw_collisions: 0 > net.link.ether.verbose: 0 > net.link.ether.bdg_split_pkts: 0 > net.link.ether.bdg_thru: 264 > net.link.ether.bdg_copied: 0 > net.link.ether.bdg_dropped: 0 > net.link.ether.bdg_copy: 0 > net.link.ether.bdg_predict: 0 > net.link.ether.bdg_fw_avg: 0 > net.link.ether.bdg_fw_ticks: 0 > net.link.ether.bdg_fw_count: 0 > bash-2.05b# > > This is "tcpdump -i fxp0" output > 15:22:45.738897 802.1Q vlan#6 P0 arp who-has 192.168.3.100 (2e:2f:30:31:32:33) tell 192.168.3.15 > 15:22:45.739121 802.1Q vlan#6 P0 arp reply 192.168.3.100 is-at 0:2:b3:61:ab:8d > 15:22:46.599665 802.1d config 07d0.00:30:84:1c:1c:92.8015 root 07d0.00:30:84:1c:1c:92 pathcost 0 age 0 max 20 hello 2 fdelay 15 > 15:22:46.749497 802.1Q vlan#6 P0 arp who-has 192.168.3.100 (2e:2f:30:31:32:33) tell 192.168.3.15 > 15:22:46.749759 802.1Q vlan#6 P0 arp reply 192.168.3.100 is-at 0:2:b3:61:ab:8d > 15:22:47.760087 802.1Q vlan#6 P0 arp who-has 192.168.3.100 (2e:2f:30:31:32:33) tell 192.168.3.15 > 15:22:47.760311 802.1Q vlan#6 P0 arp reply 192.168.3.100 is-at 0:2:b3:61:ab:8d > 15:22:48.490190 802.1d config 07d0.00:30:84:1c:1c:92.8015 root 07d0.00:30:84:1c:1c:92 pathcost 0 age 0 max 20 hello 2 fdelay 15 > 15:22:48.770688 802.1Q vlan#6 P0 arp who-has 192.168.3.100 (2e:2f:30:31:32:33) tell 192.168.3.15 > 15:22:48.770920 802.1Q vlan#6 P0 arp reply 192.168.3.100 is-at 0:2:b3:61:ab:8d > 15:22:49.781306 802.1Q vlan#6 P0 arp who-has 192.168.3.100 (2e:2f:30:31:32:33) tell 192.168.3.15 > 15:22:49.781537 802.1Q vlan#6 P0 arp reply 192.168.3.100 is-at 0:2:b3:61:ab:8d > 15:22:50.771076 802.1d config 07d0.00:30:84:1c:1c:92.8015 root 07d0.00:30:84:1c:1c:92 pathcost 0 age 0 max 20 hello 2 fdelay 15 > 15:22:52.669977 802.1d config 07d0.00:30:84:1c:1c:92.8015 root 07d0.00:30:84:1c:1c:92 pathcost 0 age 0 max 20 hello 2 fdelay 15 > 15:22:54.560392 802.1d config 07d0.00:30:84:1c:1c:92.8015 root 07d0.00:30:84:1c:1c:92 pathcost 0 age 0 max 20 hello 2 fdelay 15 > > And "tcpdump -i vlan0" output > 15:22:45.738830 arp who-has 192.168.3.100 (2e:2f:30:31:32:33) tell 192.168.3.15 > 15:22:46.749436 arp who-has 192.168.3.100 (2e:2f:30:31:32:33) tell 192.168.3.15 > 15:22:47.760028 arp who-has 192.168.3.100 (2e:2f:30:31:32:33) tell 192.168.3.15 > 15:22:48.770633 arp who-has 192.168.3.100 (2e:2f:30:31:32:33) tell 192.168.3.15 > 15:22:49.781246 arp who-has 192.168.3.100 (2e:2f:30:31:32:33) tell 192.168.3.15 Try this hack and let me know if it works for you. Thanks! Index: if_ethersubr.c =================================================================== RCS file: /home/ncvs/src/sys/net/if_ethersubr.c,v retrieving revision 1.147 diff -u -r1.147 if_ethersubr.c --- if_ethersubr.c 5 May 2003 09:15:50 -0000 1.147 +++ if_ethersubr.c 20 May 2003 15:06:50 -0000 @@ -625,6 +625,7 @@ if (rule) /* packet was already bridged */ goto post_stats; +#if 0 if (!(BDG_ACTIVE(ifp))) { /* * Discard packet if upper layers shouldn't see it because it @@ -641,6 +642,7 @@ return; } } +#endif /* Discard packet if interface is not up */ if ((ifp->if_flags & IFF_UP) == 0) { %%% -- Maxim Konovalov, maxim@macomnet.ru, maxim@FreeBSD.org