CentOS 6.5 Mini Firewall NAT configuration after installation

Source: Internet
Author: User
Tags iptables


Configuration information:
External Network network card: Eth0 1.1.1.1
Intranet network card: Eth1 192.168.10.1

Configuration steps:
1. Turn on the system default Ip_forward forwarding.
Echo 1 </proc/sys/net/ipv4/ip_forward
Or: vi/etc/sysctl.conf
Modify Net.ipv4.ip_forward = 1
Save exit, execute sysctl-p to make it effective.

2. Configure NAT and address camouflage;
Iptables-a Postrouting-o eth0
Or only allow intranet 192.168.10.0/24 network segment access to the extranet
Iptables-t nat-a postrouting-s 192.168.10.0/24-o eth0-j Masquerade

3, check the default configuration of the filter.
Iptables-t Filter-l–line-number
You will find that there is a reject in the forward chain of the filter table, that is, this rule causes the failure to ping.
Iptables-t filter-d FORWARD 1

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.