Mainos / Advertisement:

Translations:Iptables/44/en

Kohteesta Taisto
Siirry navigaatioon Siirry hakuun
  *filter
  :INPUT DROP [0:0]
  :FORWARD ACCEPT [0:0]
  :OUTPUT ACCEPT [0:0]
  
  # Allow local traffic
  -A INPUT -i lo -j ACCEPT
  # First packet is a SYN bit. If not, block traffic.
  -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
  
  # Block broken packets
  -A INPUT -f -j DROP
  
  # Block XMAS packets
  -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
  
  # Block "NULL" packets
  -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
  
  # Throttle TCP RST (TCP RESET). 
  -A INPUT -p tcp -m tcp --tcp-flags RST RST -m limit --limit 2/second --limit-burst 2 -j ACCEPT
  
  # Block all invalid packets
  -A INPUT -m state --state INVALID -j DROP
  -A FORWARD -m state --state INVALID -j DROP
  -A OUTPUT -m state --state INVALID -j DROP
  
  # Block forged packets
  -A INPUT -s 169.254.0.0/16 -j DROP
  -A INPUT -s 127.0.0.0/8 -j DROP
  -A INPUT -s 224.0.0.0/4 -j DROP
  -A INPUT -d 224.0.0.0/4 -j DROP
  -A INPUT -s 240.0.0.0/5 -j DROP
  -A INPUT -d 240.0.0.0/5 -j DROP
  -A INPUT -s 0.0.0.0/8 -j DROP
  -A INPUT -d 0.0.0.0/8 -j DROP
  -A INPUT -d 239.255.255.0/24 -j DROP
  -A INPUT -d 255.255.255.255 -j DROP
  
  # Blocking an ICMP attack, limited amount of requests
  -A INPUT -p icmp --icmp-type address-mask-request -j DROP
  -A INPUT -p icmp --icmp-type timestamp-request -j DROP
  -A INPUT -p icmp --icmp-type router-solicitation -j DROP
  -A INPUT -p icmp -m limit --limit 2/second -j ACCEPT
  
  # Allow SSH
  -A INPUT -p tcp --dport 22 -m state --state NEW -j ACCEPT
 
  # Block SYN-FLOOD packets
  -A INPUT -p tcp -m state --state NEW -m limit --limit 50/second --limit-burst 50 -j ACCEPT
  -A INPUT -p tcp -m state --state NEW -j DROP
  
  # Allow trusted connections and block INVALID packets
  -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
  -A INPUT -m state --state INVALID -j DROP
  
  COMMIT
Mainos / Advertisement: