One of the two machines can access the Internet, and the other one cannot access the internet. if one of us is a Linux system, it will be easy. Configure iptablesNAT. Step: 1. set etc/sysctl. net. ipv4.ip. after forward0 is changed to 12, start iptables: # serviceiptablesstart3, the most important step: # iptables-one of the two machines can access the Internet, and the other one cannot access the Internet, if one of us is a Linux system, it will be easy.
Configuration Items IptablesNAT.
Step: 1. change the value 0 After net. ipv4.ip. forward = 0 in etc/sysctl. conf to 1.
2. start iptables: # service iptables start
3. the most important step: # iptables-t nat-a postrouting-oeth0-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 items)
5. clear filter and tables rules: # iptables-F
# Iptables-X
6. after that, you can set the ip address and CIDR block on the other server to conform to the preceding settings.
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