To have multiple public ips on my home connection, i rent a VPS with few IPs, i've set a openvpn server and all the servers at my home which need a public ip, have a vpn connection and i'm doing DNAT/SNAT on the VPS to redirect the traffic destined to a specific public ip to my home server trough openvpn.
-A PREROUTING -d xxx.xxx.xxx.xxx/32 -j DNAT --to-destination 172.17.0.6 -A POSTROUTING -s 172.17.0.6/32 -j SNAT --to-source xxx.xxx.xxx.xxx
It work like that for more than one year on a mail server/web/ect.., it's pretty cool
I just have one issue, the incoming packet on my server is natted with the VPN server ip so i can't use access lists based on the ip, neither RBL on mail server.
Is there a way to tell iptable to redirect the traffic without doing the NAT ?
On my client, the default gateway is my vpn server so the packet will come back on the vpn in any way.