I’m trying to setup VLANs for my home network. I’m using bridge filtering and I was able to successfully create a separated IoT VLAN and it is working fine, but it is only a wireless VLAN. I encountered a problem when trying to use a wired VLAN - I wanted to move my server (which actually is an old laptop), from the default LAN to its separate VLAN connected via ethernet cable to the router.
This is my bridge filtering on the main bridge br-lan:
So to me it all looks fine. And the VLAN 20 which is configured in the same manner works without issues, I added proper firewall rules and specific traffic rules etc.
But for some reason when I plug the server laptop into the port 2 on my Flint2 it gets IP 192.168.0.220. The strange thing is that it does not match any DHCP server on the router. The default VLAN (and the default network on Flint 2 before I even added VLANs) is of course 192.168.8.x. All other VLANs have the 3 octet matching the VLAN ID.
I have no idea why it gets IP like that. It even kinda looks like it gets the IP from the ISP modem, not from the router? It is also currently connected to the WiFi and therefore the main VLAN - on the wifi connection it gets its IP in the 192.168.8.x and I’m able to SSH to this laptop thanks to wifi.
Could you please help me debug this issue and fix it?
There are a few issues here, I'm curious looking to your vlan stanza and it is a wonder vlan 20 is working for you , or was it on wifi?
Usually: if you want the pvid set, you choose untagged and after the port the vlan cease to exist.
Only one port can only have one untagged vlan, of course it is possible to be more but the pvid deals with that the others become more as a reservation but are ignored, tagged however means you combine a vlan with others or you pass it through.
I expected either a untag or tagged vlan
There is also another issue here, I see on each interface you create inside the advanced settings that you check default gateway.
Please uncheck this, because in OpenWrt terms this mean should the interface be treated as a wan like interface or not, in this case you don't want that, because it is possible a default route is being set to this interface rather than wan/wwan, this could theoretically explain why you see a different network.
As to why you see a network which isn't existing in your router, I'm confused, perhaps there is a router which tries to forces itself as main router?
I had a powerline adapter doing exactly that had to disable dhcp, it was a tp-link one, my logs where crowded that the dhcp server in openwrt could not start, kinda nuts implementation from tp
VLAN 20 works fine, but it is only over the wifi, I don't have any device connected via ethernet in that network, and therefore I didn't map any port to use that vlan.
I set PVIDs like that while trying to fix the issue. Originally I didn't have any pvids and it was behaving in the same manner.
But to be honest I didn't fully understood your comment. You are saying that this configuration of PVIDs or untagged ports is wrong? Could you try rephrasing it? How would I set it?
The default gateway was set like that by default. I tried deselecting it now but it seems it did nothing.
My Flint2 is connected to the ISP modem, and it is in modem mode, so the router part should be disabled. Is there a possibility that even in modem mode it will try assigning ip to my vlans?
This should be fine , don't worry about my explaination about vlans this can work.
however usually it won't be my first choice to use vlans if the networks are only inside the router not extending over to a vlan aware device, but there are some reasons why it is still needed like with multi psk/ppsk or maybe you readed a tutorial, typically for wifi you can also make empty bridges and assign these to interfaces, its still fine no worries.
Hmm, I'd guess you mean bridge mode?, it sound familiar.
What I know is that they often set the isp modem to a static ip for recovery purpose and then do some kind of dmz, so technically there is still a gateway to this modem, but as far as I know shouldn't be sending dhcp server things.
We can try to dig in this further, if you have access to ssh, can you type: ip route and paste it here?
You can also post contents of /etc/config/network and /etc/config/dhcp please remove mac addresses, and other sensitive information like wireguard keys and public ips.
Yes, I think it is bridge mode. But in the ISP modem interface it was called “modern mode”. I have Connect Box from UPC.
I wasn't sure if I should ran the commands on the router or the server laptop, so I ran it on both. Here is output from the laptop:
$ ip route
default via 192.168.8.1 dev wlp3s0 proto dhcp src 192.168.8.10 metric 600
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
172.18.0.0/16 dev br-14ee650b410b proto kernel scope link src 172.18.0.1
192.168.0.0/24 dev enp4s0 proto kernel scope link src 192.168.0.220 metric 100
192.168.8.0/24 dev wlp3s0 proto kernel scope link src 192.168.8.10 metric 600
/etc/config was empty.
And here is the output from the router:
# ip route
default via 94.xxx.xxx.1 dev eth1 proto static src 94.xxx.xxx.xxx metric 10
94.xxx.xxx.0/23 dev eth1 proto static scope link metric 10
192.168.8.0/24 dev br-lan.1 proto kernel scope link src 192.168.8.1
192.168.10.0/24 dev br-lan.10 proto kernel scope link src 192.168.10.1
192.168.20.0/24 dev br-lan.20 proto kernel scope link src 192.168.20.1
192.168.30.0/24 dev br-lan.30 proto kernel scope link src 192.168.30.1
Flint is accessible on normal ip 192.168.8.1. It is the laptop (my pseudo server) which gets wrong IP. Currently this laptop is connected both via wifi and ethernet cable.
From wifi it gets the IP 192.168.8.10, which I'm using to connect to it at the moment.
From cable connected to LAN2 it gets IP 192.168.0.220, and I'm unable to connect to that IP.
I'm thinking here, could it be you have set a static ip on one of the interfaces on the laptop?, maybe for u-boot and then been forgotten to turn it off?
I know that if you use ipconfig with a fixed ip you will get confused I have had this a few times.
I installed fresh Debian on this laptop and I didn’t set static IP on it.
I also tried creating separate network without using bridge filtering - I removed port 2 from the br-lan and created separate bridge and interface. It didn’t help. I also tried assigned the lan2 device directly to the interface also without any luck.
I suspect that the modem might be breaking my setup somehow. In bridge mode the ISP modem should have IP 192.168.100.1, but maybe it doesn’t for some reason. I didn’t check that yet.
I plan to go to that laptop and physically experiment a bit once I will have time. Maybe unplug Flint2 form the modem for a moment and check what happens then. Maybe I will also try connecting to the modem and check the optioons, but I doubt I will find anything useful.