I have tried following tutorials to implement VLANs with OpenWRT. I follow all steps but the resulting connection doesn't connect to the router nor the internet via the connected SSID and now wonder if I am missing something basic.
I have a fiber optic connection with a TP-Link 1800 AX23 router. The router has the default 192.168.1.1 address and I have disconnected my Pi-Hole DNS/DHCP server for the timebeing.
Ethernet socket in my home's wall is connected to the WAN port on the router (unlike the tutorials, the router does not get an internet connection when the cable goes into the LAN1 port)
I have created a vlans device in bridge mode (bridged to wan and vlans.2 ports). VLAN filtering is enabled with one VLAN (ID: 2; tagged on wan and vlans.2 ports).
There is a "vlans" interface connected to the vlans.2 device. It is configured in static mode with IP 192.168.2.1, subnet 255.255.255.0 and gateway 192.168.1.1
I have modified the 5GHz network to be called "Openwrt5" and connected it to the "vlans" network.
However I don't get internet nor access to Openwrt when connecting to the Openwrt5 network. Access to both is fine on the default Openwrt network.
Is the OpenWrt router the only router on the network? Or is there a router ahead of it (i.e. directly connected to the ISP)?
Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
config bridge-vlan
option device 'br-lan'
option vlan '1'
list ports 'eth0:u*'
list ports 'lan1:u*'
list ports 'lan2:u*'
list ports 'lan3:u*'
list ports 'lan4:u*'
Then, edit your lan interface so that it uses br-lan.1 like this:
Thanks so much for your help Peter. This got it working. I've since been trying to work out what I did wrong and how to set up new VLANs. I'd appreciate if you could point me in the right direction to learn.
What I got wrong: 1) Not setting the firewall zone for the VLAN interfaces; 2) Trying to create additional devices to set up VLANs on rather than using the br-lan device that was already configured.
To create a new VLAN on it's own SSID
Does this process look complete and accurate to you?
Edit the ‘br-lan’ device in the VLAN tab by adding a VLAN ID. This new VLAN ID should be tagged on eth0 and untagged on all other lan1 to lan4 ports.
A new br-lan.X VLAN (802.1q) device will automatically be created.
Add a new interface named vlanX with a static address connected to device br-lan.X (created in previous step). Configure IP v4 address to be 192.168.X.1/24. Leave gateway blank.
In the DHCP Server tab, click Set up DHCP server and leave default settings.
Configure a wireless network to use vlanX interface as the network.
Set the firewall settings to the lan firewall zone
And finally, does this VLAN set up on the br-lan device appear correct?
The physical LAN1 and LAN2 ports on my router will have my homeserver and DNS server respectively. And LAN3 will be a sync box for IoT devices. Devices of VLAN1 and VLAN2 can access all devices. Devices on VLAN69 will be IoT devices but will also need access to the DNS server and home server where home assistant will be running.