# [SOLVED]amule + upnp : how can I set iptables?

## magowiz

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 :

```
-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

----------

## luispa

I would suggest you install a log action as your penultimate action before DROP, look at mine: 

```
   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

----------

## magowiz

Thanks for the suggestion, I'll try it !

----------

## magowiz

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 :

```
-A INPUT -p udp -m udp -s <mine-router-ip> --sport 1900 -j ACCEPT
```

And it worked  :Wink: 

----------

## luispa

Great  :Wink: 

Luis

----------

