I have 2 OpenWRT router, both with DSL, WAN and 4 LAN ports. First one is connected to Internet and has a usual PPPOE + 4LAN switch setup. Now i want to use my second router in another room.
I was going to connect LAN1 (or WAN port if that can be configured?) to WAN. Set WAN to DHCP client and somehow route traffic to the wired clients connected on LAN 1-4. I get an IP adress via DHCP but i cant reach, ping, ssh anything to it.
So is my wish feasable? Can some come up with a small gude for me?
Thank you!
Sure, this is no problem. You are going to be setting this up more-or-less like a dumb AP (even if you don't use the AP function).
The most important thing is that you turn off the DHCP server on the lan (set it to ignore), and set an IP address that does not conflict with your network or overlap the DHCP pool from your main router; or use DHCP client mode.
You can include your wan port (making it just another port on the switch) if you want.
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:
Yes, config from the device that will become the switch. With that, I can recommend the specific changes to make your device into a switch with DHCP disabled and the wan port included.
root@bthh5a:~# 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 ula_prefix 'fd5e:4438:44dd::/48'
config atm-bridge 'atm'
option vpi '1'
option vci '32'
option encaps 'llc'
option payload 'bridged'
option nameprefix 'dsl'
config dsl 'dsl'
option annex 'a'
option tone 'av'
option ds_snr_offset '0'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
option ipv6 '0'
config device
option name 'lan1'
option macaddr '00:37:b7:2c:23:82'
option ipv6 '0'
config device
option name 'lan2'
option macaddr '00:37:b7:2c:23:82'
config device
option name 'lan3'
option macaddr '00:37:b7:2c:23:82'
option ipv6 '0'
config device
option name 'lan4'
option macaddr '00:37:b7:2c:23:82'
option ipv6 '0'
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 interface 'wan'
option proto 'dhcp'
option device 'wan'
config interface 'wan6'
option device '@wan'
option proto 'dhcpv6'
config device
option name 'eth0'
I really would like to connect the WAN <-> WAN ports together to have this as "bridge cable"
My ultimate goal then is to have also mesh WIFI running in this setup.
Now, in the network config, remove the wan and wan6 interfaces, and then add wan to the lan bridge so that it looks like this:
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
list ports 'wan'
option ipv6 '0'
and finally, set the lan interface to an IP address in your main subnet that does not conflict with any other devices or the DHCP pool, or set it to proto 'dhcp' if you want it to be set via DHCP from your main router.
One or the other from below
Below would be a static configuration assuming that 192.168.1.0/24 is your main subnet and 192.168.1.2 is not used by any other device nor the DHCP pool.
optionally, you can add the dns and gateway information to the lan (in static IP configuration) if you will need to install any packages (if not, this is not important).
--- or ----
if you go with the DHCP option, it would look like this:
config interface 'lan'
option device 'br-lan'
option proto 'dhcp'