[GTER] SQUID squid-3.1.0.14 + TPROXY

Renato Murilo Langona renato at linuxsecurity.com.br
Thu Nov 19 18:11:34 -02 2009


Aparentemente seu procedimento esta correto. De qualquer forma, como 
utiliza bridge e tem outras interfaces na maquina provavelmente, vc 
utiliza tcp_outgoing_address xxx.xxx.xxx.xxx em seu squid.conf?

Abs!

Luzivan escreveu:
> Estou usando squid 3.1.14, compilado para aumentar o numero de FDs e também
> compiliar com a opcao de FS = diskd e aufs. Estou usando SO Debian 5.0 R3,
> estou usando tproxy 4.1, já teste com a opcao tcp_outgoing_address e sem
> ela, dá o mesmo erro, estou usando a porta 3129 e redirecionando com
> iptables pra ela. Segue os redirect que estou fazendo e também os DROP
> necessários com ebtables, pois este servidor está em bridge.
>
> ###### EBTABLES #########
> /sbin/ebtables -t broute -F
>
> ## eth4 =  interface é de saida para internet
> /sbin/ebtables -t broute -A BROUTING -i eth4 -p ipv4 --ip-proto tcp
> --ip-sport 80 -j redirect --redirect-target DROP
>
>
> ## eth5 - Interface de entrada do trafego
> /sbin/ebtables -t broute -A BROUTING -i eth5 -p ipv4 --ip-proto tcp
> --ip-dport 80 -j redirect --redirect-target DROP
>
>
> ###### IPTABLES ######
> $IPT -t mangle -N DIVERT
> $IPT -t mangle -A DIVERT -j MARK --set-mark 1
> $IPT -t mangle -A DIVERT -j ACCEPT
> $IPT -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
> $IPT -t mangle -A PREROUTING -p tcp --dport 80 -j TPROXY --on-port 3129
>
> ## ETH5 nesta interface está ligado o cabo de entrada de todo o trafego dos
> clientes
> IPT -t mangle -A PREROUTING -p tcp -i eth5 --dport 80 -j TPROXY
> --tproxy-mark 0x1/0x1 --on-port 3129
>
> ip rule add fwmark 1 lookup 100
> ip route add local 0.0.0.0/0 dev lo table 100
> echo 0 > /proc/sys/net/ipv4/conf/lo/rp_filter
> echo 1 > /proc/sys/net/ipv4/ip_forward
>
> OBS: As interfaces eth4 e eth5 estão na bridge br0
>
> #### BRIDGE ###
> iface br0 inet static
>         bridge_ports eth4 eth5
>         adress xxx.xx.xxx.xx
>         netmask 255.255.255.224
>         gateway xxx.xx.xxx.xx
>
> /usr/sbin/brctl addbr br0
> /usr/sbin/brctl addif br0 eth4
> /usr/sbin/brctl addif br0 eth5
>
> /sbin/ifconfig br0 xxx.xx.xxx.xx netmask 255.255.255.224
> /sbin/ifconfig eth4 0.0.0.0
> /sbin/ifconfig eth5 0.0.0.0
>
> /sbin/ifconfig eth4 up
> /sbin/ifconfig eth5 up
>
>
>
> 2009/11/19 Renato Murilo Langona <renato at linuxsecurity.com.br>
>
>   
>> Voce esta tentando utilizar a mesma versao acima, do amigo Marcelus? Esta
>> com o tproxy habilitado no kernel e no netfilter, assim como no squid
>> (versao 3.1 ja tem incorporado)? Esta utilizando a opcao
>> tcp_outgoing_address em seu squid.conf? Adicione uma porta de conexao direta
>> no seu squid http_port 3130 e faca um redirect simples para ela, para testar
>> se esta tudo ok com sua conf tbem... Se quiser maior debugging das msgs e
>> erros, utilize a opcao X ao inicializar o servico...
>>
>> Abs!
>>
>> Luzivan escreveu:
>>
>>  Prezado Renado Murilo, o Marcelus já tem um Squid em funcionamento com o
>>     
>>> tproxy, eu estou tentando colocar o meu pra funcionar, mas até o momento
>>> não
>>> conseguir fazer com o squid pare de reportar este problema.
>>>
>>> commBind: Cannot bind socket FD 987 to xxx.xxx.xxx.xxx: (22) Invalid
>>> argument
>>> WARNING: Reset of FD 987 for xxx.xxx.xxx.xxx failed to bind: (22) Invalid
>>> argument
>>> commBind: Cannot bind socket FD 987 to xxx.xxx.xxx.xxx: (22) Invalid
>>> argument
>>> WARNING: Reset of FD 987 for xxx.xxx.xxx.xxx failed to bind: (22) Invalid
>>> argument
>>> commBind: Cannot bind socket FD 1059 to xxx.xxx.xxx.xxx: (22) Invalid
>>> argument
>>> WARNING: Reset of FD 1059 for xxx.xxx.xxx.xxx failed to bind: (22) Invalid
>>> argument
>>> commBind: Cannot bind socket FD 1059 to xxx.xxx.xxx.xxx: (22) Invalid
>>> argument
>>> WARNING: Reset of FD 1059 for xxx.xxx.xxx.xxx failed to bind: (22) Invalid
>>> argument
>>> commBind: Cannot bind socket FD 1094 to xxx.xxx.xxx.xxx: (22) Invalid
>>> argument
>>> WARNING: Reset of FD 1094 for xxx.xxx.xxx.xxx failed to bind: (22) Invalid
>>> argument
>>> commBind: Cannot bind socket FD 1094 to xxx.xxx.xxx.xxx: (22) Invalid
>>> argument
>>> WARNING: Reset of FD 1094 for xxx.xxx.xxx.xxx failed to bind: (22) Invalid
>>> argument
>>> commBind: Cannot bind socket FD 1109 to xxx.xxx.xxx.xxx: (22) Invalid
>>> argument
>>> WARNING: Reset of FD 1109 for xxx.xxx.xxx.xxx failed to bind: (22) Invalid
>>> argument
>>> commBind: Cannot bind socket FD 1109 to xxx.xxx.xxx.xxx: (22) Invalid
>>> argument
>>> WARNING: Reset of FD 1109 for xxx.xxx.xxx.xxx failed to bind: (22) Invalid
>>> argument
>>>
>>> Isto começa acontecer logo que começa o trafego e ninguem navega.
>>>
>>> 2009/11/19 Renato Murilo Langona <renato at linuxsecurity.com.br>
>>>
>>>
>>>
>>>       
>> --
>> gter list    https://eng.registro.br/mailman/listinfo/gter
>>
>>     
>
>
>
>   




More information about the gter mailing list