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