aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: open ports?  (Read 2521 times)

sijp

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 3
open ports?
« on: July 25, 2004, 08:59:56 PM »

Hi,

I have a lan with two computers (both run Linux Fedora1).
a pentium3 is accessing the internet through pentium4.

It seems that the p3 has a low ID.
how can I open the ports? (if that is realy what I should do...)

thanks,
sijp
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: open ports?
« Reply #1 on: July 26, 2004, 02:30:56 PM »

sijp,

I have not tested this, but must be something like this. Suppose your p3 has address 192.168.1.2. Then do this in your p4:

iptables -t nat -I PREROUTING -p tcp --dport 4662 -j DNAT --to-destination 192.168.1.2
iptables -t nat -I PREROUTING -p udp --dport 4665 -j DNAT --to-destination 192.168.1.2
iptables -t nat -I PREROUTING -p udp --dport 4672 -j DNAT --to-destination 192.168.1.2

4662:tcp, 4665:udp and 4672:udp are the ports that you configured amule to run with.

Notice that if you run p4 with redhat firewall configured, you have to do this too:

iptables -I RH-Firewall-1-INPUT -p tcp --dport 4662 -j ACCEPT
iptables -I RH-Firewall-1-INPUT -p udp --dport 4665 -j ACCEPT
iptables -I RH-Firewall-1-INPUT -p udp --dport 4672 -j ACCEPT

Try it and report any problems.

Cheers!
Logged

sijp

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 3
Re: open ports?
« Reply #2 on: July 27, 2004, 01:30:41 PM »

I thank you for your reply.
I am not sure if what I did was what you meant...

as much as I understood you were reffering /sbin/iptables so this is what I did:
I already have a file called rc.firewall which is executed by the file /etc/rc.d/rc.local which sets the iptables.
there I have set a variable called IPTABLES and set it to /sbin/iptables then I added to the file the following lines:

Code: [Select]
$IPTABLES -t nat -I PREROUTING -p tcp --dport 4662 -j DNAT --to-destination 192.168.1.2
$IPTABLES -t nat -I PREROUTING -p udp --dport 4665 -j DNAT --to-destination 192.168.1.2
$IPTABLES -t nat -I PREROUTING -p udp --dport 4672 -j DNAT --to-destination 192.168.1.2

$IPTABLES -I RH-Firewall-1-INPUT -p tcp --dport 4662 -j ACCEPT
$IPTABLES -I RH-Firewall-1-INPUT -p udp --dport 4665 -j ACCEPT
$IPTABLES -I RH-Firewall-1-INPUT -p udp --dport 4672 -j ACCEPT
the results were preventing both computers to access through this ports.
normally it takes less than a second to connect but now both computers act the same after activating those lines and do not seem to connect at all.

what did I do wrong?

many thanks
sijp
« Last Edit: July 27, 2004, 01:35:23 PM by sijp »
Logged

Jacobo221

  • Hero Member
  • *****
  • Karma: 3
  • Offline Offline
  • Posts: 2712
Re: open ports?
« Reply #3 on: July 27, 2004, 02:04:41 PM »

don't use those lines. instead, change the ports aMule is using on the p3 computer. (change them in Preferences).
Greetings!
Logged

sijp

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 3
Re: open ports?
« Reply #4 on: July 27, 2004, 02:56:58 PM »

how can I know to which ports I should change them?
on the p3 it is set to tcp:4662 udp:4672
« Last Edit: July 27, 2004, 03:01:38 PM by sijp »
Logged

Jacobo221

  • Hero Member
  • *****
  • Karma: 3
  • Offline Offline
  • Posts: 2712
Re: open ports?
« Reply #5 on: July 27, 2004, 03:41:01 PM »

switch to something different. Just that. You can't have two computers on the same LAN using the same ports.
So change, for example, TCP port to 20123 and UDP to 20321 ;-)
Greetings!
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: open ports?
« Reply #6 on: July 27, 2004, 03:57:33 PM »

sijp,

I did not understand that you wanted *both* computers to use amule. The setting i gave you is to be done in the p4, so that the computer *inside*, the p3 in your case, can have access to the ports. You can for example, change all the '4's to '7' and do the same change in amule prefs.

Like Jacobo said, you cant have both using the same ports, because one of them will forward ports for the other.

The first three lines are the port forwarding instructions, the second three lines are opening the firewall for the p3. if you want to use amule in p4 too, you will probably have to have other 3 lines for it.

But it seems to me that you were already using the p4 with amule. Do you get a high id with p4? If so, only the port forwarding lines will be necessary, but take care, because in this case you are on the internet without a firewall.

Any doubts, please ask, i know i have been a little confuse. :)

Cheers!
Logged