Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # iptables.sh
- #
- #política por defecto
- iptables -P INPUT DROP
- iptables -P FORWARD DROP
- iptables -P OUTPUT ACCEPT
- #
- # Flush (-F) all specific rules
- #
- iptables -F INPUT
- iptables -F FORWARD
- iptables -F OUTPUT
- #Conexiones establecidas
- iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
- iptables -A INPUT -i lo -j ACCEPT
- #ping
- iptables -A INPUT -p icmp --icmp-type 8 -m conntrack --ctstate NEW,ESTABLISHED,RELATED -j ACCEPT
- iptables -A OUTPUT -p icmp --icmp-type 0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
- #SSH
- iptables -A INPUT -p tcp --dport ssh -j ACCEPT
- #HTTP
- iptables -A INPUT -p tcp --dport 80 -j ACCEPT
- #FTP
- iptables -A INPUT -p tcp --dport 20 -j ACCEPT
- iptables -A INPUT -p tcp --dport 21 -j ACCEPT
- iptables -A INPUT -p tcp --dport 40110:40210 -j ACCEPT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement