my Ubuntu weblog

just my personal Ubuntu blog

A smart router administration tool

April 16th, 2009 · 3 Comments
Scripts

I developed a small program allowing you to administrate your UPnP router at work or at home. It can reconnect, print statistics, add a port mapping entry, remove one, print a list and clear the entire entry list.

The program depends on libnet-upnp-perl. So you first have to install it to use the script. The packet contains the Perl extension Net::UPnP which allows you to control UPnP devices in Perl.

sudo apt-get install libnet-upnp-perl -y

Now download the script and unpack it. Now you can open a terminal and navigate to the script’s directory. Make the script executable with this command:

chmod +x ./router.pl

You can use it. This one-liner reconnects your router’s internet connection.

./router.pl -r

If you have more then one UPnP device, the script will ask you for the right one. Instead of being asked every time executing the command, you can use the -d parameter followed by the device number.

./router.pl -r -d 0

You can add a port mapping entry with this:

./router.pl -a -e 1033 -I 192.168.0.5 -i 1033 -P TCP

This will add a port mapping entry mapping the external port 1033 to the IP address 192.168.0.5.

For further information, use the -h option.

Please write a comment after you executed this script. In this comment post your router’s model name, the command you executed and the program’s output so I can correct mistakes if there are any. Thanks.

.: Share
  • Digg
  • del.icio.us
  • Facebook
  • MySpace
  • YahooMyWeb
  • TwitThis
  • Yahoo! Buzz
  • StumbleUpon
  • Technorati



3 responses so far ↓

Leave a Comment