What's new

Script to access bridged cable modem via WAN

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

highwire

Regular Contributor
My scripting-fu is weak, so I'm asking for some help from the community.

I just replaced my Motorola SB6120 cable modem with a Cisco DPC3848. Both use 192.168.100.1 as the IP address to the GUI. With the Motorola, I could access the GUI by simply entering that IP address in the browser. With the Cisco I need to add these commands on my RT-AC87U with firmware version 378.53 to get it to work:

ip addr add 192.168.100.2/24 dev eth0 brd +
iptables -I POSTROUTING -t nat -o eth0 -d 192.168.100.0/24 -j MASQUERADE

I'm doing that via an ssh session, but of course I lose those settings on a reboot.

What I'm trying to figure out is how to add these to a startup script. My /jffs/scripts directory already has three files: post-mount, services-start and services-stop. I have the "Enable jffs scripts and configs" turned on already for entware.

Do I do this in firewall-start or wan-start, or somewhere else? What about timing - do I need a sleep delay to keep the commands from executing too early in the boot process?

Thanks for your help.
 
Last edited:
My scripting-fu is weak, so I'm asking for some help from the community.

I just replaced my Motorola SB6120 cable modem with a Cisco DPC3848. Both use 192.168.100.1 as the IP address to the GUI. With the Motorola, I could access the GUI by simply entering that IP address in the browser. With the Cisco I need to add these commands on my RT-AC87U with firmware version 378.53 to get it to work:

ip addr add 192.168.100.2/24 dev eth0 brd +
iptables -I POSTROUTING -t nat -o eth0 -d 192.168.100.0/24 -j MASQUERADE

I'm doing that via an ssh session, but of course I lose those settings on a reboot.

What I'm trying to figure out is how to add these to a startup script. My /jffs/scripts directory already has three files: post-mount, services-start and services-stop. I have the "Enable jffs scripts and configs" turned on already for entware.

Do I do this in firewall-start or wan-start, or somewhere else? What about timing - do I need a sleep delay to keep the commands from executing too early in the boot process?

Thanks for your help.

Added the commands to firewall-start along with a 'logger' command with no sleep delays. I see the log entry just before the WAN comes up. It seems to work just fine - I can see the 192.168.100.0 route in the routing table.

Cheers...
 

Latest threads

Sign Up For SNBForums Daily Digest

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