-1

So I run a VPN business. When users want to port forward ports, I use DNAT.

Is it possible to make the ports automatically go open like upnp?

I've heard something that masquerade can do this.

1 Answer 1

2

Well, as you already named it, UPnP would do that. UPnP implementations for Linux which would modify iptables rules accordingly do exist but obviously UPnP needs applicaion support for the appropriate control requests. The Gentoo Wiki has a short howto for setting up linux-igd (the UPnP daemon implementation) to alter iptables rules.

As you might have noted, the important point about DNAT rules is to know where to DNAT to - the destination has to be explicitly stated. As there is no universal way to guess that, an automatic translation would be impossible unless you have found a different way of signaling the request - this is what UPnP is doing. A masquerade rule on the contrary is an SNAT-type rule, the address to use for the SNAT is determined by just taking the IP address of the outbound interface. Although this might be wrong for odd setups, for most use cases it works out quite fine.

2
  • You know any tutorial on how to install upnp, can't find much about it.
    – Niel
    Jan 2, 2013 at 1:14
  • @CloudVPN The Gentoo Wiki has a short howto for setting up linux-igd (the UPnP daemon implementation) to alter iptables rules.
    – the-wabbit
    Jan 2, 2013 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.