Discussion:
wm(4) and VLANs
(too old to reply)
Stephen Borrill
2012-05-25 14:22:20 UTC
Permalink
I have a:
wm0 at pci3 dev 3 function 0: Intel i82541PI 1000BASE-T Ethernet, rev. 5

This has 3 VLANs attached:
wm0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
capabilities=2bf80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx,TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Tx,UDP6CSUM_Tx>
enabled=0
address: 00:1b:21:48:15:58
media: Ethernet autoselect (1000baseT full-duplex)
status: active
inet 10.0.0.1 netmask 0xffff0000 broadcast 10.0.255.255
inet6 fe80::21b:21ff:fe48:1558%wm0 prefixlen 64 scopeid 0x2
vlan400: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
capabilities=2bf80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx,TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Tx,UDP6CSUM_Tx>
enabled=0
vlan: 400 parent: wm0
address: 00:1b:21:48:15:58
inet 192.168.2.254 netmask 0xffffff00 broadcast 192.168.2.255
inet6 fe80::21b:21ff:fe48:1558%vlan400 prefixlen 64 scopeid 0x6
vlan500: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
capabilities=2bf80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx,TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Tx,UDP6CSUM_Tx>
enabled=0
vlan: 500 parent: wm0
address: 00:1b:21:48:15:58
inet 192.168.3.254 netmask 0xffffff00 broadcast 192.168.3.255
inet6 fe80::21b:21ff:fe48:1558%vlan500 prefixlen 64 scopeid 0x7
vlan900: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
capabilities=2bf80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx,TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Tx,UDP6CSUM_Tx>
enabled=0
vlan: 900 parent: wm0
address: 00:1b:21:48:15:58
inet 192.168.5.1 netmask 0xffffff00 broadcast 192.168.5.255
inet6 fe80::21b:21ff:fe48:1558%vlan900 prefixlen 64 scopeid 0x8

However, DHCP requests come on both the vlan and parent interface:
May 25 15:00:06 netmanager dhcpd: DHCPDISCOVER from d0:23:db:3b:b2:d2 via vlan400
May 25 15:00:06 netmanager dhcpd: DHCPOFFER on 192.168.2.196 to d0:23:db:3b:b2:d2 via vlan400
May 25 15:00:06 netmanager dhcpd: DHCPDISCOVER from d0:23:db:3b:b2:d2 via wm0
May 25 15:00:06 netmanager dhcpd: DHCPOFFER on 10.0.10.56 to d0:23:db:3b:b2:d2 via wm0

It's therefore a lottery what IP range you get allocated.

Is this a bug in wm(4) for this particular chipset?
--
Stephen


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Thor Lancelot Simon
2012-05-25 17:05:20 UTC
Permalink
Post by Stephen Borrill
May 25 15:00:06 netmanager dhcpd: DHCPDISCOVER from d0:23:db:3b:b2:d2 via vlan400
May 25 15:00:06 netmanager dhcpd: DHCPOFFER on 192.168.2.196 to d0:23:db:3b:b2:d2 via vlan400
May 25 15:00:06 netmanager dhcpd: DHCPDISCOVER from d0:23:db:3b:b2:d2 via wm0
May 25 15:00:06 netmanager dhcpd: DHCPOFFER on 10.0.10.56 to d0:23:db:3b:b2:d2 via wm0
Why is the switch upstream from you handing you untagged frames at all?
Why does your port have a default VLAN set so that outbound untagged
frames are accepted and forwarded? Both seem to be the case, and both are
configuration errors on the upstream switch.

AFAICT dhclient does not know how to look past the VLAN encapsulation
with which the frames would appear on wm0 if they were actually sent
tagged -- a strong hint of this is that you are not *also* seeing the
DHCPOFFER for the 192.168.2/24 network on wm0, though if you looked with
tcpdump, you would find it, VLAN tagging and all.

Thor

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Mouse
2012-05-25 18:22:31 UTC
Permalink
Post by Thor Lancelot Simon
Why does your port have a default VLAN set so that outbound untagged
frames are accepted and forwarded?
In my experience, at least some switches do not have any alternative.
I have used equipment that, as far as I can tell, cannot be set to drop
untagged frames. (The closest it can come is to put them in an
otherwise unused, and thus not forwarded anywhere, vlan - but that (a)
is inelegant and (b) burns a vlan number (which on some of them has
been a precious resource; there are 4K vlans possible, but the switch
can often handle only a small fraction of that).)

/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML ***@rodents-montreal.org
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Greg Troxel
2012-05-25 21:13:31 UTC
Permalink
I am assuming the netbsd box is a dhcp server, and something else is
sending requests.

Run tcpdump on wm0 and the vlans, and see what those requests look
like. I think dhcpd is using bpf, but as tls points out it shouldn't be
auto-unwrapping the vlan tags.
You haven't established that you aren't getting untagged requests and
requests on a vlan at the same time.

Loading...