Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
sudo iptables -F
sudo iptables -t nat -F
sudo iptables -t mangle -F
sudo iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 63001 -j DNAT --to-destination 10.0.3.10:3306
sudo iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 64001 -j DNAT --to-destination 10.0.3.10:6379
sudo iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 63101 -j DNAT --to-destination 10.0.3.20:3306
sudo iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 64101 -j DNAT --to-destination 10.0.3.20:6379
sudo iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 60050 -j DNAT --to-destination 10.0.3.50:5044
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

...

Code Block
sudo iptables -S

Delete all existing rulesor

Code Block
sudo iptables -t nat -L --line-Fnumbers



Delete all existing rulesTo save iptables and automatically reload after rebooting

Code Block
sudo systemctl disable firewalld
sudo yum install iptables-service
sudo systemctl enable iptables
sudo service iptables saveiptables -F