1

I need to nat an entire subnet from one range to another when connecting to openvpn server(Qnap nas). I found a way that works using iptables netmap.

iptables -t nat -A PREROUTING -d 10.8.0.0/24 -j NETMAP --to 192.168.1.0/24

The problem is that qnap Nas seems not to have netmap support. I need to know the way to NAT the network using only common nat options(snat, dnat or masquerade).

Abraham
  • 63
  • 1
  • 1
  • 13
  • From what I can see, NETMAP was added to remove the necessity to define individual NAT rules for each one-to-one IP address mapping. Since QNAP does not support this, your only option here is to create each one-to-one mapping using SNAT/DNAT rules (no doubt, a very tedious and monotonous process, unless you can script it?) – parkamark Sep 06 '17 at 10:44
  • Thanks for helping. Have you an example about how one single ip can be nated in the same way as the netmap does? – Abraham Sep 06 '17 at 11:00
  • I think it will be something like this: `iptables -t nat -A PREROUTING -d 10.8.0.x -j DNAT --to 192.168.1.x` (replace `x` as appropriate). – parkamark Sep 06 '17 at 11:23

0 Answers0