Can't quite figure Linux VLANs out
I've spent the better part of 3 days trying to get this simple example working, I can't really find any cohesive information relating to my problem, I guess people don't turn Linux hosts into Switches for a reason, it's god awful.
I'm just wanting to set up a VLAN on Router to (linux-switch) Switch which will allow the host to ping the router, I think I need to untag the frames exiting eth1 to the host and also ensure that frames are tagged when received in eth1 (no idea how to do this). Likewise if anyone thinks I'm overcomplicating, point me in the right direction.
Troubleshooting logs
Ping results
r1
ping 12.1.1.10 -c3
--- 12.1.1.10 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2039ms
rtt min/avg/max/mdev = 0.064/0.100/0.122/0.025 ms
ping 12.1.1.200 -c3
--- 12.1.1.200 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2048ms
sw1
ping 12.1.1.1 -c3
--- 12.1.1.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2005ms
rtt min/avg/max/mdev = 0.058/0.088/0.133/0.032 ms
ping 12.1.1.200 -c3
3 packets transmitted, 3 received, 0% packet loss, time 2027ms
rtt min/avg/max/mdev = 0.058/0.088/0.133/0.032 ms
brctl output
sw1
# brctl show
bridge name bridge id STP enabled interfaces
br100 8000.1eccded2855b no eth0.100
eth1.100
IP scheme
R1:
eth0 0.0.0.0
eth0.100 12.1.1.1 netmask 255.255.255.0
Sw1
br100 12.1.1.10 netmask 255.255.255.0
eth0 0.0.0.0
eth1 0.0.0.0
eth0.100 0.0.0.0
eth1.100 0.0.0.0
h1
eth0 12.1.1.200 netmask 255.255.255.0
R1 Routing table
# ip r
12.1.1.0/24 dev eth0.100 proto kernel scope link src 12.1.1.1
Sw1 Routing Table
# ip r
12.0.0.0/24 dev br100 proto kernel scope link src 12.1.1.10
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.24
192.168.0.1 dev eth0 proto dhcp scope link src 192.168.0.24 metric 100
h1 Routing Table
# ip r
12.1.1.0/24 dev eth0 proto kernel scope link src 12.1.1.200
lol, how embarrassing I was so close to the answer, I just needed to add the raw interfaces to the bridge
sw1
# brctl show
bridge name bridge id STP enabled interfaces
br100 8000.1eccded2855b no eth0.100
eth1.100
eth0
eth1
Afterwards I was able to confirm connectivity between router and host, and also via Wireshark I could see the VID applied.
If this helped you, please upvote the answer