i have read several posts and tutorials, but i'm still unable to set up the typical home setup:
3 vlans for 3 AP's: lan
, guest
, and iot
, and a trunked vlan connection between my gw (BPI-R4, which is DSA) and my dumb AP (tp-link wdr4300, which is still swconfig based).
both are running OpenWrt 24.10.0-rc3
.
i'm an experienced programmer, but my network admin fu is rather limited, apparently.
the AP seems to work: the lan wifi works, and if i try to connect to the guest wifi, then i see the DHCP requests leaving in tcpdump -n -e --interface eth0 | grep -v "vlan 8"
:
00:22:13.927887 fe:fb:1a:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 342: vlan 4, p 0, ethertype IPv4 (0x0800), 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from fe:fb:1a:8c:da:fc, length 296
but these packets don't show up on any interfaces on the gw. i tried tcpdumping br-lan
, br-lan.4
, and lan1
. and accordingly, no DHCP response is received by the AP, and wifi fails to connect.
question one:
is it a valid expectation of mine that a tcpdump -n -e --interface br-lan.4
on the gw should show the packets that i see on the AP being sent on the trunk?
the trunk works, kinda, because my lan (10.0.8.1, vlan 8) works through the same trunked port. what doesn't work is the two new vlans. which is, btw, baffling to me: how come one of the vlans work and the other two doesn't? i'm clearly missing here something.
my AP:
# ip route
default via 10.0.8.1 dev br-lan proto static
10.0.2.0/24 dev br-iot proto kernel scope link src 10.0.2.2
10.0.4.0/24 dev br-guest proto kernel scope link src 10.0.4.2
10.0.8.0/24 dev br-lan proto kernel scope link src 10.0.8.2
# cat /etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'xxx::/48'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config device 'iot_dev'
option type 'bridge'
option name 'br-iot'
option ports 'eth0.2'
config interface 'iot'
option proto 'static'
option device 'br-iot'
option ipaddr '10.0.2.2'
option netmask '255.255.255.0'
config device 'guest_dev'
option type 'bridge'
option name 'br-guest'
list ports 'eth0.4'
config interface 'guest'
option proto 'static'
option device 'br-guest'
option ipaddr '10.0.4.2'
option netmask '255.255.255.0'
config device 'br_lan'
option ports 'eth0.8'
option type 'bridge'
option name 'br-lan'
config interface 'lan'
option proto 'static'
option device 'br-lan'
option ipaddr '10.0.8.2'
option netmask '255.255.255.0'
list dns '10.0.8.1'
config route
option target '0.0.0.0/0'
option gateway '10.0.8.1'
config switch_vlan
option device 'switch0'
option vlan '0'
option ports '0t 1t'
option vid '2'
config switch_vlan
option device 'switch0'
option vlan '0'
option ports '0t 1t'
option vid '4'
config switch_vlan
option device 'switch0'
option vlan '0'
option ports '0t 1t 2 3 4 5'
option vid '8'
my gw:
# cat /etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'xxx::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth1'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
config interface 'lan'
option device 'br-lan.8'
option proto 'static'
option ipaddr '10.0.8.1'
option netmask '255.255.255.0'
option ip6assign '60'
config device
option name 'br-wan'
option type 'bridge'
list ports 'wan'
list ports 'eth2'
config device
option name 'wan'
option macaddr '56:e6:75:xx:xx:xx'
config device
option name 'eth2'
option macaddr '56:e6:75:xx:xx:xx'
config interface 'wan'
option device 'br-wan'
option proto 'pppoe'
option username 'xxx'
option password 'xxx'
option ipv6 'auto'
option keepalive '0 1'
config interface 'wan6'
option device 'br-wan'
option proto 'dhcpv6'
config device 'iot_dev'
option type 'bridge'
option name 'br-iot'
option ports 'br-lan.2'
config interface 'iot'
option proto 'static'
option device 'br-iot'
option ipaddr '10.0.2.1'
option netmask '255.255.255.0'
config device 'guest_dev'
option type 'bridge'
option name 'br-guest'
option ports 'br-lan.4'
config interface 'guest'
option proto 'static'
option device 'br-guest'
option ipaddr '10.0.4.1'
option netmask '255.255.255.0'
config bridge-vlan
option device 'br-lan'
option vlan '2'
list ports 'eth1:t'
list ports 'lan1:t'
config bridge-vlan
option device 'br-lan'
option vlan '4'
list ports 'eth1:t'
list ports 'lan1:t'
config bridge-vlan
option device 'br-lan'
option vlan '8'
list ports 'eth1:t'
list ports 'lan1:t'
list ports 'lan2:u*'
list ports 'lan3:u*'
question two
if i try to ping 10.0.4.1 (guest vlan) from my AP, then i can see the ARP who-has
packets:
00:36:59.050754 c0:4a:00:xx:xx:xx > ff:ff:ff:ff:ff:ff, ethertype 802.1Q (0x8100), length 46: vlan 4, p 0, ethertype ARP (0x0806), Request who-has 10.0.4.1 tell 10.0.4.2, length 28
but no one responds to them. root cause is probably the same as in my first question.
if i delete the routes for the vlans and only leave the default one, then ping starts to work also for the vlan subnets. i guess they get through in a higher layer, routed through the default gw.
# ip route del 10.0.4.0/24
# ping 10.0.4.1
PING 10.0.4.1 (10.0.4.1): 56 data bytes
64 bytes from 10.0.4.1: seq=0 ttl=64 time=0.455 ms
ultimate goals
find a good intro material for linux networking that also contains the part of this puzzle that i'm missing.
find the right tools for debugging such issues myself.
and to run my AP in a very dumb mode, i.e. no routing on it at all. it's old hw, i'm hoping to squeeze out the most wifi performance from it.