I am trying to setup a openvpn server for group of people but I have problem with configuring iptables rules.
the box have 5 Dedicated IP address and I want to use one of ips that is not the default outgoing ip address also I want to limit open ports on vpn to ( 80 443 53 ... ) and block the rest.
openvpn client ip range is : 10.1.8.2 - 10.1.8.255
openvpn server ip : 10.1.8.1
outgoing ip address : a.b.c.d ( real ip )
allowed ports : 80 443 53 21
after a lot of researching i found following command that could work for me ?:
iptables -t nat -A PREROUTING -p TCP -m multiport --dports 21,53,80,443 -m iprange --src-range 10.1.8.2-10.1.8.255 -j DNAT --to-destination A.B.C.D
The main problem is iptables is forwarding all traffic from all ips / ports but I want to define iprange and ports manually and block the reset traffic request from openvpn clients ...