reseaux_iptables
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
reseaux_iptables [2010/07/17 10:35] – thierry | reseaux_iptables [2010/07/17 11:16] (Version actuelle) – thierry | ||
---|---|---|---|
Ligne 18: | Ligne 18: | ||
Exemple: | Exemple: | ||
# ferm vite_1.conf | # ferm vite_1.conf | ||
+ | |||
+ | Et hop, le firewall est en service ! | ||
+ | |||
+ | On peut ajouter " | ||
+ | |||
+ | Et aussi " | ||
+ | # ferm -n -l vite_1.conf | ||
+ | # Generated by ferm 2.0.3 on Sat Jul 17 13:10:48 2003 | ||
+ | *filter | ||
+ | :FORWARD ACCEPT [0:0] | ||
+ | :INPUT DROP [0:0] | ||
+ | :OUTPUT ACCEPT [0:0] | ||
+ | -A INPUT --match state --state RELATED, | ||
+ | -A INPUT --protocol tcp --dport http --jump ACCEPT | ||
+ | -A INPUT --protocol tcp --dport ftp --jump ACCEPT | ||
+ | -A INPUT --protocol tcp --dport ssh --jump ACCEPT | ||
+ | COMMIT | ||
+ | |||
+ | Et encore, en règles " | ||
+ | # ferm -n -l --slow vite_1.conf | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | Et enfin, l' | ||
+ | # ferm -i vite_1.conf | ||
+ | | ||
+ | ferm has applied the new firewall rules. | ||
+ | Please type ' | ||
+ | |||
+ | Si on ne tape " | ||
==== simples ==== | ==== simples ==== | ||
- | === vite 1 === | + | === vite_1.conf |
chain INPUT { | chain INPUT { | ||
policy DROP; | policy DROP; | ||
- | proto tcp dport (http ftp ssh) ACCEPT; | + | |
+ | | ||
} | } | ||
+ | === vite_1b.conf === | ||
+ | Ajouter simplement: | ||
+ | chain INPUT if lo ACCEPT; | ||
- | === vite 2 === | + | Cela permet d' |
+ | firefox http:// | ||
- | # interface a autoriser | + | === vite_2.conf === |
- | @def $LAN_IF | + | |
+ | # interface a autoriser | ||
+ | @def $LAN_IF = eth0; | ||
+ | | ||
# Politique par defaut: tout fermer | # Politique par defaut: tout fermer | ||
chain ( INPUT OUTPUT FORWARD ) policy DROP; | chain ( INPUT OUTPUT FORWARD ) policy DROP; | ||
+ | | ||
# autoriser l' | # autoriser l' | ||
chain INPUT if lo ACCEPT; | chain INPUT if lo ACCEPT; | ||
chain OUTPUT of lo ACCEPT; | chain OUTPUT of lo ACCEPT; | ||
+ | | ||
# autoriser quelques entrées | # autoriser quelques entrées | ||
- | chain INPUT if $LAN_IF mod state state ( NEW ESTABLISHED RELATED ) { | + | chain INPUT if $LAN_IF |
- | proto tcp dport ( http ftp ssh ) ACCEPT; | + | |
- | proto udp dport ( openvpn domain ) ACCEPT; | + | proto tcp dport ( http ftp ssh ) ACCEPT; |
- | proto icmp icmp-type echo-request ACCEPT; | + | proto udp dport ( openvpn domain ) ACCEPT; |
+ | proto icmp icmp-type echo-request | ||
+ | } | ||
+ | mod state state ( ESTABLISHED RELATED ) ACCEPT; | ||
} | } | ||
| |
reseaux_iptables.txt · Dernière modification : 2010/07/17 11:16 de thierry