포럼 회원으로 등록하신분만 다운로드가 가능합니다. 최대 업로드 가능한 용량은 20MB 입니다.
모든 포트를 막고,
ssh, ftp, www만 ok하는 스크립트...
#!/bin/sh
IPTABLES=/sbin/iptables
#port forward enable
echo "1" > /proc/sys/net/ipv4/ip_forward
$IPTABLES -P INPUT ACCEPT
$IPTABLES -F INPUT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -F OUTPUT
$IPTABLES -P FORWARD ACCEPT
$IPTABLES -F FORWARD
# ssh
$IPTABLES -A INPUT -i eth1 -p tcp --dport 22 -j ACCEPT
$IPTABLES -A INPUT -i eth1 -p udp --dport 22 -j ACCEPT
# ftp
$IPTABLES -A INPUT -i eth1 -p tcp --dport 21 -j ACCEPT
$IPTABLES -A INPUT -i eth1 -p tcp --dport 20 -j ACCEPT
# www
$IPTABLES -A INPUT -i eth1 -p tcp --dport 80 -j ACCEPT
$IPTABLES -A INPUT -i eth1 -p tcp --dport 1:1024 -j DROP
$IPTABLES -A INPUT -i eth1 -p udp --dport 1:1024 -j DROP
$IPTABLES -A INPUT -i eth1 -p icmp -j DROP