R: [VLAN] vlan with two interfaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2 Sep 2005 13:19:13 +0200
"Tabaro Pierantonio" <tabarot@xxxxxxxxxx> wrote:

> Sorry for long message but I try to explain better:
> the scenario I would like to implement is:
> 
>                    internet/intranet ----+
>  +--------------+                        |
>  | PC with      |                      +-----------+
>  | connectivity |----------------------|   switch  |
>  | manager      |                      +-----------+
>  +--------------+                            | | |
>                                              | | |
>                                              | | |
>  +------------+          +------------+      | | |
>  | PC guest 1 |----------|  embedded  |------+ | |
>  +------------+     eth1 | linux BOX 1| eth0   | |
>                          +------------+        | |
>                                                | |
>  +------------+          +------------+        | |
>  | PC guest 2 |----------|  embedded  |--------+ |
>  +------------+     eth1 | linux BOX 2| eth0     |
>                          +------------+          |
>                                                  |
>                          Others PC guest & BOX --+
> 
> The embedded linux box have software like web browser, multimedia player
> working in internet/intranet through static configuration of eth0 with a
> pool of 10.x.x.x Ip addresses. When I connect a generic PC guest on eth1
> all the layer2 traffic tagged to a vlanX need to be "sniffed" from the
> "connectivity manager PC" This PC take charge to detect the guest PC
> operating system and it's needs for connecting to internet, give to that
> PC the requested infos and the PC start to navigate.
> 


I'm not sure I understand what you want.  Let me summarise what I *think* you want:

In "embedded linux BOX" you want everything received on eth1 to get copied to a predefined vlan on
eth0 EVEN IF it is also sent up the IP stack locally.


If this is correct then I think I have the solution for you:

1.	Create a bridge on "embedded linux BOX" called br0
2. 	Create a vlan on eth0, called eth0.X (where X=VID)
3.	Add eth1 and eth0.X to bridge br0
4.	You will also need to modify the bridge module bridge.o so 
	that it always floods, even if the frame is passed up.  (See below.)


The modification you need to make to the bridge code in linux/net/bridge/ will be something like the
following (NOTE: THIS IS A GUESS - I HAVEN'T TRIED THIS MYSELF!)


diff -u -r1.1.1.1 br_input.c
--- br_input.c	24 Aug 2005 12:05:50 -0000	1.1.1.1
+++ br_input.c	2 Sep 2005 13:51:26 -0000
@@ -76,27 +76,25 @@
 		}
 	}
 
-	if (dest[0] & 1) {
-		br_flood_forward(br, skb, !passedup);
-		if (!passedup)
-			br_pass_frame_up(br, skb);
-		goto out;
+	if (!passedup && dest[0] & 1) {
+		struct sk_buff *skb2;
+
+		skb2 = skb_clone(skb, GFP_ATOMIC);
+		if (skb2 != NULL) {
+			passedup = 1;
+			br_pass_frame_up(br, skb2);
+		}
 	}
 
 	dst = br_fdb_get(br, dest);
-	if (dst != NULL && dst->is_local) {
-		if (!passedup)
-			br_pass_frame_up(br, skb);
-		else
-			kfree_skb(skb);
-		br_fdb_put(dst);
-		goto out;
-	}
+	if (!passedup && dst != NULL && dst->is_local) {
+		struct sk_buff *skb2;
 
-	if (dst != NULL) {
-		br_forward(dst->dst, skb);
-		br_fdb_put(dst);
-		goto out;
+		skb2 = skb_clone(skb, GFP_ATOMIC);
+		if (skb2 != NULL) {
+			passedup = 1;
+			br_pass_frame_up(br, skb2);
+		}
 	}
 
 	br_flood_forward(br, skb, 0);



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux