View previous topic :: View next topic |
Author |
Message |
magowiz Veteran
Joined: 17 Feb 2005 Posts: 1029 Location: Italy/Milan/Bresso
|
Posted: Fri Nov 20, 2009 2:50 pm Post subject: [SOLVED]amule + upnp : how can I set iptables? |
|
|
Hi,
I recently bought a router and it supports upnp so I thought to use upnp with amule to auto-open needed ports, all works well when iptables is stopped but if iptables is running , amule fails to use upnp.
I read in amule settings that upnp port is 50000 so I added to mine iptables this rule :
Code: | -A INPUT -p udp -m udp --dport 50000 -j ACCEPT |
but it didn't work .
How can I discover which ports are needed to make amule+upnp works without problems ?
Last edited by magowiz on Sat Nov 21, 2009 7:31 am; edited 1 time in total |
|
Back to top |
|
|
luispa Guru
Joined: 17 Mar 2006 Posts: 359 Location: España
|
Posted: Sat Nov 21, 2009 6:52 am Post subject: |
|
|
I would suggest you install a log action as your penultimate action before DROP, look at mine:
Code: | iptables -N log
iptables -A INPUT -j log
iptables -A FORWARD -j log
iptables -A OUTPUT -j log
iptables -A log -j LOG --log-level info --log-prefix "log -- DROP "
iptables -A log -j DROP
|
Then monitor your syslog and find which packets are being dropped
Luis |
|
Back to top |
|
|
magowiz Veteran
Joined: 17 Feb 2005 Posts: 1029 Location: Italy/Milan/Bresso
|
Posted: Sat Nov 21, 2009 6:54 am Post subject: |
|
|
Thanks for the suggestion, I'll try it ! |
|
Back to top |
|
|
magowiz Veteran
Joined: 17 Feb 2005 Posts: 1029 Location: Italy/Milan/Bresso
|
Posted: Sat Nov 21, 2009 7:31 am Post subject: |
|
|
Thanks to your suggestion I found which rule I have to add to iptables to let upnp pass ,
I found that mine router responds to upnp requests using its port 1900 but mine host change port every time, so I added a rule that accepts all packets from mine router IP and port 1900 udp , like this :
Code: | -A INPUT -p udp -m udp -s <mine-router-ip> --sport 1900 -j ACCEPT |
And it worked |
|
Back to top |
|
|
luispa Guru
Joined: 17 Mar 2006 Posts: 359 Location: España
|
Posted: Sat Nov 21, 2009 7:33 am Post subject: |
|
|
Great
Luis |
|
Back to top |
|
|
|