wantuiliv
(usa Ubuntu)
Enviado em 20/12/2011 - 19:12h
Amigos estou enviando o arquivo do meu firewall alguem pode me falar porque o outlook não conecta:
firewall_start()
{
iptables -F
iptables -P FORWARD DROP
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 192.168.160.0/24 -o eth1 -j MASQUERADE
#msn
iptables -A FORWARD -p TCP --sport 1863 -j ACCEPT
iptables -A FORWARD -p TCP --sport 443 -j ACCEPT
iptables -A FORWARD -p TCP -s 192.168.160.134 --dport 1863 -j ACCEPT
iptables -A FORWARD -p TCP -s 192.168.160.134 --dport 443 -j ACCEPT
iptables -A FORWARD -p TCP -s 192.168.160.45 --dport 443 -j ACCEPT
iptables -A FORWARD -p TCP -s 192.168.160.45 --dport 1863 -j ACCEPT
#APACHE
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
#DNS
iptables -t nat -A PREROUTING -p udp -s 192.168.160.0/24 -d 201.48.87.177 --dport 53 -j ACCEPT
iptables -t nat -A POSTROUTING -p udp -s 201.48.87.177 --sport 53 -d 192.168.160.0
#Abre uma porta o outlook
iptables -A FORWARD -p TCP --sport 25 -j ACCEPT
iptables -A FORWARD -p TCP -s 192.168.160.0/24 --dport 25 -j ACCEPT
iptables -A FORWARD -p TCP --sport 587 -j ACCEPT
iptables -A FORWARD -p TCP -s 192.168.160.0/24 --dport 587 -j ACCEPT
iptables -A FORWARD -p TCP --sport 110 -j ACCEPT
iptables -A FORWARD -p TCP -s 192.168.160.0/24 --dport 110 -j ACCEPT
iptables -A FORWARD -p TCP --sport 465 -j ACCEPT
iptables -A FORWARD -p TCP -s 192.168.160.0/24 --dport 465 -j ACCEPT
iptables -A FORWARD -p TCP --sport 995 -j ACCEPT
iptables -A FORWARD -p TCP -s 192.168.160.0/24 --dport 995 -j ACCEPT
#conectividade social (CAIXA)
iptables -t nat -I PREROUTING -p tcp -d 200.201.0.0/16 -j ACCEPT
iptables -t nat -I PREROUTING -p tcp -d 200.223.0.0 -j ACCEPT
iptables -I FORWARD -p tcp -d 200.201.0.0/16 -j ACCEPT
iptables -I FORWARD -p tcp -d 200.223.0.0 -j ACCEPT
#cat
iptables -A FORWARD -p TCP -s 192.168.160.0/24 --dport 5017 -j ACCEPT
iptables -A FORWARD -p tcp --sport 5017 -j ACCEPT
#Abre uma porta area remota(inclusive para a Internet)
iptables -A INPUT -p tcp --dport 3389 -j ACCEPT
#Abre uma porta vpn (inclusive para a Internet)
iptables -A OUTPUT -p udp -d 189.115.127.220 --dport 1194 -j ACCEPT
iptables -A INPUT -p tcp --dport 1194 -j ACCEPT
iptables -A INPUT -p udp --dport 1194 -j ACCEPT
#DNS
iptables -A INPUT -p tcp --dport 53 -j ACCEPT
#Abre uma porta vnc (inclusive para a Internet)
iptables -A FORWARD -p tcp --sport 5900 -j ACCEPT
iptables -A FORWARD -p TCP -s 192.168.160.0/24 --dport 5900 -j ACCEPT
iptables -A FORWARD -p tcp --sport 22 -j ACCEPT
iptables -A FORWARD -p TCP -s 192.168.160.0/24 --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 5900 -j ACCEPT
iptables -A INPUT -p tcp --dport 5901 -j ACCEPT
iptables -A INPUT -p tcp --dport 5902 -j ACCEPT
iptables -A INPUT -p tcp --dport 5903 -j ACCEPT
iptables -A INPUT -p tcp --dport 5904 -j ACCEPT
# Abre uma porta samba (inclusive para a Internet)
iptables -A INPUT -p tcp --dport 139 -j ACCEPT
#Redireciona uma faixa de portas para um micro da rede local
iptables -I FORWARD -p tcp -d 192.168.160.201 --dport 5900 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 5901 -j DNAT --to-destination 192.168.160.201:5900
iptables -I FORWARD -p tcp -d 192.168.160.214 --dport 5900 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 5902 -j DNAT --to-destination 192.168.160.214:5900
iptables -I FORWARD -p tcp -d 192.168.160.127 --dport 5900 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 5903 -j DNAT --to-destination 192.168.160.127:5900
iptables -I FORWARD -p tcp -d 192.168.160.152 --dport 5900 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 5904 -j DNAT --to-destination 192.168.160.152:5900
#serverbdmv
iptables -I FORWARD -p udp -s 192.168.160.3 --dport 1194 -j ACCEPT
iptables -I FORWARD -p udp -d 192.168.160.3 --dport 1194 -j ACCEPT
iptables -I FORWARD -p udp -s 192.168.160.3 --sport 1194 -j ACCEPT
iptables -I FORWARD -p udp -d 192.168.160.3 --sport 1194 -j ACCEPT
iptables -A INPUT -p udp -d 192.168.160.3 --dport 1194 -j ACCEPT
iptables -A INPUT -p udp -s 192.168.160.3 --dport 1194 -j ACCEPT
iptables -A INPUT -p udp -d 192.168.160.3 --sport 1194 -j ACCEPT
iptables -A INPUT -p udp -s 192.168.160.3 --sport 1194 -j ACCEPT
iptables -A OUTPUT -p udp -d 192.168.160.3 --dport 1194 -j ACCEPT
iptables -A OUTPUT -p udp -s 192.168.160.3 --dport 1194 -j ACCEPT
iptables -A OUTPUT -p udp -d 192.168.160.3 --sport 1194 -j ACCEPT
iptables -A OUTPUT -p udp -s 192.168.160.3 --sport 1194 -j ACCEPT
iptables -t nat -A PREROUTING -p udp --dport 1194 -j DNAT --to-destination 192.168.160.3
iptables -t nat -A PREROUTING -p udp --sport 1194 -j DNAT --to-destination 192.168.160.3
#iptables -A FORWARD -j DROP
echo "Carregando Firewall"
sleep 1
echo "Firewall OK!"
sleep 1
}
firewall_stop()
{
iptables -F
iptables -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
echo "Desativando Firewall"
sleep 1
echo "Firewall OK!"
sleep 1
}
case "$1" in
"start") firewall_start ;;
"stop") firewall_stop ;;
"restart") firewall_stop; firewall_start;;
esac