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!