OpenWrt Forum Archive

Topic: Trying to set up static route from router to main router

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

I believe this is the best way.

The DVR is connected to the main router by ethernet. A desktop is connected to another router, which is connected to the main router via wifi client mode.

Basically: DVR -> Main Router <- Other Router <- Desktop

I cannot make a direct connection to the DVR through the other router, but I can using a USB adapter. But the USB adapter doesn't work well due to poor signal strength, so the DVR software is sensitive to dropped packets, and so I prefer using the other router for that and other reasons.
I'm trying to figure out how set up a static route, on which router do I create the static route, and using luci, what does the interface, target, IPv4 netmask, IPv4 Gateway, and metric options mean?

Is there a good guide on static routing?

Many things on static routing are generic or outdated, and it's hard to find OpenWRT specific guides.

You probably only need a static route on the main router that tells it how to reach the Desktop and other devices on the same network. And make sure to disable NAT in the other router otherwise a static route doesn't make much sense.

Target and netmask is for the network to which the Desktop is connected (openwrt default is 192.168.0.0 and 255.255.255.0 just to give an example). The interface is the one connected to the other router, and the gateway is the IP address of the other router. Metric isn't needed if you have only one route.

(Last edited by mikma on 23 Dec 2015, 00:05)

Except it's the desktop that's trying to connect to the dvr.

Edit: and why should I disable NAT?

(Last edited by drizzit on 23 Dec 2015, 01:52)

You need to have WDS enabled on your main router - are both routers running OpenWRT?

Yes, both routers are running OpenWRT and I have admin access.

OK, so you need to enable WDS in /etc/config/wireless for the SSID on the router acting as master on the wireless network.

Then on the other unit, connect it to the wireless station mode, as you have done already, and bridge wlan to lan, then make sure dnsmasq and firewall are disabled (chmod -x /etc/init.d/firewall and dnsmasq), reboot and all should be good smile

how do I disable firewall use Luci?

Pardon me, but I don't want to make any mistakes, and you are only providing shell commands. I prefer to do it through luci.

sorry I don't know as I just use SSH, hopefully someone else will chime in. But SSH is very simple, log in and run

chmod -x /etc/init.d/firewall
chmod -x /etc/init.d/dnsmasq

then reboot and that should be it smile

That changes permissions to execute only, I think?

The discussion might have continued from here.