I searched high and low unsuccessfully for instructions on how to set the link speed and/or duplex on one of the ports of an ASUS router (in my case, the RT-N66U, though I think other ASUS routers behave similarly). Once I had already figured out the answer on my own, I was able to find the instructions buried on various forum threads, but that only worked once I knew the command to run so I could search for that particular command. That’s not much of a help ;-), so I’m posting the answer here, in the hope that this page will show up more prominently the next time someone else searches for the answer to this question.
This is a three-step process:
- Enable the telnet port on the router so you can get access to its command line.
- Use the “robocfg” command on the command line to configure the port the way you want it.
- Put a script on a USB thumb drive so that the port configuration can be persisted across router reboots.
Note that of these three steps, the last one is the only mandatory one, for reasons that will become clear. However, the first two steps are useful for finding the right robocfg command and making sure it works before putting it into a script on a thumb drive, so I’ll explain all of them.
Enable the telnet port
In the router’s web UI:
- click on “Administration” under “Advanced Settings” on the left;
- click on the “System” tab at the top;
- next to “Enable Telnet”, select “yes”; and
- click the “Apply” button.
Use “robocfg” from the command line
- Telnet to the LAN IP address of the router, and log in with the same username and password you use to log into the web UI.
- Run “robocfg show” to list all the router’s ports.
- Figure out which port you want to configure by finding the correct MAC address in the port list.
- Run “robocfg port port-number media speed-duplex” to change the port configuration from automatic to pinned at the config you specify. For “speed-duplex“, specify “10”, “100”, or “1000” for the speed, followed by “HD” or “FD” for the duplex. For example, “robocfg port 1 media 1000FD” to configure port 1 for full-duplex gigabit ethernet.
- Run “robocfg show” again to confirm that the port is configured the way you want it to be.
You can run “robocfg help” for more information about what robocfg can do.
Persist the change across reboots
H/t to Darell Tan for showing me how to do this!
- Get yourself a USB thumb drive.
- Create a directory called “asusware” on the drive.
- Create an executable file called “.asusrouter” within the “asusware” directory and put this in it:
#!/bin/sh i=0 while [ $i -le 20 ]; do success_start_service=`nvram get success_start_service` if [ "$success_start_service" == "1" ]; then break fi i=$(($i+1)) echo "autorun APP: wait $i seconds..."; sleep 1 done [insert commands that you want to run on boot here, e.g., a robocfg command as shown above]
- Plug the thumb drive into your router.
As I noted above, this thumb drive trick is actually all you need to do if you already know the robocfg command you need to run. As soon as you plug the thumb drive in, the script you created will be executed, and it’ll be executed from then on every time the router reboots.
Please post a comment if you found this posting useful!
Pingback: RT-AC86U - Configurar Ethernet - configurar-router.info
Thanks for putting this together. I have the RT-AC66U B1 running stock Firmware Version:18.104.22.168.386_46065.
The command works when I SSH into the router. This router has one WAN and 4 LAN ports. When I run the command, I get the following: Switch: enabled
Port 0: 1000FD enabled stp: none vlan: 2 jumbo: off mac: XX:01:5c:8b:6c:26
Port 1: 1000FD enabled stp: none vlan: 1 jumbo: off mac: XX:27:eb:ee:96:d2
Port 2: DOWN enabled stp: none vlan: 1 jumbo: off mac: XX:00:00:00:00:00
Port 3: 100FD enabled stp: none vlan: 1 jumbo: off mac: XX:4a:26:bd:42:ac
Port 4: 1000FD enabled stp: none vlan: 1 jumbo: off mac: XX:a6:37:bb:26:3e
Port 5: 1000FD enabled stp: none vlan: 2 jumbo: off mac: XX:5d:63:87:71:98
Port 7: DOWN enabled stp: none vlan: 1 jumbo: off mac: XX:00:00:00:00:00
Port 8: DOWN enabled stp: none vlan: 1 jumbo: off mac: XX:00:00:00:00:00
VLANs: BCM5301x enabled mac_check mac_hash
1: vlan1: 1 2 3 4 5t
2: vlan2: 0 5
Q1: I am not sure why I see ports 5,7,8 ? any ideas?
Q2: noticed the VLAN at the bottom. Is there a command to be able to segment the ports on Stock? nothing in the GUI.
I do not need to change the speed of any of my ports. but have another issue and was wondering if I could use the script to force the router to set the time at bootup. for some reason the router will not sync with pool.ntp.org or google’s time server
need to manually SSH in and run the command ntpclient -h pool.ntp.org -s
Is there a non volatile area on the Router that this script can be saved and would run after reboot?
Sorry I am a complete newbie and will need detailed instructions for most steps.
Hey. i have a asus ac5300 and i did this robocfg and after a reboot the port i had selected to 1000 was 1000.
but i wanna have a usb inserted, but how can i make a exe file and what is the correct commandlist?
please i wanna have my ports 1234 all be inn 1000 what would the script look like and how can i make it??
robocfg will not work it will disable your nic.
Result you cannot change the duplex settings, well let me tell asus does it for me problems was happening after I had another ISP cable modem docsis 3.1 in my network
auto-negotiation returns in warnings in wireshark duplex mismatch errors ohh and no logs to see in asus hmm :s
Same like other persons mention it idle will change suddenly from duplex settings
No matter what I do putting a switch between no change
So for me i would not by anymore crap like asus it says its opensource my ass and a simple auto-negotiation will fail as for a network-device it’s a no go
There just selling numbers
Thanks for this post. Using this utility, I was able to find a link that would not come up at 1000Mb/s. It turns out it was a 2-pair cable, and I never noticed it! The cable that comes with an Xbox 360 apparently was only 2-pair and this limited my connection to 100Mb/s when I re-used this cable to connect a switch off of my Asus router.
I have an known issue with the RT-AC68U that the WAN port auto negotiation default too 100mbit 9 out of 10 times.
so my 200 mbit connection tops out at about 96mbit
Have all Cat5e certified (good brand) Cables and the same setup worked fine before, was getting close to 18 MB/s
Tried your HOWTO through telnet and after the forcing to 1000mbit FD on the WAN port the connection just goes down. (rechecked with robocfg and it says down, router says no internet cable plugged in)
I have no option to replace all the cables with cat6 (which seemed to fix the issue for some) seeing its an old house with terrible accessability to the wires, still this should work just fine.
Same issue here. Cannot successfully auto-negotiate to 1000FD. Very frustrating as direct connection to cable modem from desktop results in 1000FD every time. Has anyone found a solution?
Has anyone found out what is going on with this routers? I have been looking finding lots with the problem and know knows how to fix it. I one person contacted Asus CS and they had no idea and recommended a RMA. IDK if this will help you but I get the same problem when I hook my source ethernet cable to a unmanaged switch. It is locked at 100 up 100 down. which is 1/3 of what i should be getting. So can it be an issue with the ISP? and not the router?
In my case the cable was not able to do 1000Mb/s, as it was a 2-pair cable. It may also be the case that there is damage to the cabling and there is a lack of continuity on one or more pins, or the quality of the signal is marginal and there are errors at 1000Mb/s, but not when run at 100Mb/s.
Replacing cables, if possible, would be the best thing to try first.
I believe this issue is either hardware or firmware related, but I’m not willing to go downgrade and test whether there was a firmware regression recently. I have two similar Asus routers, the cheap AC1200G from my ISP, one running as the main router connected to my gateway, and the other as an access point for extra ethernet ports and wireless. Both routers would initially connect at 1Gb, but I’ve noticed that after some period of low activity, the routers will auto-negotiate down to 100Mb quietly on its own.
If I were to try and generate heavy traffic by starting up a couple of bittorrent connections, unplugging the second router before allowing auto-negotiation to take place, it will reconnect at 1Gb and stay that way for several hours without dropping. Stop all downloads, let the connections idle, and I’m back to the same problem again. This tells me there is no issue with the cables whatsoever, and the problem lies within the routers themselves. It is very frustrating too, since I’m unable to manually set the speeds with robocfg.
hello, i am trying to create the startup scrip using windows environment, but is not working for me.
So pretty much i have created a folder: asusware
Inside this folder i created a file named: .asusrouter.sh
and inside this file the following script:
while [ $i -le 20 ]; do
success_start_service=`nvram get success_start_service`
if [ “$success_start_service” == “1” ]; then
echo “autorun APP: wait $i seconds…”
robocfg port 0 media 100FD
I don’t know what else to do can someone please help me on this.
If you created the files on windows there are probably carriage returns at the ends of lines, and that’s probably confusing the shell interpreter on the router. Make sure the line endings in the file are just LF, not CRLF.
I am using Asus RT-AC68U. I cannot find the command “robocfg”. It returned “-sh: robocfg: not found” . Is there any similar command in my router? Thanks.
I don’t know how to do it for the RT-AC68U.
I’m using the Asus RT-AC68U and the robocfg command works for me. The executable is in /usr/sbin/robocfg. I’m using firmware 22.214.171.124.380_2695-g1b222cd and I don’t remember adding robocfg or anything like that to the router. I suppose it is possible that I have made a modification at some point that added the command, though I don’t recall doing so.