#!/bin/sh
touch /tmp/000init-start
...put the rest of your code below here...
ls /tmp/000*
Okay, now try running this command:
Code:iptables -t nat -I POSTROUTING -o `nvram get wan0_ifname` -j MASQUERADE
If that works, it sounds like it's just a problem with the JFFS scripts... Can you verify that the scripts are in place and correct?
If you are using Merlin's firmware, here is a definitely working way of accessing modem interface through the router:
1. Give your modem an IP that is outside the router's ip range. (Your IP numbers 192.168.0.1 for modem and 192.168.1.1 for router are ok).
2. Enable jffs partition.
3. You need to add two scripts to the /jffs/scripts directory, namely wan-start and nat-start scripts.
wan-start script :
#!/bin/sh
ifconfig `nvram get wan0_ifname`:0 192.168.0.2 netmask 255.255.255.0
Note : the IP number shown in bold must be one more than your modem's IP. If your modem's ip is 192.168.0.1 then it must be written as 192.168.0.2.
nat-start script :
#!/bin/sh
iptables -t nat -I POSTROUTING -o `nvram get wan0_ifname` -j MASQUERADE
Before adding scripts, you can check if this works for you easily. Just SSH to your router and enter the commands in the scripts (you can use copy-paste). Then open a browser session to your modem (192.168.0.1 in your case) and there is your modem interface.
Adding scripts just makes sure that the commands are run on router startup.
--
If you are using Merlin's firmware, here is a definitely working way of accessing modem interface through the router:
1. Give your modem an IP that is outside the router's ip range. (Your IP numbers 192.168.0.1 for modem and 192.168.1.1 for router are ok).
2. Enable jffs partition.
3. You need to add two scripts to the /jffs/scripts directory, namely wan-start and nat-start scripts.
wan-start script :
#!/bin/sh
ifconfig `nvram get wan0_ifname`:0 192.168.0.2 netmask 255.255.255.0
Note : the IP number shown in bold must be one more than your modem's IP. If your modem's ip is 192.168.0.1 then it must be written as 192.168.0.2.
nat-start script :
#!/bin/sh
iptables -t nat -I POSTROUTING -o `nvram get wan0_ifname` -j MASQUERADE
Before adding scripts, you can check if this works for you easily. Just SSH to your router and enter the commands in the scripts (you can use copy-paste). Then open a browser session to your modem (192.168.0.1 in your case) and there is your modem interface.
Adding scripts just makes sure that the commands are run on router startup.
--
You need to access the router via telnet or better ssh to transfer the files to the mentioned folder.can someone please tell me how to copy this to the appropriate location?
A good way to help troubleshooting scripts is to put the following at the top of the script. For example, begin your init-start like this:
Code:#!/bin/sh touch /tmp/000init-start ...put the rest of your code below here...
After that, you can ensure the script did get executed by checking if the file exists in /tmp:
Code:ls /tmp/000*
nat-start script :
#!/bin/sh
iptables -t nat -I POSTROUTING -o `nvram get wan0_ifname` -j MASQUERADE
--
Folks - for at least single WAN scenarios there is a simple an elegant solution, and credit goes to ariesmk from DSLReports forum
http://www.dslreports.com/forum/r28945117-~time=1389309874
Go to http://192.168.0.1/Advanced_WAN_Content.asp
LAN > LAN IP
IP Address: 192.168.0.1
WAN > Internet Connection
WAN IP Setting -
Get the WAN IP automatically: No
IP Address: 192.168.1.2
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
This should allow you to access the SmartRG through your router.
#!/bin/sh
# Allow modem access (also wan-start)
iptables -t nat -I POSTROUTING -o `nvram get wan0_ifname` -j MASQUERADE
exit
#!/bin/sh
# Allow modem access (also nat-start)
ifconfig `nvram get wan0_ifname`:0 192.168.100.2 netmask 255.255.255.0
exit
ASUSWRT-Merlin RT-AC88U 382.2-beta3 Wed Jan 17 05:42:10 UTC 2018
...@RT-AC88U-A5:/tmp/home/root# ifconfig
br0 Link encap:Ethernet HWaddr 60:45:CB:18:80:78
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::6245:cbff:fe18:8078/64 Scope:Link
inet6 addr: 2003:da:4bd7:6200::1/56 Scope:Global
UP BROADCAST RUNNING ALLMULTI MULTICAST MTU:1500 Metric:1
RX packets:52182 errors:0 dropped:0 overruns:0 frame:0
TX packets:361087 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:8102626 (7.7 MiB) TX bytes:497723012 (474.6 MiB)
eth0 Link encap:Ethernet HWaddr 60:45:CB:18:80:78
inet6 addr: fe80::6245:cbff:fe18:8078/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:344700 errors:0 dropped:0 overruns:0 frame:0
TX packets:195630 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:489450892 (466.7 MiB) TX bytes:20749609 (19.7 MiB)
Interrupt:180 Base address:0x5000
eth1 Link encap:Ethernet HWaddr 60:45:CB:18:80:78
inet6 addr: fe80::6245:cbff:fe18:8078/64 Scope:Link
UP BROADCAST RUNNING ALLMULTI MULTICAST MTU:1500 Metric:1
RX packets:844 errors:0 dropped:0 overruns:0 frame:0
TX packets:6281 errors:0 dropped:7 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:220203 (215.0 KiB) TX bytes:1609903 (1.5 MiB)
eth2 Link encap:Ethernet HWaddr 60:45:CB:18:80:7C
inet6 addr: fe80::6245:cbff:fe18:807c/64 Scope:Link
UP BROADCAST RUNNING ALLMULTI MULTICAST MTU:1500 Metric:1
RX packets:6068 errors:0 dropped:0 overruns:0 frame:0
TX packets:307615 errors:0 dropped:3 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1013944 (990.1 KiB) TX bytes:451301031 (430.3 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MULTICAST MTU:16436 Metric:1
RX packets:19083 errors:0 dropped:0 overruns:0 frame:0
TX packets:19083 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4466426 (4.2 MiB) TX bytes:4466426 (4.2 MiB)
ppp0 Link encap:Point-to-Point Protocol
inet addr:84.157.149.137 P-t-P:62.155.247.225 Mask:255.255.255.255
inet6 addr: 2003:da:4bbf:1761:98a9:1717:c3ea:cbf4/64 Scope:Global
inet6 addr: fe80::98a9:1717:c3ea:cbf4/10 Scope:Link
UP POINTOPOINT RUNNING MULTICAST MTU:1492 Metric:1
RX packets:27465 errors:0 dropped:0 overruns:0 frame:0
TX packets:25430 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:17508323 (16.6 MiB) TX bytes:4389453 (4.1 MiB)
vlan1 Link encap:Ethernet HWaddr 60:45:CB:18:80:78
inet6 addr: fe80::6245:cbff:fe18:8078/64 Scope:Link
UP BROADCAST RUNNING ALLMULTI MULTICAST MTU:1500 Metric:1
RX packets:1169 errors:0 dropped:0 overruns:0 frame:0
TX packets:7224 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:132262 (129.1 KiB) TX bytes:1815234 (1.7 MiB)
vlan7 Link encap:Ethernet HWaddr C8:69:CD:3D:45:8F
inet addr:169.254.99.149 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:342889 errors:0 dropped:0 overruns:0 frame:0
TX packets:188392 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:483083078 (460.7 MiB) TX bytes:17016639 (16.2 MiB)
wds0.1 Link encap:Ethernet HWaddr 60:45:CB:18:80:78
inet6 addr: fe80::6245:cbff:fe18:8078/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:36076 errors:0 dropped:0 overruns:0 frame:0
TX packets:61611 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5234620 (4.9 MiB) TX bytes:48387013 (46.1 MiB)
ASUSWRT-Merlin RT-AC88U 382.2-beta3 Wed Jan 17 05:42:10 UTC 2018
...@RT-AC88U-A5:/tmp/home/root# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
62.155.247.225 * 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 * 255.255.255.0 U 0 0 0 br0
169.254.0.0 * 255.255.0.0 U 0 0 0 vlan7
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 62.155.247.225 0.0.0.0 UG 0 0 0 ppp0
miju@RT-AC88U-A5:/tmp/home/root#
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!