Common firewall configuration methods for Linux Iptables

Source: Internet
Author: User
Article Title: common firewall configuration methods for Linux Iptables. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Common firewall configurations of Iptables

The script environment is eth0 Internet and eth1 intranet;

#! /Bin/sh

# Internet Nic

EXT_IF = "eth0"

FW_IP = "61.137.85.21"

# Intranet Nic

INT_IF = "eth1"

LAN_IP = "192.168.0.1"

LAN_IP_RANGE = "192.168.0.0/255.255.255.0"

# Reading module, which is generally built in

# Module loading.

# Echo "modprobe modules"

# Modprode ip_tables

# Modprode ip_nat_ftp

# Modprode ip_conntrack

# Modprobe ip_conntrack_ftp

# Enable the forward Function

Echo "enabling ip forwarding ...... "

Echo "1">;/proc/sys/net/ipv4/ip_forward

# Rule initialization. The default values are drop.

Echo "enabling iptables rules"

# Reset the default policies ies in the tables

Iptables-F

Iptables-X

Iptables-F-t mangle

Iptables-X-t mangle

Iptables-F-t nat

Iptables-X-t nat

Iptables-Z-t nat

# Set policies

Iptables-P INPUT DROP

Iptables-P FORWARD DROP

Iptables-P OUTPUT DROP

###--###

[1] [2] [3] [4] [5] Next page

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.