Good afternoon. There is a VPS on debian somewhere on the Internet with IP IP_VPS with a single interface, and a server with an external IP IP_SERVER to which I want to redirect traffic coming to IP_VPS .
I'm trying to configure an iptables rule on a VPS like this:
iptables -t nat -A PREROUTING -p tcp --dst IP_VPS --dport 80 -j DNAT --to-destination IP_SERVER:80 but packets IP_SERVER not reach IP_SERVER (checked wireshark). I missed something or iptables basically does not work this way?
cat /proc/sys/net/ipv4/ip_forwardgive? should be1- Mike/etc/sysctl.confif there is one on your system, then you need to enable ip_forward there. If not, then somewhere in the download files writeecho 1 >/proc/sys/net/ipv4/ip_forwardwithout this, the machine will not send anywhere any packets that came to it (and were not born on it itself) - Mike/etc/sysctl.confwrites Permission denied, enabled viasudo sysctl -w net.ipv4.ip_forward=1In general, I read that ip_forward redirects packets from one interface to another, which means they should be at least 2 and one can not do? - M. Paul