M
M
Michael Sne Bjorn Palagin2015-06-02 19:44:53
linux
Michael Sne Bjorn Palagin, 2015-06-02 19:44:53

Iptables on CentOS and how to properly port forward?

Hello toasters. I'm new to nix, so I ran into this problem :(
There is a server on the local network with IP 192.168. redirected to an internal address with the same port as I asked.Did today on
Cent OS this is the whole thing according to this article But I could not connect from the outside to the server using more than one protocol.Can anyone tell me what's wrong?
If you need more detailed information, you write what to give, otherwise I'm just getting into this topic.
Zyxel keenetic router, I don’t know, maybe it also needs to be indicated in it? And then when I enter an external IP address on the same local network, it throws me to the router settings page. And when I got home, I also entered this address, but it says to me that the page is not available :(
I tried to connect via SSH, FTP, but it says that it can’t :(
Thank you in advance...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jidckii, 2015-06-02
@ven000mus

iptables -t nat -A PREROUTING -p tcp -m tcp -d 5.189.*.* --dport 8080 -j DNAT --to-destination 192.168.77.2:80
iptables -t nat -A POSTROUTING -p tcp -m tcp -s 192.168.77.2 --sport 80 -j SNAT --to-source 5.189.*.*:8080

I forwarded it 1 port, 8080 respectively. You can specify a port group.

A
AntonMZ, 2015-06-02
@AntonMZ

show iptables -L

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question