OpenWrt Forum Archive

Topic: router connected to openwrt router - how to configure routing table?

The content of this topic has been archived on 25 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have another router (192.168.1.0 - which just acts as a switch) connected to port 4 of my WRT54GS running openwrt (192.168.0.0). my linksys router is connected to the internet, so all machines connected to it work fine. However, I cannot access any machines in 192.168.1.0 and vice versa obviously because I need to configure the routing table in openwrt. Can anyone please give some advice how to do that?

Thanks, Thomas

Well, technically, if your "other router" is giving out IP addresses, it isn't acting as a switch.  I would try switching your other router into true switch mode, then everything should get their IPs from your linksys and the problem would go away.  Is the other router's wan port plugged into port 4?  If so then it should automatically know how to get to 192.168.0.1.  If the other router can get to the linksys but the linksys cannot get to the other router, Something like below - added to the linksys should work, no guarantees though

route add 192.168.1.0 gw 192.168.0.XXX

Where 192.168.0.XXX is the wan address of the other router when you check it's status.

Thanks I'll try that. DHCP is disabled on it. Last time I gave the other router the IP 192.168.0.2 (which is the configuration menu and also the integrated print server). I was able to reach it from the openwrt router but I was unable to reach the machines connected to the other one, although I gave them static IP addresses (192.168.0.x). However, those machines were able to reach all machines connected to both routers.

you have wan (internet) and lan (192.168.0.x) and a third segment (192.168.1.x) - you need 3 ip's for your wrt54g and must split the switch into a 3 port switch and a second wan port for (192.168.1.x),
or you must change your netmask from 255.255.255.0 to 255.255.0.0 (in all clients from 192.168.0.0 or 192.168.1.x -  and also the wrt54g)

The discussion might have continued from here.