3 Applications of Linux firewalls

Source: Internet
Author: User

Iptables this instruction, as shown in the following man query, it is used to filter packets and do NAT network address translation (network location translation), the application of a lot of this directive, can do many network application.

Iptables-administration tool for IPV4 packet filtering and NAT

Application 1: Let the computer in the area network share the bandwidth (real NAT) with a real IP

Schema diagram:

Required Equipment: One Linux server, 2 Web card

Network card 1:eth0, using real IP, network card 2:eth1, using 192.168.1.254

Setting: Write the following lines in/etc/rc.d/rc.local

  echo "1" > /proc/sys/net/ipv4/ip_forward
modprobe ip_tables
modprobe ip_nat_ftp
modprobe ip_conntrack
modprobe ip_conntrack_ftp
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.0/24 -j MASQUERADE

Application 2: Allow computers in the area network to share bandwidth (implemented NAT) with an ADSL

This example is similar to the previous example, just a certain setting to be modified

Schema diagram:

Required Equipment: One Linux server, 2 Web card

Network card 1:eth0, using real IP, network card 2:eth1, using 192.168.1.254

Setting: Write the following lines in/etc/rc.d/rc.local

  echo "1" > /proc/sys/net/ipv4/ip_forward
modprobe ip_tables
modprobe ip_nat_ftp
modprobe ip_conntrack
modprobe ip_conntrack_ftp
iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.1.0/24 -j MASQUERADE



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.