What's new

Accessing modem via N66U and WPS hack?

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

YAHHHH!!!!!!!! That worked!!! Awesome!!!

Was checking the code inside those files, its a little different from the one your post, post #2 on this thread.

These are the files I created, the two difference I see it the once you sent me had no enter and some additional command.
Was that the problem?

Encoding, most likely. Windows-encoded text files uses both a carriage return and a linefeed at the end of a line. Linux only uses a linefeed. While this looks visually the same, it can cause issue with shell scripts apparently.
 
Thank you Merlin and keep up the GREAT work!!!

Just curious, IF I plan on using dual WAN, both DSL both using ST516. Is it possible to access the 2nd modem connected to LAN 1 port? Am I asking for too much? :D
 
Thank you Merlin and keep up the GREAT work!!!

Just curious, IF I plan on using dual WAN, both DSL both using ST516. Is it possible to access the 2nd modem connected to LAN 1 port? Am I asking for too much? :D

Not sure if that one would be possible, since the LAN port is connected to the bridge, and not a separate network interface.

Note that there's a good chance that I will disable Dual WAN in the next release. There's just too many issues right now with it, so I'd wait for Asus to release a more stable version of that code.
 
Not sure if that one would be possible, since the LAN port is connected to the bridge, and not a separate network interface.

Note that there's a good chance that I will disable Dual WAN in the next release. There's just too many issues right now with it, so I'd wait for Asus to release a more stable version of that code.

Understood.
Notice you mention about disabling it in the other thread you created. It's not that important but would be nice. You should poke Asus about it :D

Again, thank you for all you hard work and Happy Holidays!!!!
 
Just wanted to say I have followed this guide and all working great.
I had trouble, presumably with the encoding, using Notepad++ in windows. I could't get the scripts to run even though pating them into thew command line worked.
So I recreated them using gedit in linux and they work fine.
Many thanks RMerlin.

I'm the same guy you've been advising on the Asus forum btw. :)
 
Just wanted to say I have followed this guide and all working great.
I had trouble, presumably with the encoding, using Notepad++ in windows. I could't get the scripts to run even though pating them into thew command line worked.
So I recreated them using gedit in linux and they work fine.
Many thanks RMerlin.

I'm the same guy you've been advising on the Asus forum btw. :)

I suspect that Notepad++ defaults to a Windows encoding. When saving, see if it offers to save the file with a UNIX encoding instead - that way it will use the proper end-of-line codes.

Best way to be sure is to edit the file on the router using the vi command (not very user friendly) or installing nano through Optware.
 
I suspect that Notepad++ defaults to a Windows encoding. When saving, see if it offers to save the file with a UNIX encoding instead - that way it will use the proper end-of-line codes.

Best way to be sure is to edit the file on the router using the vi command (not very user friendly) or installing nano through Optware.

Yes notepad++ does default to Windows encoding. I set it to Unix but I noticed it still puts crlf st the end of every line. Think that's what was causing the problem but couldn't find a way to stop it. Got fed up trying so did it on a Linux box. Used gedit but must learn vi :eek:
Any way, thanks for all your support. I'm pretty new to Linux do learning all the time.

Sent from my GT-N7000 using Tapatalk 2
 
For those willing to learn the vi way:

vi /jffs/scripts/wan-start

Press "i" to go into "Insert mode"

Type the two lines.

Press the Esc key to exit insert mode

Type the following to save:

:w! <enter>

Then quit vi:

:q! <enter>

The important thing to learn about vi is that by default, you are in command mode, not in editing mode.

Once you remember those basics I just posted, vi isn't so bad.
 
Hello,
Now I have access through this guide to my modem.
The problem with Notepad and the Unix I had.
I used Notepad for this solution.
Go to Edit -> EOL Conversion -> UNIX format

How can I test whether a rule works?
Too bad the one who rules the Web can not enter the menu as shown in the
DD-WRT! That lasts been easier.

Now it works, yes.

Thank you
 
