What's new

Adding a Static Route via Command Line

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

MoMatt

New Around Here
I am away from home and don't have access to the web GUI, but I can ssh to the router through a VPN. I'd like to forward my LAN subnet to the VPN subnet while I'm on the road.

How can I use the command line to add a static route (ex. 10.0.4.0/24 via 192.168.50.6, where 10.x... is the VPN subnet and 192.168.50.6 is the LAN host that will forward the VPN subnet)

Thanks!
-Matt
 
You'll have to go into more detail.

Which "LAN subnet"? The one where you are or your home LAN?
"forward my LAN subnet" What does this mean?
What is the VPN topology? Where is the client running and where is the server running?

Plus any additional information you can think of.
 
Hey Colin, thanks!

You'll have to go into more detail.

Which "LAN subnet"? The one where you are or your home LAN?
The home LAN subnet managed by the Asus router - 192.168.50/24

"forward my LAN subnet" What does this mean?
I'd like all hosts on the home LAN to be visible through the VPN tunnel to hosts on the VPN
What is the VPN topology? Where is the client running and where is the server running?
- The VPN is a virtual network through Zerotier with a subnet of 10.0.4.0/24
- the client is a road warrior that connects to the Zerotier VPN.
Edit: client VPN address is 10.0.4.10
- the VPN server in this case would be a host on the home LAN with an interface there (192.168.50.2), as well as an interface on the VPN (10.0.4.2)
Plus any additional information you can think of.
So, the goal is to connect my road warrior to the VPN (zerotier), and be able to see all of the hosts on 192.168.50.0/24 as if it were physically connected to the home network.

On the VPN side (zerotier network), I have a route to 192.168.50.0/24 via 10.0.4.2, and can ping / ssh to 192.168.50.2 from the road warrior.
Edit: to be clear, it's the same host but I can get to it from it's VPN address of 10.0.4.2 or it's home LAN address of 192.168.50.2

I'd like to also be able to ssh/samba to 192.168.50.3 etc. from the road warrior without setting up zerotier on every client on the home LAN, and I think the way to do that is via AsusWRT, adding a static route:
"10.0.4.0/24 via 192.168.50.2"

I don't have access to the AsusWRT web gui on the road, and I figured I'd ask if there was a way to add this via the command line.

I hope this makes sense - thanks for taking a look!
 
Last edited:
Update for posterity and in case I forget or someone else stumbles across here.

As usual I'm making things too complicated due to a lack of knowledge and understanding.

The easiest solution to do what I want is to tunnel the Asus web GUI over SSH:

ssh -L 8888:home-lan-ip-of-router:80 me@vpn-ip-of-server-at-home

then on road warrior:
http://localhost:8888
 

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top