What's new

Simple Route Add Command

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

CaptnDanLKW

Senior Member
I'd like to be able to reach my Fiber / ONT's internal web server from my internal network.

ONT is only a Bridge/Media Converter. It's web page listens on 192.168.0.254; I verified by connecting a laptop directly to it.

My RT-AC86U's WAN port is (obviously) plugged into the ONT. My Internal Network is 192.168.1.0/24.

I assume I could do something like route add 192.168.0.254/32 or 192.168.0.0/24, but I'm not sure what the right network or interface to use to complete the command.

Looking for the correct command.

FWIW, before I switched to fiber from a cable modem, the modem's interface was accessible at 192168.100.1 without any commands - I can only assume it advertised a route.

Thanks all.



dump of 'ip route'
default via ###.###.###.# dev eth0
10.8.0.0/24 dev tun11 proto kernel scope link src 10.8.0.2
127.0.0.0/8 dev lo scope link
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.1
###.###.#.## via ###.###.###.# dev eth0 metric 1
###.###.###.0/24 dev eth0 proto kernel scope link src ###.###.###.##
###.###.###.# dev eth0 proto kernel scope link
###.###.###.## via ###.###.###.# dev eth0 metric 1

dump of 'route'
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 ###.###.###.# 0.0.0.0 UG 0 0 0 eth0
10.8.0.0 0.0.0.0 255.255.255.0 U 0 0 0 tun11
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
###.##.#.## ###.###.###.# 255.255.255.255 UGH 1 0 0 eth0
###.###.###.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
###.###.###.# 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
###.###.###.## ###.###.###.# 255.255.255.255 UGH 1 0 0 eth0
 
This shouldn't be a routing issue. Just like when you were using your cable modem, unless you have a more specific route setup* all traffic will go out of the default route, which is via your ONT. So the question is, what specific restrictions does the ONT have that prevents you from accessing it via the router.

* This could be other locally attached routers or something like VPN interface.
 
I'd like to be able to reach my Fiber / ONT's internal web server from my internal network.

ONT is only a Bridge/Media Converter. It's web page listens on 192.168.0.254; I verified by connecting a laptop directly to it.

My RT-AC86U's WAN port is (obviously) plugged into the ONT. My Internal Network is 192.168.1.0/24.

I assume I could do something like route add 192.168.0.254/32 or 192.168.0.0/24, but I'm not sure what the right network or interface to use to complete the command.

Looking for the correct command.

FWIW, before I switched to fiber from a cable modem, the modem's interface was accessible at 192168.100.1 without any commands - I can only assume it advertised a route.

Thanks all.
SSH into your ASUS router and send these commands:

Code:
ifconfig $(nvram get wan_ifname):0 192.168.0.2 netmask 255.255.255.0

iptables -t nat -I POSTROUTING -o $(nvram get wan_ifname) -j MASQUERADE

It doesn't survive a reboot...
 
Update:
Yes, I would think the default route should do what it should - any address outside the network should send to that. but it doesn't

The TL;DR is t's not going to work. Looks like the web-ui status page is only available at initial power up, and then only when a ethernet cable is connected with a static IP address on 192.168.0.0/24 and when no traffic has been passed. Looks like the webUI page stops listening shortly after traffic flows.


Details how I came to this conclusion:

Correction - The ONT status page is on 192.168.0.1, not .254. That said...

From router, before the ifconfig command
xxx@RTAC86U:/tmp/home/root# ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1): 56 data bytes
^C
--- 192.168.0.1 ping statistics ---
5 packets transmitted, 0 packets received, 100% packet loss

Execute the fconfig to add interface.
ifconfig $(nvram get wan_ifname):0 192.168.0.1 netmask 255.255.255.0

eth0:0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING ALLMULTI MULTICAST MTU:1500 Metric:1

xxx@RTAC86U:/tmp/home/root# ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1): 56 data bytes
64 bytes from 192.168.0.1: seq=0 ttl=64 time=0.271 ms
64 bytes from 192.168.0.1: seq=1 ttl=64 time=0.087 ms
64 bytes from 192.168.0.1: seq=2 ttl=64 time=0.129 ms
64 bytes from 192.168.0.1: seq=3 ttl=64 time=0.089 ms
^C
--- 192.168.0.1 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.087/0.144/0.271 ms

Looks good so far.

execute the iptables command with both eth0 and eth0:0 (thinking it should have been the latter).

Either way, can't connect. - connection refused. Tested directly from the router.

xxx@RTAC86U:/tmp/home/root# telnet 192.168.0.1 80
telnet: can't connect to remote host (192.168.0.1): Connection refused

However, upon troubleshooting, 192.168.0.1 responds to pings when the cable is disconnected, so that's not right.

