Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

MiniUPNPd patched for routed network
#1

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(): 192.168.5.25:1900 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 192.168.1.0/24, clients of B 192.168.5.0/24. The router A has IP 192.168.1.1 and 192.168.2.1 on p2p link with B. Router B has IPs 192.168.5.1 and 192.168.2.2 on p2p link with A.

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


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" 239.255.255.250 wlan0
}

smcroute -a wlan0 192.168.2.1 239.255.255.250 eth0

for (( i = 2 ; i 


Attached Files
.tgz miniupnpd-1.8.20140523-ashus.tgz Size: 190,68 KB  Downloads: 3

[Image: kavove-zrnka-lajna.jpg]
Coffee phreak!
Reply
#2

Must say, engaging with Aerocity Escorts Agency can sometimes lead to fascinating conversations!
Reply
#3

A simple solution for the miniupnpd server to be able to receive addresses.
Reply




Users browsing this thread: 1 Guest(s)