Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo "Flushing iptables..."
- iptables -F
- echo "SSH Allowed"
- iptables -A INPUT -p tcp --dport 22 -j ACCEPT
- echo "allow from localhost"
- iptables -A INPUT -i lo -j ACCEPT
- echo "allow from 192.168.1.1-100"
- iptables -I INPUT 3 -i eth0 -m iprange --src-range 192.168.1.1-192.168.1.100 -j ACCEPT
- echo "allow all pings"
- iptables -I INPUT 5 -p icmp -j ACCEPT
- # Set default policies for INPUT, FORWARD and OUTPUT chains
- iptables -P INPUT DROP
- iptables -P FORWARD DROP
- iptables -P OUTPUT ACCEPT
- # Accept packets belonging to established and related connections
- iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
Add Comment
Please, Sign In to add comment