Created
October 16, 2012 10:00
-
-
Save armetiz/3898446 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vim /etc/init.d/firewall | |
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: firewall | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Apply firewall configuration | |
# Description: Apply firewall configuration. | |
### END INIT INFO | |
# Script iptables Thomas Tourlourat | |
## Règles iptables. | |
iptables -I INPUT -i lo -j ACCEPT | |
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
iptables -A INPUT -p tcp -i eth0 --dport ssh -j ACCEPT | |
iptables -A INPUT -p icmp -i eth0 -j ACCEPT | |
iptables -P INPUT DROP | |
chmod +x /etc/init.d/firewall | |
update-rc.d firewall defaults | |
reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment