на VPS…
~# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.2 P-t-P:127.0.0.2 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:6433 errors:0 dropped:0 overruns:0 frame:0
TX packets:5702 errors:0 dropped:28 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:445424 (434.9 KiB) TX bytes:663221 (647.6 KiB)
venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:11.11.11.11 P-t-P:11.11.11.11 Bcast:11.11.11.11 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
пытаюсь настроить редирект всего трафика на порт VPS 8080(условно) на 80 порт дугого сервака в интеренте 195.27.31.252
~# echo "1" > /proc/sys/net/ipv4/ip_forward
~# iptables -t nat -A POSTROUTING -o venet0:0 -j MASQUERADE
~# iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to-destination 195.27.31.252:80
~# iptables -t nat -A PREROUTING -p udp --dport 8080 -j DNAT --to-destination 195.27.31.252:80
~# route add -host 195.27.31.252 dev venet0:0
в итоге имеем
~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
195.27.31.252 * 255.255.255.255 UH 0 0 0 venet0
default * 0.0.0.0 U 0 0 0 venet0
~# iptables-save
# Generated by iptables-save v1.4.21 on Wed Jun 5 00:13:51 2019
*nat
:PREROUTING ACCEPT [182:8756]
:POSTROUTING ACCEPT [1:71]
:OUTPUT ACCEPT [1:71]
-A PREROUTING -p tcp -m tcp --dport 8080 -j DNAT --to-destination 195.27.31.252:80
-A PREROUTING -p udp -m udp --dport 8080 -j DNAT --to-destination 195.27.31.252:80
-A POSTROUTING -o venet0:0 -j MASQUERADE
COMMIT
# Completed on Wed Jun 5 00:13:51 2019
# Generated by iptables-save v1.4.21 on Wed Jun 5 00:13:51 2019
*filter
:INPUT ACCEPT [1362:140055]
:FORWARD ACCEPT [1:52]
:OUTPUT ACCEPT [1279:178686]
COMMIT
# Completed on Wed Jun 5 00:13:51 2019
# Generated by iptables-save v1.4.21 on Wed Jun 5 00:13:51 2019
*mangle
:PREROUTING ACCEPT [1363:140107]
:INPUT ACCEPT [1362:140055]
:FORWARD ACCEPT [1:52]
:OUTPUT ACCEPT [1280:178766]
:POSTROUTING ACCEPT [1280:178738]
COMMIT
# Completed on Wed Jun 5 00:13:51 2019
# Generated by iptables-save v1.4.21 on Wed Jun 5 00:13:51 2019
*raw
:PREROUTING ACCEPT [1363:140107]
:OUTPUT ACCEPT [1280:178766]
COMMIT
# Completed on Wed Jun 5 00:13:51 2019
Есть идеи почему не работает?
Заранее спасибо.