CentOS6.5 port forwarding

Source: Internet
Author: User
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?
  1. # Generated by iptables-save v1.4.7 on Sat MaR1 17:49:09 2014
  2. * Nat
  3. : Prerouting accept [0: 0]
  4. : Postrouting accept [0: 0]
  5. : Output accept [0: 0]
  6. -A prerouting-p tcp-m tcp -- dport 8012-j DNAT -- to-destination 192.168.1.253: 8012
  7. -A postrouting-p tcp-m tcp -- dport 8012-j MASQUERADE
  8. -A prerouting-p tcp-m tcp -- dport 8000-j DNAT -- to-destination 192.168.1.253: 8000
  9. -A postrouting-p tcp-m tcp -- dport 8000-j MASQUERADE
  10. -A prerouting-p tcp-m tcp -- dport 8003-j DNAT -- to-destination 192.168.1.253: 8003
  11. -A postrouting-p tcp-m tcp -- dport 8003-j MASQUERADE
  12. -A prerouting-p tcp-m tcp -- dport 8009-j DNAT -- to-destination 192.168.1.253: 8009
  13. -A postrouting-p tcp-m tcp -- dport 8009-j MASQUERADE
  14. -A prerouting-p tcp-m tcp -- dport 8880-j DNAT -- to-destination 192.168.1.253: 8880
  15. -A postrouting-p tcp-m tcp -- dport 8880-j MASQUERADE
  16. -A prerouting-p tcp-m tcp -- dport 8010-j DNAT -- to-destination 192.168.1.253: 8010
  17. -A postrouting-p tcp-m tcp -- dport 8010-j MASQUERADE
  18. -A prerouting-p tcp-m tcp -- dport 8443-j DNAT -- to-destination 192.168.1.253: 8443
  19. -A postrouting-p tcp-m tcp -- dport 8443-j MASQUERADE
  20. -A prerouting-p tcp-m tcp -- dport 8090-j DNAT -- to-destination 192.168.1.244: 8090
  21. -A postrouting-p tcp-m tcp -- dport 8090-j MASQUERADE
  22. -A prerouting-p tcp-m tcp -- dport 8080-j DNAT -- to-destination 192.168.1.244: 8080
  23. -A postrouting-p tcp-m tcp -- dport 8080-j MASQUERADE
  24. COMMIT
  25. # Completed on Sat Mar 1 17:49:09 2014

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.