Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N
vim firewall.sh
i
#!/bin/bash
/sbin/SuSEfirewall2 off
#CLEAR ALL IPTABLE RULES
iptables -F
iptables -X
# DROP ALL INBOUND TRAFFIC
iptables -P INPUT DROP
# DROP ALL FORWARDING TRAFFIC
iptables -P FORWARD DROP
# ALLOW OUTBOUND TRAFFIC
iptables -P OUTPUT ACCEPT
# ALLOW SYSTEM TRAFFIC
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# ALLOW TRAFFIC FROM TRUSTED SOURCES
# HOME
iptables -A INPUT -s XXX.XXX.XXX.XXX -j ACCEPT
# TRUNKS
iptables -A INPUT -s XXX.XXX.XXX.XXX -j ACCEPT #TRUNK NAME
# DROP ALL INBOUND TRAFFIC
iptables -A INPUT -p all -j DROP
:wq
***************************************************
vim /etc/rc.d/boot.local
i
/root/firewall.sh
:wq
chmod 777 firewall.sh
chmod +x firewall.sh
./firewall.sh
iptables -vnL
iboam wrote:A friend of mine give me a solution, it's working with me so im sharing with the world.
This script will open all ports to "TRUSTED SOURCES" and will block all ports to "UNTRUSTED SOURCES"vim firewall.sh
i
#!/bin/bash
/sbin/SuSEfirewall2 off
#CLEAR ALL IPTABLE RULES
iptables -F
iptables -X
# DROP ALL INBOUND TRAFFIC
iptables -P INPUT DROP
# DROP ALL FORWARDING TRAFFIC
iptables -P FORWARD DROP
# ALLOW OUTBOUND TRAFFIC
iptables -P OUTPUT ACCEPT
# ALLOW SYSTEM TRAFFIC
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# ALLOW TRAFFIC FROM TRUSTED SOURCES
# HOME
iptables -A INPUT -s XXX.XXX.XXX.XXX -j ACCEPT
# TRUNKS
iptables -A INPUT -s XXX.XXX.XXX.XXX -j ACCEPT #TRUNK NAME
# DROP ALL INBOUND TRAFFIC
iptables -A INPUT -p all -j DROP
:wq
***************************************************
vim /etc/rc.d/boot.local
i
/root/firewall.sh
:wq
chmod 777 firewall.sh
chmod +x firewall.sh
./firewall.sh
iptables -vnL
forwardsource wrote:http://viciwiki.com/index.php/DGG
Above mentioned site link is not working. Please advise us the script.
Users browsing this forum: Google [Bot] and 51 guests