[VLAN] vlan stacking

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

 



Ben Greear <greearb@xxxxxxxxxxxxxxx> writes:

> If the switch/router can deal with normal protocol stacking, then
> leaving it an 0x8100 is the correct answer.  The 'original' protocol
> is found in the .1q header, and you can just check it to see if you
> are encapsulating .1q or some other ethernet protocol.
> 
> This would allow arbitrary stacking, ie .1q inside of .1q inside of
> .1q inside of ethernet.
> 
> This is how Linux works (or should work, as I have not tested this
> recently.)  I do not want to special case .1q inside of .1q unless
> that becomes necessary to work with a significant portion of
> third-party equipment.

This is also how I would expect things to work without any special
code to do it.  See ethertype 0x8100, then decapsulate the ethernet
frame and dispatch according to the inner ethertype.  If it's 0x8100
again, just do the same thing again, and so on.

But how would one configure this in linux?  I tried today at home,
(because it could get relevant in a project at work), and could get it
to work.

I did

  vconfig add eth0 100
  vconfig add eth0.100 815

and then

  ip addr add dev eth0.100 172.16.6.1/24
  ip link set eth0.100 up
  ip addr add dev eth0.100.815 192.168.0.1/24
  ip link set eth0.100.815 up

After this 'ip addr ls' and 'ip route ls' show the configuration as
expected:

  $ ip addr ls
  ...
  2: eth0: <BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc pfifo_fast qlen 1000
      link/ether 00:00:d1:9d:7b:a8 brd ff:ff:ff:ff:ff:ff
      inet 10.0.0.1/24 brd 10.0.0.255 scope global eth0
      inet6 3ffe:400:90:1e::1/112 scope global 
      inet6 fe80::200:d1ff:fe9d:7ba8/64 scope link 
  9: eth0.100: <BROADCAST,MULTICAST,UP> mtu 1496 qdisc noqueue 
      link/ether 00:00:d1:9d:7b:a8 brd ff:ff:ff:ff:ff:ff
      inet 172.16.6.1/24 brd 172.16.6.255 scope global eth0.100
      inet6 fe80::200:d1ff:fe9d:7ba8/64 scope link 
  16: eth0.100.815: <BROADCAST,MULTICAST,UP> mtu 1496 qdisc noqueue 
      link/ether 00:00:d1:9d:7b:a8 brd ff:ff:ff:ff:ff:ff
      inet 192.168.0.1/24 scope global eth0.100.815
      inet6 fe80::200:d1ff:fe9d:7ba8/64 scope link 
  ...

  $ ip route ls 
  ...
  10.0.0.0/24 dev eth0  proto kernel  scope link  src 10.0.0.1 
  ...
  172.16.6.0/24 dev eth0.100  proto kernel  scope link  src 172.16.6.1 
  192.168.0.0/24 dev eth0.100.815  proto kernel  scope link  src 192.168.0.1 
  ...

I configured another machine accordingly with 172.16.6.3 and
192.168.0.3.  The outer vlan works OK, i.e. I can ping from 172.16.6.1
to 172.16.6.3 and tcpdump output looks correctly (this is what I have
running here since many months now).  But when I try to ping from
192.168.0.1 to 192.168.0.3, I get

  $ tcpdump -xx -n -e -i eth0
  ...
  18:02:23.687984 00:00:d1:9d:7b:a8 > ff:ff:ff:ff:ff:ff, ethertype 802.1Q, length 46: vlan 815, p 0, ethertype ARP, arp who-has 192.168.0.3 tell 192.168.0.1
			 ffff ffff ffff 0000 d19d 7ba8 8100 032f
			 0806 0001 0800 0604 0001 0000 d19d 7ba8
			 c0a8 0001 0000 0000 0000 c0a8 0003

Here we habe IP in vlan 815 in ethernet instead of IP in vlan 815 in
vlan 100 in ethernet.

So how is this done?


urs

[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