Bonjour tout le monde,
Malgré mes recherches sur le forum et ailleurs, je n’ai malgré tout pas réussi à autoriser mon poste client sous debian à ping le web (ex: google). Aucun souci pour la navigation mais le ping est impossible. Ce qui, vous le comprendrez, pose problème lors d’installation de paquets…
Synthétiquement, voici mon réseau:
Freebox —> serveur proxy 192.168.0.31 en eth0 (wan) et 192.168.2.100 en eth1 (lan) —> switch —> client debian 192.168.2.x (eth0). x est attribué par le couple DHCP&DDNS du proxy.
Ping proxy <—> client ==> pose aucun problème
Ping client —> google.fr
Ping client —> 74.125.132.94 ==> ping se lance mais aucun résultat
[code]# The loopback network interface
auto lo
iface lo inet loopback
The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
This is an autoconfigured IPv6 interface
iface eth0 inet6 auto
#Config eth1 pour reseau le lan
auto eth1
iface eth1 inet static
address 192.168.2.100
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
#gateway 192.16.2.100
echo 1 > /proc/sys/net/ipv4/ip_forward
[/code]
Voici les règles iptables:
[code]#Pour accepter tout ce qui se passe sur le réseau local.
iptables -A INPUT -i eth1 -j ACCEPT
iptables -A OUTPUT -o eth1 -j ACCEPT
iptables -A FORWARD -i eth1 -j ACCEPT
iptables -A FORWARD -i eth1 -j ACCEPT
#pour activer le NAT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.2.0/24 -j SNAT --to-source 192.168.0.31
#Pour Accepter la resolution de nom DNS pour le firewall
iptables -A INPUT -i eth0 -p udp --sport 53 -j ACCEPT
iptables -A OUTPUT -o eth0 -p udp --dport 53 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --sport 53 -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --dport 53 -j ACCEPT
Ouvrir le http
iptables -A OUTPUT -p tcp -o eth0 --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -i eth0 --sport 80 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p udp -o eth0 --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p udp -i eth0 --sport 80 -m state --state ESTABLISHED,RELATED -j ACCEPT
Ouvrir le https
iptables -A OUTPUT -p tcp -o eth0 --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -i eth0 --sport 443 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p udp -o eth0 --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p udp -i eth0 --sport 443 -m state --state ESTABLISHED,RELATED -j ACCEPT
autorise les paquets icmp (ping, traceroute, etc.) de mon ordinateur vers internet
(mais pas d’internet vers mon ordinateur)
iptables -A INPUT -i eth0 -p icmp -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p icmp -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT[/code]
iptables -L[code]
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all – anywhere anywhere
ACCEPT udp – anywhere anywhere udp spt:domain
ACCEPT tcp – anywhere anywhere tcp spt:domain
ACCEPT tcp – anywhere anywhere tcp spt:http state RELATED,ESTABLISHED
ACCEPT udp – anywhere anywhere udp spt:http state RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp spt:https state RELATED,ESTABLISHED
ACCEPT udp – anywhere anywhere udp spt:https state RELATED,ESTABLISHED
ACCEPT icmp – anywhere anywhere state RELATED,ESTABLISHED
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all – anywhere anywhere
ACCEPT all – anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all – anywhere anywhere
ACCEPT udp – anywhere anywhere udp dpt:domain
ACCEPT tcp – anywhere anywhere tcp dpt:domain
ACCEPT tcp – anywhere anywhere tcp dpt:http state NEW,ESTABLISHED
ACCEPT udp – anywhere anywhere udp dpt:http state NEW,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp dpt:https state NEW,ESTABLISHED
ACCEPT udp – anywhere anywhere udp dpt:https state NEW,ESTABLISHED
ACCEPT icmp – anywhere anywhere state NEW,RELATED,ESTABLISHED
[/code]
route -n
Destination Passerelle Genmask Indic Metric Ref Use Iface
0.0.0.0 192.168.0.254 0.0.0.0 UG 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
/etc/squid/squid.conf
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
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 Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access allow all
http_access deny all
icp_access allow localnet
icp_access deny all
http_port 3128 transparent
hierarchy_stoplist cgi-bin ?
access_log /var/log/squid/access.log squid
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880
refresh_pattern . 0 20% 4320
acl shoutcast rep_header X-HTTP09-First-Line ^ICY.[0-9]
upgrade_http0.9 deny shoutcast
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
hosts_file /etc/hosts
coredump_dir /var/spool/squid
Je m’en remet à votre aide…