MiniUPNPd patched for routed network - Printable Version

+- (
+-- Forum: My creations (
+--- Forum: Other (
+--- Thread: MiniUPNPd patched for routed network (/thread-156.html)

MiniUPNPd patched for routed network - Ashus - 18.3.2014

If you have tried to forward UDP packets of UPNP (dynamic NAT port forwarding) to another network (you may have NAT further away from you), you need a little workaround for miniupnpd server to accept addresses that are not bound to any interface. The message in debug reads following: miniupnpd[3605]: get_lan_for_peer(): not found !

Let's say we have main router A, that NATs traffic of clients at A and router B. Router A also shapes traffic, so we can't use NAT on B natively and just forward everything to A. We need to forward UPNP and nat-PMP requests from clients of B to the router A. Clients of A have IP range, clients of B The router A has IP and on p2p link with B. Router B has IPs and on p2p link with A.

Getting NAT-PMP to work is really easy, only one line is required in the firewall of B:
# NAT-PMP relay
iptables -t nat -A PREROUTING -i eth0 -p udp -d --dport 5351 -j DNAT --to-destination

To route multicast traffic, you need to use smcroute on B. Configuration must be done per-IP:
[code]function smcroute_ip {
    smcroute -a "$2" "$1" wlan0

smcroute -a wlan0 eth0

for (( i = 2 ; i