Hi to all:
I'm trying to redirect one port (8082) to another port (8080) in the same server, I'm putting this rule in the /etc/sysconfig/iptables file:
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 8082 -j REDIRECT --to-port 8080
And when I'm going to restart the iptables service, the system shows me this message:
iptables-restore v1.2.11: Line 49 seems to have a -t table option.
Error occurred at line: 49
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
[FAILED]
What's wrong ? How can I do fix it ?
Redirecting Port Failure
Re: Redirecting Port Failure
Hi to all:
I've found the answer here: http://oceanpark.com/notes/firewall_example.html
The solution is to add to the /etc/sysconfig/iptables file:
*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A PREROUTING -i eth0 -p tcp -m tcp --dport 8082 -j REDIRECT --to-port 8080
COMMIT
Thanks for your interest. Until next time.
I've found the answer here: http://oceanpark.com/notes/firewall_example.html
The solution is to add to the /etc/sysconfig/iptables file:
*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A PREROUTING -i eth0 -p tcp -m tcp --dport 8082 -j REDIRECT --to-port 8080
COMMIT
Thanks for your interest. Until next time.