博文

目前显示的是标签为“Redhat”的博文

CentOS / Redhat Iptables Firewall Configuration Tutorial

#!/bin/bash # A sample firewall shell script IPT=”/sbin/iptables” SPAMLIST=”blockedip” SPAMDROPMSG=”BLOCKED IP DROP” SYSCTL=”/sbin/sysctl” BLOCKEDIPS=”/root/scripts/blocked.ips.txt”   # Stop certain attacks echo “Setting sysctl IPv4 settings…” $SYSCTL net.ipv4.ip_forward=0 $SYSCTL net.ipv4.conf.all.send_redirects=0 $SYSCTL net.ipv4.conf.default.send_redirects=0 $SYSCTL net.ipv4.conf.all.accept_source_route=0 $SYSCTL net.ipv4.conf.all.accept_redirects=0 $SYSCTL net.ipv4.conf.all.secure_redirects=0 $SYSCTL net.ipv4.conf.all.log_martians=1 $SYSCTL net.ipv4.conf.default.accept_source_route=0 $SYSCTL net.ipv4.conf.default.accept_redirects=0 $SYSCTL net.ipv4.conf.default.secure_redirects=0 $SYSCTL net.ipv4.icmp_echo_ignore_broadcasts=1 #$SYSCTL net.ipv4.icmp_ignore_bogus_error_messages=1 $SYSCTL net.ipv4.tcp_syncookies=1 $SYSCTL net.ipv4.conf.all.rp_filter=1 $SYSCTL net.ipv4.conf.default.rp_filter=1 $SYSCTL kernel.exec-shield=1 $SYSCTL kernel.randomize_va_space=1   echo “Starting IP...