connecting hardcoded laptop with 192.168.0.55/255.255.255.0 back to ONT device without power cycle.

unable to reach web-ui. 192.168.0.1 ping no response...
power cycle ONT, Pings resume after powerup.

Conclusion: No way to view ONT status page once it starts to pass traffic and if it didn't take itself offline it probably would have worked without any changes the way the cable modem used to.

Thanks anyways.
 
Execute the fconfig to add interface.
ifconfig $(nvram get wan_ifname):0 192.168.0.1 netmask 255.255.255.0
This is wrong. You should be using 192.168.0.2, or something else in the subnet range that is not 192.168.0.1.

You should also not need the iptables command because the router already has the masquerade rules.
 
Last edited:
Execute the fconfig to add interface.
ifconfig $(nvram get wan_ifname):0 192.168.0.1 netmask 255.255.255.0

execute the iptables command with both eth0 and eth0:0 (thinking it should have been the latter).
That's wrong...I wrote 192.168.0.2

ifconfig $(nvram get wan_ifname):0 192.168.0.2 netmask 255.255.255.0

In case also send:
iptables -t nat -I POSTROUTING -o $(nvram get wan_ifname) -j MASQUERADE
 
My network is 192.168.1.0/24.

The ONT webui is 192.168.0.1

In my desire to discover the web-ui of the ONT device and since it's a bridge only device, so if you leave it to DHCP your OS will get your actual IP, I used my experience and some guessing of networks and common addresses

To more specific why I don't think this will ever work is because my process was to reboot the ONT while connected to my laptop with a 192.168.0.x address. As a test I logged into the ONT Web UI directly from the laptop (only after a fresh ONT power cycle), then I disconnected it and reconnected to the WAN interface of my router rithout rebooting anything. WAN came up on my home network, no problem.

I then pulled it from the WAN and plugged it back into my laptop which was just able to reach 192.168.0.1 and ping , now it can't and ping times out. So I can only surmise that the device web-ui is designed to go offline once the device detects its operational.


Regarding the ifconfig & iptables I assumed a typo on your side but now understand it was .2 by design. I'd try again but seeing the behavior of the device, I don't see a use case for checking the signal levels while it's online.

Thanks all
 
I'd like to be able to reach my Fiber / ONT's internal web server from my internal network.

ONT is only a Bridge/Media Converter. It's web page listens on 192.168.0.254; I verified by connecting a laptop directly to it.

My RT-AC86U's WAN port is (obviously) plugged into the ONT. My Internal Network is 192.168.1.0/24.

I assume I could do something like route add 192.168.0.254/32 or 192.168.0.0/24, but I'm not sure what the right network or interface to use to complete the command.

Looking for the correct command.

FWIW, before I switched to fiber from a cable modem, the modem's interface was accessible at 192168.100.1 without any commands - I can only assume it advertised a route.

Thanks all.



dump of 'ip route'
default via ###.###.###.# dev eth0
10.8.0.0/24 dev tun11 proto kernel scope link src 10.8.0.2
127.0.0.0/8 dev lo scope link
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.1
###.###.#.## via ###.###.###.# dev eth0 metric 1
###.###.###.0/24 dev eth0 proto kernel scope link src ###.###.###.##
###.###.###.# dev eth0 proto kernel scope link
###.###.###.## via ###.###.###.# dev eth0 metric 1

dump of 'route'
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 ###.###.###.# 0.0.0.0 UG 0 0 0 eth0
10.8.0.0 0.0.0.0 255.255.255.0 U 0 0 0 tun11
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
###.##.#.## ###.###.###.# 255.255.255.255 UGH 1 0 0 eth0
###.###.###.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
###.###.###.# 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
###.###.###.## ###.###.###.# 255.255.255.255 UGH 1 0 0 eth0

I fixed it like this.

Try this in Windows:

c:\Windows\System32\Drivers\etc\hosts

1 Open the start menu and enter notepad in the search bar.

2 Then open notepad with administrator rights.

3 Then choose Run as administrator.

Ad it your windows hostfile

4 Add 192.168.0.254 "and here the name of your login page from provider" on its own line in the notepad.

5 Then open your browser and go to 192.168.0.254

Maybe it helps.
 
I fixed it like this.

Try this in Windows:

c:\Windows\System32\Drivers\etc\hosts

1 Open the start menu and enter notepad in the search bar.

2 Then open notepad with administrator rights.

3 Then choose Run as administrator.

Ad it your windows hostfile

4 Add 192.168.0.254 "and here the name of your login page from provider" on its own line in the notepad.

5 Then open your browser and go to 192.168.0.254

Maybe it helps.
This appears to have nothing to do with the problem being discussed. So I don't know what you "fixed".
 
Last edited:

Latest threads

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