09-15-2019, 02:07 PM
(09-15-2019, 08:20 AM)chanalku91 Wrote: Hello, I have a problem with port forwarding
I want to forward the connection from public zone port 22 to private zone port 2222 But I don't know why this command doesn't work
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 22 -j DNAT --to 170.0.0.1:2222
I have also activated port forward on sysctl
But the problems I experienced could not be solved by members of the Indonesian Linux forum
You created the routing rule, that's good. But you are missing a very important thing: by default forwarding is set to block the traffic. You need to enable the traffic.
We can imagine the forwarding as two rules:
- Forwarding rule to accept the traffic
- Routing rule to redirect the traffic
Code: (Select All)
iptables -A FORWARD -i eth0 -p tcp –dport 22 -j ACCEPT
This command is based on your original command, using eth0 and tcp protocol
Can you tell me how to creates terminal style images like you? I know carbon but I am unable to get html code
