Regular collation of common iptables

Source: Internet
Author: User
Tags ssh port

1. Allow only internal legitimate IP addresses to access the server

#setting Access Rules#one,in Access Rules,allow all the IPs of Hudong.comiptables-a input-s 192.168.3.3/24-p all-j ACC Eptiptables-a input-s 192.168.4.4/24-p all-j accept........ 2, allow only internal legal IP segment access to the monitoring service Nagios#second,port access rules# Nagiosiptables-a input-s 192.168.1.0/24-p TCP--dport 5666-j accept....... 3, Allow only internal legal IP segments to access MySQL and Oracle databases iptables-a input-s 192.168.4.4/24-p TCP--dport 3306-j accept........ 4, Allow only internal legal IP segment access to SSH remote Connection service #ssh difference form other servers hersiptables-a input-p tcp-s 192.168.1.0/24--dport 45215-j A Ccept ... (Note: The SSH port is best changed to a different port.) Also, it is best to allow the internal network to connect only)  5, different HTTP service restrictions A, the service to provide HTTP services, to allow HTTP services to pass, and do not restrict IP. #httpiptables-A input-p TCP--dport 80-j accept.......b, a service that provides HTTP services internally, typically uses special ports, and restricts legitimate IP connections or VPN connections. Iptables-a input-s 192.168.1.0/24-p tcp-m multiport--dport 8080,8081,8082,8888-j ACCEPT .... 5. SNMP Restrictions #snmpiptables-a input-s 192.168.1.0/24-p UDP--dport 161-j accept...... 6, rsync service throttling policy #rsynciptables-a Input-s 192.168.1.0/24-p tcp-m TCP--dport 873-j accept....... 7, FTP service restrictions #others related#ftp#iptables-a input-p TCP--dport 20:21-j ACCEPT (in addition to allow Port 21, also allow Port 20th) Iptables-a input-m State--state established,related-j acceptiptables-a Output -m St Ate--state established,related-j Accept Description: iptables-a input-m State--state status-j acceptstate    This module, When combined with connection Tracking,allows access to the connection tracking state for this PACKET.   &N bsp;    

Common iptables rules collation

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.