CentOS under Firewall iptables log Learning notes

Source: Internet
Author: User

have been unable to find the log aspects of how to do, asked colleagues, colleagues gave a Web site:

http://www.thegeekstuff.com/2012/08/iptables-log-packets/

Here's what I'm doing with my own ideas based on the settings in this URL:

After a careful look, I feel the same rules as the Routeos I played before:

1. Just create a log chain first

2. Then jump all the inputs to this log chain

3. Then it's the drop data in the log chain.

4. Then the log chain is terminated

The firewall rules are as follows:

Iptables--a INPUT-2""4-a logging-j DROP

Now I am not familiar with the module of the M parameter, the Internet search for the next: the approximate meaning is the fixed period of time limit how many packets are recorded

So, for example, if we want to record 4488-port access, we should use the following code:

Iptables--A INPUT-44882"drop port 4488"7  -A LOGGING-J dropservice iptables saveservice iptables Restart

Because I set debug to stand-alone log in the messages log, I set Log-level 7, which is the debug level, so that these logs are logged to a separate log file.

Not all of them are recorded in the messages log!

For http://www.thegeekstuff.com/2012/08/iptables-log-packets/The following comments have been set, the server will not accept input connect,

I think the prerequisite for logging is that we've opened the allowed ports,

In other words, the steps we set up the firewall should be:

1. Set input is disabled by default

2. Set the Allowed ports

3.INPUT Jump Logging

4. Logging

5. Prohibition of logging

CentOS under Firewall iptables log Learning notes

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.