Iptables firewall, iptables1 Location
Use vim/usr/sysconfig/iptables2. Start, close, and save
Service iptables stop
Service iptables start
Service iptables restart
Service iptables save
3 Structure
Iptables-> tables-> ch
Iptables basic CommandsBefore we introduce the complex firewall rules, let's start with some simple materials, so that we can have some simple understanding of Iptables's most basic commands.The first thing to note is that the iptables command must run as root, which means you need to log in as root or have permission to use Su or sudo-i to get the root Shell. We use sudo in the following, which is also the
and ACK tokens that are set while the SYN tag is not set, and note the comparison with example 1.3.3 Explicit matchingThis matching method requires additional kernel modules to provide support, you must manually call the "-M module name" In the form of the corresponding module, before you can set the matching criteria, add a rule with explicit matching criteria, you can execute the "lsmod | grep xt_ "command to see the relevant kernel extension modules (Xt_multiport, Xt_iprange, Xt_mac, xt_stat
Basic network knowledge ---------- iptables, ---------- iptablesIptablesCommands are commonly used in linux, and are part of the netfilter project. You can configure the syntax directly or through the graphical interface.
Iptables (option) (parameter)
Option
-T
Iptables Command Option input sequence:
Iptables-t table
Tags: iptables filter table case, iptables NAT table applicationFirst, iptables filter table CaseRequirements: Release 80, 20, 21 ports, specify a specific IP for 22 portsHere's how to do it:vim/usr/local/sbin/iptables.sh//Add the following:#! /bin/bashipt= "/usr/sbin/iptables"//define a variable, write
(many QQ servers)Iptables? I FORWARD? P tcp -- dport 8000? J DROPIptables? I FORWARD? D tcpconn.tencent.com? J DROP
6. publish internal network servers to the public network (Port ing technology)For example, publish the WEB service of the intranet host 192.168.16.200 to the INTERNET. The INTERNET user accesses the network interface of the NAT server through TCP port 80.Iptables? T nat? I PREROUTING?
multiport--dports port list", "-M multiport--sports", check the source port of the packet, the destination port, and the multi-port with a comma interval.Examples:Allow the machine to open 25, 80, 110, 143 ports to provide e-mail services?2) IP range matchingUse the form "-m iprange--src-range IP", "-m iprange--dst-range IP" to check the source address and destination address of the packet.Examples:Disable
How to use the Iptables NAT feature to use the Red Hat Enterprise Linux as a router.
Method:
Tip: The following methods only apply to the Red Hat Enterprise version of Linux more than 3.
1, turn on the package forwarding function:
echo "1" >/proc/sys/net/ipv4/ip_forward
2, modify the/etc/sysctl.conf file, let the packet forwarding function automatically when the system starts:
# Controls IP Packet forwarding
Net.ipv4.ip_forward
Iptables log search and iptables search
Iptables log Exploration
In addition to effectively controlling network access, the main function of the firewall is to clearly record network access and automatically generate logs for storage. Although the log format varies with the firewall manufacturer, the main information recorded is basically the same. The log Conte
IPTABLES entry, iptablesStatement: As I found that I cannot meet my comprehension ability (poor comprehension ability) after checking the online information, the summary is not systematic (not meeting my requirements), so I will summarize iptables with this, reprinting can be left with no name, but I believe that all JJ users will leave their names. Pure cainiao level, Please bypass ....Reference: laruence
From: China Linux Forum
Iptables and SOCKS5From the "iptables and natcheck" article, we can see that, as long as both ends use iptables for Nat, even if both sides pass the natcheck compatibility test, iptables can never cross each other.What should we do? One way is to add a Transit server
Enable iptables firewall for CentOS and iptables for centos
In fact, these things should be clearly written as soon as they are completed. They have been written for a long time. Maybe they have not been written in some places. I hope to see the kids shoes for help and I will update them again, if any error occurs, please criticize and correct it.
I used iptables
Ubuntu default installation is not open any firewall.When you use service iptables status , you are prompted to iptables:unrecoginzed service. This means that the service is not recognized.The following methods are from http://blog.csdn.net/lywzgzl/article/details/39938689, but the test found that This method is no longer available in Ubuntu#在ubuntu中由于不存在/etc/init.d/use.Through the above method, finally can not solve, through the research found that
[Email protected] ~]# iptables-F[[email protected]~]# Iptables-X [[email protected]~]# iptables-a input-m State--state related,established-J ACCEPT # does not allow the server to actively establish a new connection [[email protected]~]# iptables-a input-p tcp-m multiport--sp
of INPUT-I (insert)
6: iptables-a input-m [limit/multiport/state] add the corresponding module to implement the corresponding functions.-m (model ),
7: iptables-a input-m state -- state NEW-j ACCEPT uses the state module to control data packet status matching.
8: The service iptables save rule is saved to the/etc/
Disable the iptables firewall in centos Linux (iptables in Linux)On a linux server, the firewall is an iptables component. When some software is installed, the iptables firewall will block some necessary connections.
View iptables status: service
Iptables firewall usage notes and iptables firewall notes
I. background
When a WEB project goes online, you always need to install the environment. You can configure a firewall to allow Internet access. In the past, I used to search for a tutorial on the Internet. I don't need to worry about opening the port 80 command after I click it. In the spirit of learning, I plan to study the
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.