NAT configuration under iptables

Source: Internet
Author: User


In iptables, one NAT server can access the Internet, and the other server cannot access the Internet. However, if one of them is a Linux system, it will be easy. Configure iptables NAT. Step: 1. Set etc/sysctl. net. ipv4.ip. after forward = 0, change 0 to 1. 2. start iptables: # service iptables start www.2cto.com. 3. The most important step is: # iptables-t nat-a postrouting-o eth0-s 192.168.10.100/24-j SNAT-to Internet ip address 4. View nat-related iptables rules: # iptables-t nat -- list (pay attention to the POSTROUTING item) 5. Clear the filter and tables rules: # iptables-F # iptables-X 6. Then the operation is complete, set the ip address and CIDR block on the other server to match the preceding ip address and CIDR block. Author hxai11

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.