What's new

Static Route Help - RT-AC66U

  • 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!

fahmid

New Around Here
Hi, I have a quick question:

I have the ASUS RT-AC66U with Merlin's build 3.0.0.4.372.31.

I am currently Static routing (on the router) an external IP to come through a different Gateway , and it is working fine. However, now I wish to route a range of IPs, (e.g. 123.123.123.1 to 123.123.123.50). Is there any way I can do that, short of adding each one by one?
 
Hi, I have a quick question:

I have the ASUS RT-AC66U with Merlin's build 3.0.0.4.372.31.

I am currently Static routing (on the router) an external IP to come through a different Gateway , and it is working fine. However, now I wish to route a range of IPs, (e.g. 123.123.123.1 to 123.123.123.50). Is there any way I can do that, short of adding each one by one?


Yes, you can use CIDR notation. Check out:
http://ip2cidr.com/
 
I can't seem to add more than 15 characters to the "IP" box in the Static Route Section on my ASUS router.

E.g.

If I want to forward 123.12.123.12 - .15, the CIDR notation shows that I should use "123.12.123.12/30". However, if I copy and paste that into the IP box in my router, it shows up as "123.12.123.12/3" and wont allow my to enter any digits without erasing.
 
Ah, I see. I did some digging about user-scripts (something about saving them in the jffs partition, etc etc)... but I am completely clueless about this. (https://github.com/RMerl/asuswrt-merlin/wiki/User-scripts)

Is there any website/wiki/forum post that I can look at to learn?


EDIT:

So I have all my JFFS partition set up, along with Telnet and SSH on my router. I can access the partition with WinSCP and create files (I have created services-start) in the scripts folder without a problem.

My "services-start" looks like this:
Code:
#!/bin/sh

sh /jffs/scripts/route_vpn.sh&

The part I am confused about is how to script a route. I have the following (and i know it is wrong, so any help would be appreciated!)

My route_vpn.sh looks like this:
Code:
#!/bin/sh

ip route add 190.93.249.164 via 192.168.0.1

Then I changed the file's permission to be executable, and rebooted the router. However, it doesn't work (not a big surprise since I am 99% sure that my route_vpn.sh coding is wrong).

Could someone tell me what the format would be for this type of a script?

Thanks

EDIT2:

So I got the static routing to work. I switced to firewall-start and use a different coding format. However, it seems like CIDR is not working. If I add a specific IP (say 123.123.123.5), then the routing works. However, if I want a range using CIDR notation (e.g. 123.123.123.1 to 123.123.123.10), then its not working. The code, using CIDR notation is the following:


Code:
#!/bin/sh

route add 123.123.123.1/32 gw 192.168.0.1
route add 123.123.123.2/31 gw 192.168.0.1
route add 123.123.123.4/30 gw 192.168.0.1
route add 123.123.123.8/31 gw 192.168.0.1
route add 123.123.123.10/32 gw 192.168.0.1

But this isn't working. Is there anything I am doing wrong with the CIDR notation?
 
Last edited:

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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