Hi, first of all I would like to thank you for this guide. I have tried to step through it and as far as I can see it should work for my equipment, but at least it does not :(

I am using the RT-N66U with latest Merlin Firmware 3.0.0.4.374.39_0 and Speedtouch v536i as modem.
The router has the IP 192.168.2.1 and the modem static IP with 192.168.1.254 with DHCP off and bridge mode.

I checked my settings several times and I also completely resettet my router to Factory Defaults, but nothing helped me out of trouble.

ifconfig eth0:0 mention the IP 192.168.1.120 like it set in wan-start script. If I type 192.168.1.120 it will bring me to the webGUI of the ASUS RT-N66U not like expected to the webGUI of the Speedtouch modem.

So, what is going wrong? Your help is very appreciated!

Thanks,
Sharbe

Edit: Problem solved by changing modems subnet
 
Last edited:
Hello,

Great guide, my scenario is a little different and need to access my modem.

My modem/router provided by my ISP is locked with a custom firmware, the model is the Sagemcom F@ST5650.

The modem ip is 192.168.1.25, I activated the DMZ (ip 192.168.25.254) on the modem to my router with ip 192.168.1.1 AC68U.

I use OpenVPN AC68U and have access to all devices with IP 192.168.1.X, I do not have access to the modem with the IP 192.168.25.1.

Is there any way to access the modem/router by using VPN?

configuration of wan:

ASUS_Wireless_Router_RT_AC68_U_Internet_Connect.png


configuration of OpenVPN:
ASUS_Wireless_Router_RT_AC68_U_VPN_Server.png


Thank you.

Excuse me for my English is not my native language.
 
You will need to know the WAN IP of your modem to get OpenVPN to connect from the internet. When you set up OpenVPN on your router it will assign the static WAN IP of the router to the client.ovpn you export. Simple to replace the IP, or URL, in the .ovpn file with the IP or URL of your modem( edit with Notepad). Since you have the modem set to "DMZ" to your Asus all the inbound traffic should go to your router. You may want to set up a dynamic DNS service on your modem if the WAN IP is prone to change often.
A simpler way is to set up Teamviewer on an always on PC inside your LAN. If you have two wired network cards connect one to the Asus the other to the modem and you will be able to do remote control of the PC from wherever and manage either the modem or the router.

bb
 
You will need to know the WAN IP of your modem to get OpenVPN to connect from the internet. When you set up OpenVPN on your router it will assign the static WAN IP of the router to the client.ovpn you export. Simple to replace the IP, or URL, in the .ovpn file with the IP or URL of your modem( edit with Notepad). Since you have the modem set to "DMZ" to your Asus all the inbound traffic should go to your router. You may want to set up a dynamic DNS service on your modem if the WAN IP is prone to change often.
A simpler way is to set up Teamviewer on an always on PC inside your LAN. If you have two wired network cards connect one to the Asus the other to the modem and you will be able to do remote control of the PC from wherever and manage either the modem or the router.

bb

I think I was not very clear in doubt.

The file .ovpn is configured correctly, I have access the internet from my workplace or at 4G (LTE).

The only problem is that I do not have access to the modem with the IP 192.168.25.1 using the VPN connection.

Any disposivito that is in the range of 192.168.1.X, I can access with VPN.

Locally have access to the modem, only externally not.

It would be possible to access the modem this setting?

-----------------------------------------------------------------------------------------------------
UPDATE

Resolved.

I read this topic and just did the setting as below , nothing else.

It is working perfectly.

I ask this good this way?

ASUS_Wireless_Router_RT_AC68_U_VPN_Server.png




 
Last edited:
Modem interface: you can do it through some custom iptable rules (no need to fiddle with vlans and what not).

This is based on this Wiki page for DD-RT:

http://www.dd-wrt.com/wiki/index.php/Access_To_Modem_Configuration

This can be adapted to Asuswrt-Merlin.

wan-start script:



(change 10.0.0.2 to be in your modem's subnet, i.e. if the modem is on 192.168.100.254, then use 192.168.100.2 instead)

nat-start script:



(those are backticks, NOT quotes BTW)

Check the Wiki on Github (see my signature) for more info on JFFS and custom user scripts under Asuswrt-Merlin.

I can't test it because I no longer use a DSL modem, but I used to have something similar here to access my modem's webui.

Let me know if this works as-is, so I can repost it on the Wiki. It's been too long since I've used that configuration, so I'm not 100% sure it's accurate.

WPS: the wps_monitor service only gets started if you have WPS enabled on the webui, so you should be safe if you keep it disabled.

Hi @RMerlin,
Or anyone else who knows the answer...
I'm in the process of setting up a new AX88U as my main router. I see from your wiki that wan-start has ben depricated by wan-event.
I have searched but can't find an obvious answer so I'll ask here.
Does your wan-start script need to be amended to work as a wan-event script?
Or does it just require renaming to wan-event?
Regards
Clive
 
@cliver As per the note in the wiki you would have to add conditional coding to the wan-event script that checks the event type in $2.

For example;
Code:
#!/bin/sh

logger -t "$(basename $0)" "$1" "$2"

if [ "$1" = "0" ] && [ "$2" = "connected" ]; then
   logger -t "$(basename $0)" "Adding interface"
   ifconfig $(nvram get wan0_ifname):0 192.168.100.2 netmask 255.255.255.0
elif [ "$1" = "0" ] && [ "$2" = "stopping" ]; then
   logger -t "$(basename $0)" "Deleting interface"
   ifconfig $(nvram get wan0_ifname):0 down
fi
 
@cliver As per the note in the wiki you would have to add conditional coding to the wan-event script that checks the event type in $2.

For example;
Code:
#!/bin/sh

logger -t "$(basename $0)" "$1" "$2"

if [ "$1" = "0" ] && [ "$2" = "connected" ]; then
   logger -t "$(basename $0)" "Adding interface"
   ifconfig $(nvram get wan0_ifname):0 192.168.100.2 netmask 255.255.255.0
elif [ "$1" = "0" ] && [ "$2" = "stopping" ]; then
   logger -t "$(basename $0)" "Deleting interface"
   ifconfig $(nvram get wan0_ifname):0 down
fi
Thanks Colin, I thought as much but couldn't be sure.
Out of interest does wan-start still work on later firmware?
 
It's still working for me on an RT-AX86U and 386.2_6. But why not just test it for yourself?
Just tried it and it does indeed still work on my RT-AX88u 386.2_6 as well.
 

Sign Up For SNBForums Daily Digest

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