aMule Forum
English => aMule Help => Topic started by: sijp 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
-
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!
-
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:
$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
-
don't use those lines. instead, change the ports aMule is using on the p3 computer. (change them in Preferences).
Greetings!
-
how can I know to which ports I should change them?
on the p3 it is set to tcp:4662 udp:4672
-
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!
-
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!