Configure (K)torrent thru firewall-router

From openSUSE

HowTo Configure (K)torrent through a Router and Firewall protecting a Home Lan

Author: [Swerdna]

Background: I spent a long time stooging around the internet to discover this. I hope this HowTo saves some other new bee some of that time.

Summary:

Home Lans are usually behind routers which contain a DHCP server and a firewall. The server (in the router) supplies an ip address to each of the workstations on the Lan. You have to tell the router which computer is going to use a torrent, i.e what their IP addresses are. This is to allow communication between the computer and the torrent network on the internet. That often stumps new bees like me. I use Ktorrent but there's nothing special about that except that it's just great!

But first, if you're a new bee and you have a firewall in the router, maybe turn off SuseFirewall2 - Not even the forum Guru's seem to know how to let a home network through it. Also If you're an incensed Guru, for goodness sake please write a HowTo on it for us.

Next up you have to change DHCP addressing for the computer that will use Ktorrent to Fixed IP addressing. Here are the steps:

Find out your IP address parameters

Open a command shell, change to superuser and enter ip addr. The session looks like this:

ethel@suse101:~> su
Password:
suse101:/home/ethel # ip addr
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 50
    link/ether 00:13:d4:fe:36:59 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.100/24 brd 255.255.255.255 scope global eth0
    inet6 fe80::213:d4ff:fefe:3659/64 scope link 
       valid_lft forever preferred_lft forever

The IP address 192.168.2.100/24 tells us where to route the Ktorrent traffic from the router. It also tells us what the router's IP address (PROBABLY) is: it's the lowest possible in the range 192.168.2.x, i.e. the router is at 192.168.2.1

Find out what port-forwarding Ktorrent needs

Open Ktorrent from the Kmenu with these clicks: Kmenu --> internet --> data exchange --> Ktorrent. Then click settings --> configure Ktorrent. You'll see this:

Image:HowtoKtorrentOnAhomeLan_suse101-1.png

Note the dialog labelled Attention. If you are behind a firewall you need to make a passage through it for Ktorrent. You use network address translation [NAT] for that. Ktorrent should show you which ports to forward to your computer. Here they are 6881 (http) and 4444 (udp).

Change the (Ktorrent-using) computer to Fixed IP addressing

You can do this for all computers on the lan but you only need do it for those requiring port forwarding. Continuing with computer 192.168.2.100 as an example, open Yast and goto network devices --> network card. When you have the screen below, highlight the card as I have and edit it.


Image:HowtoKtorrentOnAhomeLan_suse101-4.png


You'll see on the screen that opens that it has Automatic Address Setup (via DHCP). Move the dot to Static Address Setup and enter an IP address that isn't taken. [If you're getting confused, look at the two pics just below then comeback here and read this paragraph again.] Since you previously had address 192.168.2.100 (or whatever) assigned by the DHCP server, you could enter that. Or since the server is choosing addresses near ...2.100 you might choose a lower one, say 192.168.2.2 and enter that. Whatever you choose, if it's not the previously assigned address ...2.100, test that it's free by pinging the chosen address in a console. I chose 192.168.2.2 instead of the DHCP-assigned address of 192.168.2.100

If you get this it's free:

ethel@suse101:~> ping 192.168.2.2 PING 192.168.2.2 (192.168.2.2) 56(84) bytes of data. From 192.168.2.100: icmp_seq=1 Destination Host Unreachable From 192.168.2.100 icmp_seq=2 Destination Host Unreachable From 192.168.2.100 icmp_seq=3 Destination Host Unreachable From 192.168.2.100 icmp_seq=4 Destination Host Unreachable

Here's an example of pinging an address that's been taken (in this case the router):

ethel@suse101:~> ping 192.168.2.1 PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data. 64 bytes from 192.168.2.1: icmp_seq=1 ttl=255 time=7.79 ms 64 bytes from 192.168.2.1: icmp_seq=2 ttl=255 time=0.628 ms 64 bytes from 192.168.2.1: icmp_seq=3 ttl=255 time=0.622 ms 64 bytes from 192.168.2.1: icmp_seq=4 ttl=255 time=0.661 ms

OK, you should end up with a screen like this:

Image:HowtoKtorrentOnAhomeLan_suse101-5.png


You now have to route through the external Router to the internet so click routing:

Image:HowtoKtorrentOnAhomeLan_suse101-6.png

Then use the OK and Next buttons to quit. You can test by by pinging your IP address in a console or by using `ip addr` again and by checking if your browser still connects to the internet..

Letting BitTorrent through the firewall in the router

You already know from the IP range you're using that the router is at 192.168.2.1 (or whatever you get/got). You can goto the router in your web browser and set it up. Enter 192.168.2.1 or whatever in the browser address bar, log in to the router and look for the tab that takes you to NAT routing. You'll get a screen like this wher I have entered and marked settings appropriate for this example computer:

Image:HowtoKtorrentOnAhomeLan_suse101-2.png

Of course, use whatever fixed IP address you have chosen instead of the one in my example. Note you enter the TCP (6881) and UDP (4444) ports that your computer tells you to in Ktorrent.

Download the DVD or CD's for Suse 10.1

I had to do/work out all the above before I could get 10.1 so that's why it's the example. Well you goto the opensuse web site and cruise around until you get to the 10.1 download page which I've linked here for you. The torrent links are at the bottom of that page. Click the DVD or CD link and save it in your torrents folder (You have to make one, anywhere in your home directory. The open Ktorrent, direct it to the file you downloaded and THAT's ALL FOLKS