Vous n'êtes pas identifié(e).
L'icône rouge permet de télécharger chaque page du wiki visitée au format
PDF et la grise au format ODT →
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente | Prochaine révision Les deux révisions suivantes | ||
utilisateurs:hypathie:tutos:proxy-transparent [17/10/2014 16:40] Hypathie [Configuration de squid comme proxy transparent] |
utilisateurs:hypathie:tutos:proxy-transparent [17/10/2014 16:48] Hypathie [configuration d'iptables (NAT)] |
||
---|---|---|---|
Ligne 298: | Ligne 298: | ||
<code>Chain PREROUTING (policy ACCEPT) | <code>Chain PREROUTING (policy ACCEPT) | ||
- | target prot opt source destination | + | target prot opt source destination |
- | DNAT tcp -- anywhere anywhere tcp dpt:http to:192.168.1.1:3128 | + | ACCEPT tcp -- debian-serveur.mondomaine.hyp anywhere tcp dpt:http |
- | REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 3128 | + | DNAT tcp -- anywhere anywhere tcp dpt:http to:192.168.0.1:3128 |
+ | REDIRECT tcp -- 192.168.1.0/24 anywhere tcp dpt:http redir ports 3128 | ||
Chain INPUT (policy ACCEPT) | Chain INPUT (policy ACCEPT) | ||
Ligne 312: | Ligne 313: | ||
MASQUERADE all -- anywhere anywhere</code> | MASQUERADE all -- anywhere anywhere</code> | ||
+ | <code root>iptables -L PREROUTING -t mangle</code> | ||
+ | <code>iptables -L -t mangle | ||
+ | Chain PREROUTING (policy ACCEPT) | ||
+ | target prot opt source destination | ||
+ | DROP tcp -- anywhere anywhere tcp dpt:3128</code> | ||
+ | |||
+ | <note> | ||
+ | Pour mangle, une petite citation extrait du [[http://wiki.squid-cache.org/ConfigExamples/Intercept/LinuxDnat|site officiel de squid]] : | ||
+ | <code> | ||
+ | Due to the NAT security vulnerabilities it is also a very good idea to block external access to the internal receiving port. This has to be done in the mangle part of iptables before DNAT happens so that intercepted traffic does not get dropped. | ||
+ | |||
+ | **Par contre, concernant les deux interfaces, il faut lancer les commandes iptables pour le DNAT sur les deux interfaces, puisque squid est installé sur l'interface du DNS i.e eth0.** | ||
+ | </code> | ||
+ | </note> | ||
===Configurer /etc/sysctl.conf === | ===Configurer /etc/sysctl.conf === | ||
* Vérifier que les lignes suivantes comportes ces valeurs : | * Vérifier que les lignes suivantes comportes ces valeurs : |