I have my own private server on the Internet since years. At the moment it is running Linux 4.9.337. It serves as my router and as my WiFi access point and many more things.
On the machine I have 3 NICs called internet, lan0, lan1. I also have a Wifi-card called wlan0 and a VPN-bridge called vpn0.
All the interfaces are on a bridge called lan. lan has a static IP.
bridge name bridge id STP enabled interfaces
lan 8000.000acd16687b no lan0
lan1
vpn0
wlan0
This setup works fine.
The time has come to modify my setup. I am planning to use an external WiFi access point. To still be able to sniff the WiFi traffic I want to use a managed switch to send the WiFi traffic via VLAN id 2 into lan0, making the external WiFi access point behave like an internal WiFi-card.
Now I try to add that VLAN functionality into the bridge.
This is the setup of the bridge:
#!/bin/bash
bridgename=lan
bridgemac=00:0a:cd:16:68:7b
bridgeip=10.10.13.1/24
bridgevlanfiltering=0
bridgeforwarddelay=200
bridgemulticastsnooping=0
bridgeports="lan0 lan1 wlan0 vpn0"
ip link add name ${bridgename} address ${bridgemac} up type bridge
vlan_filtering ${bridgevlanfiltering}
forward_delay ${bridgeforwarddelay}
mcast_snooping ${bridgemulticastsnooping}
ip addr add dev lan ${bridgeip}
for interface in ${bridgeports}; do
ip link set dev ${interface} up master ${bridgename}
done
adding VLAN id 2 interface into the bridge
ip link add dev wlan1 link lan0 address 00:0a:cd:16:68:7d up type vlan id 2
ip link set dev wlan1 master ${bridgename}
At this point the bridge looks like this:
bridge name bridge id STP enabled interfaces
lan 8000.000acd16687b no lan0
lan1
vpn0
wlan0
wlan1
This does mostly work as before, but the WiFi access point is now cut off and do not work. I have no clue to what is wrong with the setup regarding the VLAN.
I read this question/answer. Still lost...
I wonder if anyone can help me get the VLAN part of this working?