Setup OpenWrt as a Network Switch

Hello, I installed OpenWRT on my old router and want to use it in place of my dying Network Switch. I have tried searching online and have been unsuccessful in finding a guide to do this. I don't know how to setup this up and am new to OpenWRT. I would like some help to set it up as a Network switch because for what ever reason my new router does not like devices with a certain network controller and it appears that I have multiple devices with that exact network controller. My old router never had issues and that is why I want to use it as a switch.

https://openwrt.org/docs/guide-user/base-system/basic-networking

Switch configuration can also be done through LuCI (another can probably guide you better on that than I could).

In most cases, if you just ignore the WAN port and connect the upstream router to one of the LAN port you would effectively be using the device as a switch.

You will likely want to disable DHCP on the device if you have the upstream router handling DHCP, and will of course want to set the IP address of the device's LAN side in the main router's network (e.g. 192.168.1.2 if the main router is 192.168.1.1).

To set that up, before connecting the two devices together, set your PC IP to a static IP (e.g. 192.168.1.10), connect to OpenWrt device and open http://192.168.1.1/cgi-bin/luci/admin/network/network/lan set the LAN IP of the router to 192.168.1.2 and disable DHCP.

Then you can connect the two devices together and reset your PC IP to automatic.

That should be the minimum configuration you need to have the devices connected as a switch.

When you are hapoy with the setup, you can look into disabling services and/or interfaces you don't need.

@dudefoxlive, welcome to the community!

Follow the section to make a managed switch.

1 Like

@dudefoxlive
What @lleachii said above is for "changing" the WAN port to work as a LAN port (if you need to increase the number of LAN ports), but obviously in all cases you would still need to configure the IP of the LAN interface to be in the main router's subnet, as described earlier.

If you don't need a fifth LAN port then you can just leave the WAN port unused (and unchanged).

1 Like

I have a slightly different case, but similar. I have a main router with owrt into which the provider's cable is connected in a single van and it distributes the Internet via wifi and lan, i.e. the standard topology. Next, I have a second router that is used as a NAS with a firewall disabled, a cable from the main router is connected to its van port, so the NAS receives an ip address from the main router via dhcp. The task is to configure the lan ports of the second router so that the clients connected to it receive ip from the first main router, and not from the NAS.

This is the same as above. Disable the dhcp server on the secondary router and/or the nas. Set the lan ip of the secondary router to an unused address in the same subnet as the main router. Connect the two devices lan-lan, or if you want the port that is physically labeled as wan to also be part of the equation, reassign the wan port such that it is on the same vlan or bridge as the lan (specific method here depends on your device and which version of OpenWrt you are using)

I tried this one. I seems working one way. All Devices on the swicht coould access devices in the other LAN. But the other LAN could not connect devices on the SWITCH.

@Mannshoch - given the age of this thread, please open a new one for your specific issue. Please be sure to fully describe your goals and the current state of things.