Forward the port XX that accesses the local machine to the port vi/etc/sysctl of other machines. net. ipv4.ip _ forward = 1 the default value is 0. in this way, iptalbesFORWARD is allowed. I modified the file directly: sudovi/etc/sysconfig/iptables.
Forward the port XX that accesses the local machine to the port of another machine.
Net. ipv4.ip _ forward = 1 in the vi/etc/sysctl. conf configuration file. the default value is 0, which allows iptalbes FORWARD
I directly edited the file and changed it:Sudo vi/etc/sysconfig/iptables
[Plain]View plaincopyprint?
- # Generated by iptables-save v1.4.7 on Sat MaR1 17:49:09 2014
- * Nat
- : Prerouting accept [0: 0]
- : Postrouting accept [0: 0]
- : Output accept [0: 0]
- -A prerouting-p tcp-m tcp -- dport 8012-j DNAT -- to-destination 192.168.1.253: 8012
- -A postrouting-p tcp-m tcp -- dport 8012-j MASQUERADE
- -A prerouting-p tcp-m tcp -- dport 8000-j DNAT -- to-destination 192.168.1.253: 8000
- -A postrouting-p tcp-m tcp -- dport 8000-j MASQUERADE
- -A prerouting-p tcp-m tcp -- dport 8003-j DNAT -- to-destination 192.168.1.253: 8003
- -A postrouting-p tcp-m tcp -- dport 8003-j MASQUERADE
- -A prerouting-p tcp-m tcp -- dport 8009-j DNAT -- to-destination 192.168.1.253: 8009
- -A postrouting-p tcp-m tcp -- dport 8009-j MASQUERADE
- -A prerouting-p tcp-m tcp -- dport 8880-j DNAT -- to-destination 192.168.1.253: 8880
- -A postrouting-p tcp-m tcp -- dport 8880-j MASQUERADE
- -A prerouting-p tcp-m tcp -- dport 8010-j DNAT -- to-destination 192.168.1.253: 8010
- -A postrouting-p tcp-m tcp -- dport 8010-j MASQUERADE
- -A prerouting-p tcp-m tcp -- dport 8443-j DNAT -- to-destination 192.168.1.253: 8443
- -A postrouting-p tcp-m tcp -- dport 8443-j MASQUERADE
- -A prerouting-p tcp-m tcp -- dport 8090-j DNAT -- to-destination 192.168.1.244: 8090
- -A postrouting-p tcp-m tcp -- dport 8090-j MASQUERADE
- -A prerouting-p tcp-m tcp -- dport 8080-j DNAT -- to-destination 192.168.1.244: 8080
- -A postrouting-p tcp-m tcp -- dport 8080-j MASQUERADE
- COMMIT
- # Completed on Sat Mar 1 17:49:09 2014