[CentOS] DNAT Internet gate problem on centos

Andreas Benzler

andreas at benzlerweb.de
Sat Apr 1 08:10:45 UTC 2017


Hello Guys,

I got trouble to get vserver work as gate:

GATE=XX.XX.XX.XX

YY_PORT=YY

echo "1" > /proc/sys/net/ipv4/ip_forward

iptables -F -t nat

iptables -t nat -A PREROUTING -p tcp -i venet0:0 --dport $YY_PORT \
       -j DNAT --to-destination $GATE:$YY_PORT

iptables -t nat -A POSTROUTING -p tcp --dport $YY_PORT \
       -j MASQUERADE


iptables -L -t nat


Any suggestion? I got it in the past, but now I'm completely confused.

Thanks for help.

Sincerely

Andy





More information about the CentOS mailing list