La configuration du proxy:
-Interface externe eth0 IP 192.168.1.199
-Interface interne eth1 IP 193.168.1.10
J'ai configuré le routage comme ceci:
iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
Routage IP activé:
echo "1" > /proc/sys/net/ipv4/ip_forward
Les clients du réseau interne sont configuré pour utiliser la passerelle 192.168.1.10
J'ai fait une redirection du port 80 vers le port de squid3 et j'ai ouvert le port 3128 coté interne:
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -A INPUT -i eth1 -p tcp --dport 3128 -j ACCEPT
Et voici le contenu de mon fichier squid.conf:
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl localnet src 193.168.1.0/24
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
[^] # Re: manque quelques infos
Posté par tony45 . En réponse au message Iptables impossible de faire du NAT sur une passerelle. Évalué à 0.
Bonjour nono14,
La configuration du proxy:
-Interface externe eth0 IP 192.168.1.199
-Interface interne eth1 IP 193.168.1.10
J'ai configuré le routage comme ceci:
iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
Routage IP activé:
echo "1" > /proc/sys/net/ipv4/ip_forward
Les clients du réseau interne sont configuré pour utiliser la passerelle 192.168.1.10
J'ai fait une redirection du port 80 vers le port de squid3 et j'ai ouvert le port 3128 coté interne:
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -A INPUT -i eth1 -p tcp --dport 3128 -j ACCEPT
Et voici le contenu de mon fichier squid.conf:
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl localnet src 193.168.1.0/24
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access allow localnet
http_access deny all
http_port 3128 transparent
hierarchy_stoplist cgi-bin ?
coredump_dir /var/spool/squid3
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
En espérant que cela t'aide a trouvé où est mon problème.
Merci de ton aide.