Iptables firewall configuration access ip record log

Source: Internet
Author: User
Open the configuration file vim/etc/syslog. conf of log service and add it in the lowest line # Open the configuration file of log service
Vim/etc/syslog. conf
Add in the lowest row
# IP address Log
Kern.info/var/log/ Iptables
Save reboot: service syslog restart

Vim/etc/sysconfig/iptables is configured as follows:
# Generated by iptables-save v1.3.5 on Sat Dec 20 09: 33: 392008
* Filter
: Input drop [157: 17024]
: Forward accept [0: 0]
: Output accept [134: 15880]
-P inputdrop # all incoming packets are discarded
-A input-d 10.65.160.11-jLOG # logs of the imported host
-A input-s 10.65.160.17-d 10.65.160.11-jDROP # package discarded from the source host to the destination host
-A input-p icmp-jACCEPT # allow external network ping to the host
-A input-p tcp -- dport 22-jACCEPT # allow access to the host 22 Port
-A input-p tcp -- dport 80-jACCEPT # allow access to the host port 80
-A input-p tcp -- dport 3306-jACCEPT # allow access to the host port 3306

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.