aMule Forum

Italian => Aiuto su aMule => Topic started by: ryosaeb4 on October 07, 2006, 03:21:37 PM

Title: Fare il redirect della porta TCP 4662
Post by: ryosaeb4 on October 07, 2006, 03:21:37 PM
scusate

Ho un problerma...

Ho tra il mio macintosh e il modem una box Linux... Non riesco a fare il redirect della porta TCP 4662 all'ip della mia macchina... come posso fare?

Dovrei aprire la porta altrimenti mi viene assegnato sempre un ID low...

grazie
Title: RE: Fare il redirect della porta TCP 4662
Post by: Truzzone on October 08, 2006, 12:34:13 PM
Devi impostare tre regole nel firewall del pc linux (iptables) per le tre porte che usa aMule:
Quote
TCP 4662
UDP 4672
UDP 4665
Per esempio con queste regole:
Quote
# First we flush our current rules
iptables -F
iptables -t nat -F

# Then we lock our services so they only work from the LAN
iptables -I INPUT 1 -i eth1 -j ACCEPT
iptables -I INPUT 1 -i lo -j ACCEPT
iptables -A INPUT -p UDP --dport bootps -i ! eth1 -j REJECT
iptables -A INPUT -p UDP --dport domain -i ! eth1 -j REJECT

# Drop TCP / UDP packets to privileged ports
iptables -A INPUT -p TCP -i ! eth1 -d 0/0 --dport 0:1023 -j DROP
iptables -A INPUT -p UDP -i ! eth1 -d 0/0 --dport 0:1023 -j DROP

# Finally we add the rules for NAT
iptables -I FORWARD -i eth1 -d 192.168.1.0/255.255.255.0 -j DROP
iptables -A FORWARD -i eth1 -s 192.168.1.0/255.255.255.0 -j ACCEPT
iptables -A FORWARD -i eth0 -d 192.168.0.0/255.255.255.0 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

# aMule forwarding to an internal host
iptables -t nat -A PREROUTING -p tcp --dport 4662 -i eth0 -j DNAT --to 192.168.1.2
iptables -t nat -A PREROUTING -p udp --dport 4672 -i eth0 -j DNAT --to 192.168.1.2
iptables -t nat -A PREROUTING -p udp --dport 4665 -i eth0 -j DNAT --to 192.168.1.2
Dove eth0 è la scheda di rete dove è collegato il modem adsl, eth1 è la scheda di rete dove è collegata la tue rete locale e 192.168.1.2 è l'ip del pc/mac dove gira aMule  ;)

Ciao by Truzzone  :)