<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d23884446\x26blogName\x3dJust+Another+Tech+Blog\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dSILVER\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://justanothertechblog.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://justanothertechblog.blogspot.com/\x26vt\x3d-8342903261382138056', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Just Another Tech Blog

Anything and everything having to do with technology, computers, science, and most of all... Linux! The documentation of my Linux endeavor.



Azureus and Ubuntu

Tuesday, January 16, 2007

I am quite a fan of torrents, and Azureus has been my top choice as a BitTorrent client for a while. However, when I switched my OS to Ubuntu, I started having problems with NAT. Turns out, this is quite typical for Ubuntu users. This is because all ports are locked by default under Ubuntu. So, I decided to throw together a guide to resolving all your NAT errors. These instructions come mainly from the Azureus wiki, but I thought I'd make them available here.
  1. To start with, we need to open a port that Azureus can use. To do this, issue the following commands:

    iptables -I INPUT -p tcp --dport < your_port_number > -j ACCEPT
    iptables -I INPUT -p udp --dport < your_port_number > -j ACCEPT

    Replace the your_port_number with a number between 49125-65535.

  2. Next, we must apply these changes. Create a new file called "iptables_azureus":

    sudo gedit /etc/init.d/iptables_azureus
    Insert the following into the new file:

    (sleep 220
    /sbin/iptables -I INPUT -p tcp --dport -j ACCEPT
    /sbin/iptables -I INPUT -p udp --dport -j ACCEPT ) &

  3. Next, we must make the new file executable:

    chmod +x /etc/init.d/iptables_azureus

  4. Now, we can link this into the startup sequence:

    update-rc.d iptables_azureus start 51 S .
This should work for most setups. But, if you are behind a router, like I am, then you will need to do some router configuration. The steps described below are for a Linksys WRT54G router (default firmware, v4.20.6), but the concepts behind each step apply to most every router.
  1. Enter your routers IP address into the address field of your router. For most, this will be http://192.168.1.1/ . Enter your username and password.
  2. Click on the tab "Applications and Gaming." Here, we can configure the router to open the port (chosen above) to Azureus, and other Bittorent apps pointed at that port.
  3. Under "Application Name" enter something like "Bittorent." What you name it doesn't matter! This is only for reference.
  4. Next, enter a port range which contains the port you selected above. In my case, I simply used the range 49125-65535. You may want to enter a smaller range.
  5. Under protocol, make sure "TCP" is selected.
  6. Enter the last digits of your IP. This can be found out by running ifconfig as root:

    sudo ifconfig
    Look at the IP given, and take the digits behind the last decimal (.).
  7. Be sure to have the "Enable" box checked.
  8. Choose "Save Settings"
Now, run the NAT/ Firewall test in Azureus using the port you selected and you should get a message saying OK! Or something positive like that. Congratulations! You are now finished. Enjoy downloading your torrents at optimum settings!

Reference:
Azureus Wiki: NAT Problem
Azureus Wiki: Router configuration

UPDATE: This will most likely NOT work on computers with a dynamic IP! I'll see about writing something on how to configure a static IP.
posted by linnerd40, Tuesday, January 16, 2007


4 Comments:

Thanx man !!!!
It worked....
:)

commented by Blogger shouvik, 11:24 PM  

Excellent!

commented by Anonymous alecthunder, 4:06 PM  

As for computers that are behind a router and on DHCP, usually you can setup the router to give a certain MAC address the same local IP address... at least that is what I did.

commented by Blogger Raven, 4:12 PM  

You should put the UPDATE warning a little lower, then i wouldnt have seen it at all...

commented by Blogger Ward, 2:14 PM  

Add a comment