Abri porta no SQUID/IPTABLES (25, 110 ...) [RESOLVIDO]

1. Abri porta no SQUID/IPTABLES (25, 110 ...) [RESOLVIDO]

Angelo Biscola
angelo_ti

(usa Outra)

Enviado em 26/07/2010 - 10:54h

Bom dia galera preciso de um forç aqui no meu servidor, esta funcionndo 90%

Tenho conecçao na internet, tenho as regras no squid, so nao consegui liberar as portas para outlook 25, 110

como faço isso, segue minha configuraçao firewall



#!/bin/bash

################

## INTERFACES ##

################

REDE='eth0'

INTERNET='eth1'

REDE_INT='192.168.0.0/24'

##########################

echo "SUBINDO INTERFACES"...............[ok]



############################

## FLUSHANDO TODAS REGRAS ##

############################

iptables -F

iptables -t nat -F

iptables -X

iptables -t mangle -F

iptables -t mangle -X

##############################

echo "FLUSHANDO TODAS AS REGRAS"...........[ok]



#########################

## DEFINANDO POLITICAS ##

#########################

iptables -P INPUT DROP

iptables -P OUTPUT ACCEPT

iptables -P FORWARD ACCEPT

iptables -t nat -P PREROUTING ACCEPT

iptables -t nat -P POSTROUTING ACCEPT

iptables -t nat -P OUTPUT ACCEPT

#######################################

echo "DEFININDO POLITICAS"...........[ok]



########################

## CARREGANDO MÃDULOS ##

########################

/sbin/modprobe ip_tables

/sbin/modprobe ip_conntrack

/sbin/modprobe ip_nat_ftp

/sbin/modprobe ip_conntrack_ftp

/sbin/modprobe iptable_nat

/sbin/modprobe iptable_mangle

/sbin/modprobe ipt_mark

/sbin/modprobe ipt_MARK

/sbin/modprobe ipt_LOG

/sbin/modprobe ipt_REJECT

/sbin/modprobe ipt_MASQUERADE

/sbin/modprobe ipt_TOS

###############################

echo "CARREGANDO MODULOS"...........[ok]





######################

## ATIVA ROTEAMENTO ##

######################

## HABILITA O ROTEAMENTO ##

echo "1" > /proc/sys/net/ipv4/ip_forward

###########################

echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts





###################

## ENTRADA INPUT ##

###################

iptables -A INPUT -i Lo -j ACCEPT

iptables -A INPUT -p icmp -m limit --limit 3/m --limit-burst 3 -j ACCEPT

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

#####################

echo "ENTRADA INPUT"...........[ok]



#########################

#########################

## PING INTERNO ##

#########################

iptables -A INPUT -p icmp -s 192.168.0.0/24 -d 192.168.0.0/24 -j ACCEPT

#########################

echo "PING INTERNO"...........[ok]





##################################

## OUTPUT (LIBERA PACOTES DE ##

## RETORNO DA INTERNET) ##

##################################

iptables -A OUTPUT -m state --state ESTABLISHED,RELATED,NEW -j ACCEPT

#####################################################################

echo "OUTPUT"...........[ok]





#####################

## PROTOCOLO ICMP ##

#####################

iptables -A INPUT -p ICMP -j ACCEPT

iptables -A INPUT -p ICMP -s 0/0 --icmp-type 0 -j ACCEPT

iptables -A INPUT -p ICMP -s 0/0 --icmp-type 3 -j ACCEPT

iptables -A INPUT -p ICMP -s 0/0 --icmp-type 8 -j ACCEPT

iptables -A INPUT -p ICMP -s 0/0 --icmp-type source-quench -j ACCEPT

iptables -A INPUT -p ICMP -s 0/0 --icmp-type parameter-problem -j ACCEPT

#############################################################################

echo "PROTOCOLO ICMP"...........[ok]





################################

## ATIVA O MASCARAMENTO (NAT) ##

## AMIGO JUCINALDO RECOMENDOU ##

################################

iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -o eth1 -j MASQUERADE

##########################################################

echo "ATIVA O MASCARAMENTO NAT"...........[ok]







#########################

## Abre para Redelocal ##

#########################

iptables -A INPUT -p tcp --syn -s 192.168.0.0/255.255.255.0 -j ACCEPT

###################################





#####################################

## DIRECIONA DA 80 PARA 3128 SQUID ##

#####################################

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128

iptables -t nat -A PREROUTING -i eth0 -p udp --dport 80 -j REDIRECT --to-port 3128

############################################

echo "DIRECIONA 80 PARA 3128 SQUID"...........[ok]





qual comando devo usar para abrir as portas 25, 110 e outras mais que precise.



  


2. Re: Abri porta no SQUID/IPTABLES (25, 110 ...) [RESOLVIDO]

Renato Carneiro Pacheco
renato_pacheco

(usa Debian)

Enviado em 26/07/2010 - 11:09h

Hhaiuahiuahuihuia!!! Tou rindo até agora! FLUSHANDO!!! Véi, para d aportuguesar as coisas. Coloque DESCARREGANDO ou LIMPANDO q fica beeeeem melhor.

Aonde é q tá o seu server d DNS, SMTP e POP3? Ou é webmail?


3. Re: Abri porta no SQUID/IPTABLES (25, 110 ...) [RESOLVIDO]

Angelo Biscola
angelo_ti

(usa Outra)

Enviado em 26/07/2010 - 11:37h

nao entendi muito bem sua pergunta, preciso fazer um acesso externo em SMTP e POP3.


4. Re: Abri porta no SQUID/IPTABLES (25, 110 ...) [RESOLVIDO]

Renato Carneiro Pacheco
renato_pacheco

(usa Debian)

Enviado em 26/07/2010 - 12:47h

Kra, tente então liberar o INPUT pra DNS (porta 53).






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts