tcosta
(usa Ubuntu)
Enviado em 07/02/2013 - 15:36h
Boa tarde pessoal,
Estou tentando atualizar meu rc.d através do comando: update-rc.d firewall-up.sh defaults e ele está retornando uma mensagem: INSSERVER WARNING: SCRIPT 'firewall-up.sh' MISSING LSB TAGS AND OVERRIDES
Alguem poderia me dar uma força?
Segue o .sh:
#!/bin/bash
# Script: IPTABLES
#=======================================================================================================================
# Carregar modulo iptable e NAT no Kernel
modprobe ip_nat_ftp
modprobe iptable_nat
#=======================================================================================================================
# Declarando as Variaveis
INTRA=eth1
INTER=eth0
LAN=192.168.254.0/24
#=======================================================================================================================
# Limpando Regras
iptables -F
iptables -t nat -F
iptables -X
iptables -Z
#=======================================================================================================================
# Barrando as entradas | Liberando as saidas
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
#=======================================================================================================================
# Regras
iptables -A INPUT -p tcp -s $LAN --dport 3128 -j ACCEPT # Squid na porta 3128
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128 # Redirecionando http/tcp para o Squid
iptables -t nat -A PREROUTING -i eth1 -p udp --dport 80 -j REDIRECT --to-port 3128 # Redirecionando http/udp para o Squid
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 443 -j REDIRECT --to-port 3128 # Redirecionando https para o Squid
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 41443 -j REDIRECT --to-port 3128 # Redirecionamento SPAM FIEMG
iptables -A INPUT -i lo -j ACCEPT # Liberar Loopback
iptables -A INPUT -p tcp --dport 22 -j ACCEPT # Aceitar conexoes ssh
iptables -A INPUT -p tcp -s $LAN --dport 53 -j ACCEPT # Resolucao de Nomes
iptables -A INPUT -p udp -s $LAN --dport 53 -j ACCEPT # Resolucao de Nomes
iptables -A FORWARD -i $INTRA -p tcp --dport 21 -j ACCEPT # FTP
iptables -A FORWARD -i $INTRA -p tcp --dport 25 -j ACCEPT # SMTP
iptables -A FORWARD -i $INTRA -p tcp --dport 110 -j ACCEPT # POP
iptables -A FORWARD -i $INTRA -p udp --dport 53 -j ACCEPT # DNS
iptables -A FORWARD -i $INTRA -p tcp --dport 53 -j ACCEPT # DNS
iptables -t nat -A POSTROUTING -o $INTER -j MASQUERADE # Mascaramento da Rede Local
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT # Statefull inspection
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # Statefull inspection
#=======================================================================================================================
# Impedindo Ataques
iptables -A INPUT -p tcp --dport 31337 -j DROP # Back Orifice
iptables -A INPUT -p udp --dport 31337 -j DROP # Back Orifice
iptables -A INPUT -p tcp --dport 12345:12346 -j DROP # NetBus
iptables -A INPUT -p udp --dport 12345:12346 -j DROP # NetBus
iptables -A FORWARD -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT # Ping of the Death
iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s -j ACCEPT # Port Scanners
#=======================================================================================================================