Hi,
I setup a new openwrt x86 router and I have my older wifi router netgear r8000 connected to it providing wifi, but in a different subnet. I basically just plugged in the wifi router wan from being connected to the modem to being connected to the new x86 router.
I would like the wifi router to be like an wireless access point and a switch in its ethernet ports to the main router, so devices connected via ethernet or wifi to this router are all in the same subnet provided by the main router. The main router also provides internet to three computers through a physical switch I have in a den office.
The physical connection is basically:
internet <-> modem <-> main router
main router <-> switch <-> computers
main router <-> wifi router <-> computers, and smartphones.
I have read the OpenWRT documentation and I'm having a hard time finding out what exactly I need to do. Could you please help me with my configuration?
OpenWrt 22.03.5
# 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 packet_steering '1'
option ula_prefix 'fdc6:15c1:ebac::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config device
option name 'wan'
option macaddr '78:D2:94:0E:04:C2'
config interface 'wan'
option device 'wan'
option proto 'dhcp'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
My guess is that I need to add the wan device to the lan interface and remove the wan and wan6 interfaces, and then disable the dhcp server, but not sure how the forwarding would happen. I think the wireless part doesn't need any change.
If you want the wan port to be “just another port” you would do exactly what you mentioned about adding it to the lan bridge and removing the wan and wan6 interfaces.
The rest is all transparent. No forwarding or anything else is necessary.
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 packet_steering '1'
option ula_prefix 'fdc6:15c1:ebac::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
list ports 'wan'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.210.2'
option netmask '255.255.255.0'
config device
option name 'wan'
option macaddr '78:D2:94:0E:04:C2'
And then I would disable firewall and dnsmasq (full).
How would ipv6 work in this setting? would it just work?
Also, I'm having a hard time understanding the relationship of eth0..2 to lan1-4, and wan.
It is like if everything goes over eth2, but eth0, and eth1 are down?
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether ee:73:0b:45:41:95 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 12:01:d0:8c:c9:ce brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
link/ether 78:d2:94:0e:04:c1 brd ff:ff:ff:ff:ff:ff
5: lan1@eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
link/ether 78:d2:94:0e:04:c1 brd ff:ff:ff:ff:ff:ff
6: lan2@eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
link/ether 78:d2:94:0e:04:c1 brd ff:ff:ff:ff:ff:ff
7: lan3@eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
link/ether 78:d2:94:0e:04:c1 brd ff:ff:ff:ff:ff:ff
8: lan4@eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
link/ether 78:d2:94:0e:04:c1 brd ff:ff:ff:ff:ff:ff
9: wan@eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether 78:d2:94:0e:04:c2 brd ff:ff:ff:ff:ff:ff
No, I would not recommend that. Simply set the DHCP server on the lan interface to ignore (this disables DHCP on the lan). This will persist across upgrades, whereas disabling dnsmasq will not and you may get a surprise when you eventually run an upgrade and it re-enables itself.
You do not need to disable the firewall -- it doesn't affect anything. I suggest leaving it as is.
Generally speaking, eth0.2 and similar are part of the old (swconfig) method of configuring internal switches. Now, the ports are called out by name (to match the port names printed on the case of the device). Your configuration assigns all 5 ports (lan1-4 + wan) to br-lan and it works as a basic 5-port switch (and it can be configured for VLANs if you want).
It will just work. The dumb AP is just a bridge... it's basically just a media converter (ethernet <-> wifi).
The wifi router lost network connectivity from within, because the setup is static. So I was unable to setup heartbeats or install packages. For the record, I did this to solve it:
Added the gateway manually in the /etc/config/network