removido
(usa Nenhuma)
Enviado em 31/08/2012 - 16:51h
Já tentei sim amigo, segue meu firewall.. poxa ta
[*****] resolver isso cara..
quebrando a cabeça aqui..
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
modprobe iptable_nat
#modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
INTERNAL_INTERFACE=eth1
EXTERNAL_INTERFACE=eth0
EXTERNAL_NET=192.168.1.0/24
EXTERNAL_IP=192.168.1.2
INTERNAL_NET=192.168.0.0/24
INTERNAL_IP=192.168.0.2
MX_SERVER=192.168.1.2
ANYWHERE="any/0" # Match any IP address
BROADCAST_SRC="0.0.0.0" # Broadcast Source Address
BROADCAST_DEST="255.255.255.255" # Broadcast Destination Address
CLASS_A="10.0.0.0/8" # Class-A Private (RFC-1918) Networks
CLASS_B="172.16.0.0/12" # Class-B Private (RFC-1918) Networks
CLASS_C="192.168.0.0/16" # Class-C Private (RFC-1918) Networks
CLASS_D_MULTICAST="224.0.0.0/4" # Class-D Multicast Addresses
CLASS_E_RESERVED_NET="240.0.0.0/5" # Class-E Reserved Addresses
PRIVPORTS="0:1023" # Well-Known, Privileged Port Range
UNPRIVPORTS="1024:65535" # Unprivileged Port Range
TRACEROUTE_SRC_PORTS="32769:65535" # Traceroute Source Ports
TRACEROUTE_DEST_PORTS="33434:33523" # Traceroute Destination Ports
#
# The Loopback interface defines should not be
# edited unless your Linux distribution defines
# these differently.
#
LOOPBACK_INTERFACE="lo" # The loopback interface
LOOPBACK_NETWORK="127.0.0.0/8" # Reserved Loopback Address Range
# X Window port allocation begins at 6000 and increments
# for each additional server running from 6000 to 6063.
XWINDOW_PORTS="6000:6063" # (TCP) X Windows
# SSH starts at 1023 and works down to 513 for each additional
# simultaneous incoming connection.
SSH_HI_PORTS="513:1023" # SSH Simultaneous Connections
#
# Source function library.
#
. /etc/rc.d/init.d/functions
. /etc/firewall/fwfunc.sh
case "$1" in
start)
action "Starting firewall: " /bin/true
$0 clear-rules
#exit 0
# Set the default policy to DROP
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
BuildNewChain "LnD" "DROP"
BuildNewChain "LnR" "REJECT"
BuildNewChain "ScanD" "DROP"
VoidPortScan
iptables -A INPUT -i $LOOPBACK_INTERFACE -j ACCEPT
iptables -A OUTPUT -o $LOOPBACK_INTERFACE -j ACCEPT
SetKernelParameters
iptables -A FORWARD -d 192.168.0.21 -j ACCEPT # Ligia
iptables -A FORWARD -s 192.168.0.21 -j ACCEPT #
iptables -A INPUT -s 192.168.0.148 -j DROP #
iptables -A OUTPUT -s 192.168.0.148 -j DROP #
iptables -A FORWARD -s 192.168.0.148 -j DROP #
iptables -A INPUT -s 192.168.0.144 -j DROP #
iptables -A OUTPUT -s 192.168.0.144 -j DROP #
iptables -A FORWARD -s 192.168.0.144 -j DROP #
iptables -t nat -A POSTROUTING -o $EXTERNAL_INTERFACE -j MASQUERADE
#iptables -t nat -A POSTROUTING -s $INTERNAL_NET -o $EXTERNAL_INTERFACE -j SNAT --to $EXTERNAL_IP
iptables -t nat -A POSTROUTING -s 192.192.192.0 -o $EXTERNAL_INTERFACE -j SNAT --to $EXTERNAL_IP
ICMP 1
CloseNFS
AcceptNet $INTERNAL_NET
AcceptNet 192.192.192.0/24
AcceptNet 192.168.2.0/32
AcceptNet 10.8.0.0/32
iptables -A FORWARD -d 10.8.0.0/32 -j ACCEPT
iptables -A FORWARD -s 10.8.0.0/32 -j ACCEPT
iptables -A FORWARD -d 192.192.192.0/24 -j ACCEPT
iptables -A FORWARD -s 192.192.192.0/24 -j ACCEPT
iptables -A FORWARD -d 192.168.1.0/24 -s 192.192.192.0/24 -p tcp -j ACCEPT
iptables -A FORWARD -s 192.168.1.0/24 -d 192.192.192.0/24 -p tcp -j ACCEPT
FwConPort $UNPRIVPORTS '80 22 443' $EXTERNAL_IP $ANYWHERE TCP F
FwOpenPort $UNPRIVPORTS '80 20:21 22' $ANYWHERE $EXTERNAL_IP TCP
FwConPort $UNPRIVPORTS 25 $MX_SERVER $ANYWHERE TCP F
FwConPort $UNPRIVPORTS 2200 $MX_SERVER $ANYWHERE TCP F
#FwOpenPort $UNPRIVPORTS 25 $ANYWHERE $MX_SERVER TCP
#FwOpenPort $UNPRIVPORTS 110 $ANYWHERE $MX_SERVER TCP
DnsFullServer 187.59.80.54
FwOpenPort $UNPRIVPORTS 2200 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 5900 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 5901 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 5902 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 5910 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 9876 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 5920 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 10100:10150 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 443 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 11112 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 10000 $ANYWHERE $EXTERNAL_IP TCP
# FwOpenPort $UNPRIVPORTS 5010 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 3389 $ANYWHERE $EXTERNAL_IP TCP #TS
FwOpenPort $UNPRIVPORTS 3390 $ANYWHERE $EXTERNAL_IP TCP #TS
FwOpenPort $UNPRIVPORTS 1194 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 9090 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 5222 $ANYWHERE $EXTERNAL_IP TCP # Jabber
FwOpenPort $UNPRIVPORTS 8088 $ANYWHERE $EXTERNAL_IP TCP # ISS
FwOpenPort $UNPRIVPORTS 8022 $ANYWHERE $EXTERNAL_IP TCP # SSH
FwOpenPort $UNPRIVPORTS 3306 $ANYWHERE $EXTERNAL_IP TCP #
# PortForward TCP 9668 192.168.0.4 9668
# PortForward TCP 9669 192.168.0.4 9669
# PortForward TCP 9670 192.168.0.4 9670
# PortForward TCP 8666 192.168.0.4 8666
# PortForward TCP 6055 192.168.0.4 6055
FwOpenPort $UNPRIVPORTS 9666 $ANYWHERE $EXTERNAL_IP TCP #
FwOpenPort $UNPRIVPORTS 9667 $ANYWHERE $EXTERNAL_IP TCP #
# FwOpenPort $UNPRIVPORTS 9668 $ANYWHERE $EXTERNAL_IP TCP #
# FwOpenPort $UNPRIVPORTS 9669 $ANYWHERE $EXTERNAL_IP TCP #
# FwOpenPort $UNPRIVPORTS 9670 $ANYWHERE $EXTERNAL_IP TCP #
FwOpenPort $UNPRIVPORTS 6050 $ANYWHERE $EXTERNAL_IP TCP #
FwOpenPort $UNPRIVPORTS 6052 $ANYWHERE $EXTERNAL_IP TCP #
# FwOpenPort $UNPRIVPORTS 6055 $ANYWHERE $EXTERNAL_IP TCP #
FwOpenPort $UNPRIVPORTS 6062 $ANYWHERE $EXTERNAL_IP TCP #
FwOpenPort $UNPRIVPORTS 6063 $ANYWHERE $EXTERNAL_IP TCP #
FwOpenPort $UNPRIVPORTS 4006 $ANYWHERE $EXTERNAL_IP TCP #
FwOpenPort $UNPRIVPORTS 2104 $ANYWHERE $EXTERNAL_IP TCP #
FwOpenPort $UNPRIVPORTS 2222 $ANYWHERE $EXTERNAL_IP TCP #
FwOpenPort $UNPRIVPORTS 8022 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 8670 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 8671 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 8681 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 8682 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 8866 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 8666 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 8672 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 8673 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 8683 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 8684 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 6091 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 6092 $ANYWHERE $EXTERNAL_IP TCP
FwOpenPort $UNPRIVPORTS 60000:60200 $ANYWHERE $EXTERNAL_IP TCP F
FwConPort $UNPRIVPORTS 3389 $EXTERNAL_IP $ANYWHERE TCP F # TS
FwConPort $UNPRIVPORTS '7 2703' $EXTERNAL_IP $ANYWHERE TCP F #Razor
FwConPort $UNPRIVPORTS '7 2703' $EXTERNAL_IP $ANYWHERE UDP F #Razor
FwConPort $UNPRIVPORTS 6277 $EXTERNAL_IP $ANYWHERE UDP F #DCC
FwConPort $UNPRIVPORTS 5222 $EXTERNAL_IP $ANYWHERE UDP F # Jabber
FwConPort $UNPRIVPORTS 1498 $EXTERNAL_IP $ANYWHERE UDP F # sql
FwConPort $UNPRIVPORTS 1498 $EXTERNAL_IP $ANYWHERE TCP F #
FwConPort $UNPRIVPORTS 24441 $EXTERNAL_IP $ANYWHERE TCP F #Pyzor
FwConPort $UNPRIVPORTS 20:21 $EXTERNAL_IP $ANYWHERE TCP F #FTP
FwConPort $UNPRIVPORTS 8245 $EXTERNAL_IP $ANYWHERE TCP F #noip
FwConPort $UNPRIVPORTS 8080 $EXTERNAL_IP $ANYWHERE TCP F #
FwConPort $UNPRIVPORTS 3128 $EXTERNAL_IP $ANYWHERE TCP F #
FwConPort $UNPRIVPORTS 995 $EXTERNAL_IP $ANYWHERE TCP F #
FwConPort $UNPRIVPORTS 465 $EXTERNAL_IP $ANYWHERE TCP F #
iptables -A FORWARD -p TCP -s $INTERNAL_NET -d $ANYWHERE --dport 25 -j DROP #SMTP
iptables -A FORWARD -p TCP -s $INTERNAL_NET -d $ANYWHERE --dport 8080 -j DROP #PROXY
iptables -A FORWARD -p TCP -s $INTERNAL_NET -d $ANYWHERE --dport 3128 -j DROP #
iptables -A FORWARD -p TCP -s $INTERNAL_NET -d $ANYWHERE --dport 5190 -j DROP #ICQ
iptables -A FORWARD -p TCP -s $INTERNAL_NET -d $ANYWHERE --dport 1214 -j DROP #Kaaza
iptables -A FORWARD -p TCP -s $INTERNAL_NET -d $ANYWHERE --dport 6346 -j DROP #LimeWire
iptables -A FORWARD -p TCP -s $INTERNAL_NET -d $ANYWHERE --dport 5050 -j DROP #LimeWire
iptables -A FORWARD -p TCP -s $INTERNAL_NET -d $ANYWHERE --dport 5122 -j DROP #MSN
iptables -A FORWARD -p TCP -s $INTERNAL_NET -d $ANYWHERE --dport 1863 -j DROP #MSN
iptables -A FORWARD -p UDP -s $INTERNAL_NET -d $ANYWHERE --dport 1863 -j DROP #MSN
#---------------------Kproxy Orkut-------------------------------
iptables -A INPUT -d
www.kproxy.com -j DROP
iptables -A FORWARD -d
www.kproxy.com -j DROP
iptables -A INPUT -d kproxy.com -p tcp -j DROP
iptables -A FORWARD -d kproxy.com -p tcp -j DROP
iptables -A INPUT -d
www.orkut.com -p tcp --dport 443 -j DROP
iptables -A FORWARD -d
www.orkut.com -p tcp --dport 443 -j DROP
iptables -A INPUT -d orkut.com -p tcp --dport 443 -j DROP
iptables -A FORWARD -d orkut.com -p tcp --dport 443 -j DROP
#---------------------Stuffed Routing-------------------------------
iptables -A INPUT -s 255.255.255.255 -j DROP
iptables -A INPUT -s 0.0.0.0 -j DROP
iptables -A INPUT -s 255.255.255.255 -j DROP
iptables -A INPUT -s 0.0.0.0 -j DROP
iptables -A FORWARD -s $INTERNAL_NET -d login.icq.com -j DROP
iptables -A FORWARD -s $INTERNAL_NET -d scsa.yahoo.com -j DROP
iptables -A FORWARD -s $INTERNAL_NET -d 64.245.58.0/24 -j DROP #AudioGalaxy
iptables -A FORWARD -s $INTERNAL_NET -d 216.35.208.0/24 -j DROP #iMesh
# All trafic on Local Net to http is redirected do Proxy
iptables -t nat -A PREROUTING -p tcp -i $INTERNAL_INTERFACE -d orkut.com --dport 443 -j REDIRECT --to 3128
iptables -t nat -A PREROUTING -p tcp -i $INTERNAL_INTERFACE -d meboo.com --dport 443 -j REDIRECT --to 3128
# iptables -t nat -A PREROUTING -p tcp -i eth0 -d meudominio.com.br --dport 80 -j REDIRECT --to 80
iptables -t nat -A PREROUTING -p tcp -i $INTERNAL_INTERFACE -d ! 200.201.174.0/24 --dport 80 -j REDIRECT --to 3128
PortForward TCP 5900 192.192.192.2 5900
PortForward TCP 11112 192.168.0.155 11112
PortForward TCP 5901 192.168.0.5 5900
# Robo
PortForward TCP 5902 192.192.192.4 5900
PortForward TCP 3389 192.168.0.3 3389
# PortForward TCP 3389 192.168.0.12 3389
# PortForward TCP 9668 192.168.0.4 9668
# PortForward TCP 9669 192.168.0.4 9669
# PortForward TCP 9670 192.168.0.4 9670
# PortForward TCP 6055 192.168.0.4 6055
PortForward TCP 9666 192.168.0.4 9666
PortForward TCP 9667 192.168.0.4 9667
PortForward TCP 6052 192.168.0.4 6052
PortForward TCP 6062 192.168.0.4 6062
PortForward TCP 8866 192.168.0.4 8866
PortForward TCP 8670 192.168.0.4 8670
PortForward TCP 8671 192.168.0.4 8671
PortForward TCP 8681 192.168.0.4 8681
PortForward TCP 8682 192.168.0.4 8682
PortForward TCP 6063 192.168.0.4 6063
PortForward TCP 6091 192.168.0.4 6091
PortForward TCP 6092 192.168.0.4 6092
PortForward TCP 6050 192.168.0.4 6050
PortForward TCP 8666 192.168.0.4 8666
PortForward TCP 8672 192.168.0.4 8672
PortForward TCP 8673 192.168.0.4 8673
PortForward TCP 8683 192.168.0.4 8683
PortForward TCP 8684 192.168.0.4 8684
PortForward TCP 8088 192.168.0.1 80
PortForward TCP 2222 192.168.0.1 2222
PortForward TCP 4006 192.192.192.6 4006
PortForward TCP 2104 192.192.192.2 2104
PortForward TCP 3390 192.168.0.45 3389
PortForward TCP 443 192.168.0.254 443
PortForward TCP 8022 192.168.0.4 22
iptables -A FORWARD -d $INTERNAL_NET -j ACCEPT
iptables -A FORWARD -s $INTERNAL_NET -j ACCEPT
;;
stop)
action "Stoping firewall: " /bin/true
echo 1 > /proc/sys/net/ipv4/ip_forward
$0 clear-rules
iptables -t nat -A PREROUTING -p tcp -i $INTERNAL_INTERFACE -d orkut.com --dport 443 -j REDIRECT --to 3128
iptables -t nat -A PREROUTING -p tcp -i eth0 -d meudominio.com.br --dport 80 -j REDIRECT --to 80
iptables -t nat -A PREROUTING -p tcp -i $INTERNAL_INTERFACE -d ! 200.201.174.0/24 --dport 80 -j REDIRECT --to 3128
iptables -t nat -A POSTROUTING -o $EXTERNAL_INTERFACE -j MASQUERADE
PortForward TCP 5900 192.192.192.2 5900
PortForward TCP 11112 192.168.0.155 11112
PortForward TCP 5901 192.168.0.5 5900
PortForward TCP 3389 192.168.0.3 3389
PortForward TCP 8088 192.168.0.1 80
PortForward TCP 9666 192.168.0.4 9666
PortForward TCP 9667 192.168.0.4 9667
PortForward TCP 9668 192.168.0.4 9668
PortForward TCP 9669 192.168.0.4 9669
PortForward TCP 9670 192.168.0.4 9670
PortForward TCP 6050 192.168.0.4 6050
PortForward TCP 6055 192.168.0.4 6055
PortForward TCP 8681 192.168.0.4 8681
PortForward TCP 8670 192.168.0.4 8670
PortForward TCP 2222 192.168.0.1 2222
PortForward TCP 6063 192.168.0.4 6063
PortForward TCP 4006 192.192.192.6 4006
PortForward TCP 2104 192.192.192.2 2104
PortForward TCP 3390 192.168.0.45 3389
PortForward TCP 443 192.168.0.254 443
PortForward TCP 8022 192.168.0.4 22
AcceptNet $INTERNAL_NET
;;
clear-rules)
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -F
iptables -t nat -F
iptables -X
iptables -t nat -X
ifconfig eth0:1 187.59.80.54 netmask 255.255.255.252
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0