root@me:~# iptables -t nat -nvL
Chain PREROUTING (policy ACCEPT 426 packets, 50643 bytes)
pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 2 packets, 228 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
5880 605K SNAT all -- * * 10.8.0.0/24 !10.8.0.0/24 to:83.217.214.19
0 0 MASQUERADE all -- * eth0 10.8.0.0/24 0.0.0.0/0
0 0 SNAT all -- * * 10.8.0.0/24 0.0.0.0/0 to:37.252.121.240
root@me:~# ifconfig
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 37.252.121.240 netmask 255.255.255.0 broadcast 37.252.127.255
inet6 2a02:2770:9:0:21a:4aff:fe43:99d4 prefixlen 64 scopeid 0x0<global>
inet6 fe80::21a:4aff:fe43:99d4 prefixlen 64 scopeid 0x20<link>
ether 00:1a:4a:43:99:d4 txqueuelen 1000 (Ethernet)
RX packets 52083 bytes 32620895 (31.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 35654 bytes 4497158 (4.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 162 bytes 13038 (12.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 162 bytes 13038 (12.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.8.0.1 netmask 255.255.255.0 destination 10.8.0.1
inet6 fe80::9806:4123:a1c1:42f9 prefixlen 64 scopeid 0x20<link>
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC)
RX packets 6480 bytes 495896 (484.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 33 bytes 1608 (1.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
root@me:~# cat /etc/rc.local
#!/bin/sh -e
iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -I FORWARD -s 10.8.0.0/24 -j ACCEPT
iptables -I INPUT -p udp --dport 1194 -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to <внешний-ип-моего-сервера>