› Foros › PC › Software libre
iptables -t nat -A PREROUTING -p tcp -m tcp -s 192.168.1.0/24 --dport 80 -j DNAT --to-destination 192.168.1.2:3128
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.0/24 -j MASQUERADE
People frequently ask How can I exclude certain internal systems from using the proxy? I want to allow those systems to go directly to the net.
Suppose that you want to exclude 192.168.1.5 and 192.168.1.33 from the proxy. Your rules would then be:
#ACTION SOURCE DEST PROTO DEST PORT(S) SOURCE ORIGINAL
# PORT(S) DEST
ACCEPT $FW net tcp www
REDIRECT loc:!192.168.1.5,192.168.1.33\
3128 tcp www - !206.124.146.177,130.252.100.0/24
ACCEPT loc net tcp www
theelf escribió:Hola, creo q no es lo mismo que en tu caso, pero al menos puede ser de ayuda
Hace tiempo atras, en una empresa donde hago serv tecnico, monte un proxy con squid y shorewall.
Resulta que tenia que excluir algunos IP para q fueran directamente a internet (contabilidad, gerencia..) y lo hice siguiendo la ayuda de este documento
http://www.shorewall.net/Shorewall_Squid_Usage.htmlPeople frequently ask How can I exclude certain internal systems from using the proxy? I want to allow those systems to go directly to the net.
Suppose that you want to exclude 192.168.1.5 and 192.168.1.33 from the proxy. Your rules would then be:
#ACTION SOURCE DEST PROTO DEST PORT(S) SOURCE ORIGINAL
# PORT(S) DEST
ACCEPT $FW net tcp www
REDIRECT loc:!192.168.1.5,192.168.1.33\
3128 tcp www - !206.124.146.177,130.252.100.0/24
ACCEPT loc net tcp www
Espero sea de utilidad
iptables -t nat -N nat_rule.1
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j nat_rule.1
iptables -t nat -A nat_rule.1 -d 192.168.1.2 -j RETURN
iptables -t nat -N nat_rule.0
iptables -t nat -A nat_rule.1 -p tcp -m tcp --dport 80 -j nat_rule.0
iptables -t nat -A nat_rule.0 -s 192.168.1.22 -j RETURN
iptables -t nat -A nat_rule.0 -s 192.168.1.57 -j RETURN
iptables -t nat -A nat_rule.0 -s 192.168.1.58 -j RETURN
iptables -t nat -A nat_rule.0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.1.2:3128