Bon j'ai un peu avancé. maintenant ça marche. Ce qui m'intéresserait, ça serait de cibler un peu mieux la provenance
Code :
- iext = "tun0"
- iint = "rl0"
- iloop = "lo0"
-
- noroute = "{ 127.0.0.1/8, 192.168.1.0/24, 255.255.255.255/32, 10.0.0.0/8 }"
-
-
- # normalisation des paquets
- scrub in all
-
-
- nat on $iext from 192.168.1.0/24 to any -> tun0
-
- # on bloque tout par defaut sur tun0
- block in log on $iext all
- block out log on $iext all
-
- # on bloque tous les paquets ipv6
- block in quick inet6 all
- block out quick inet6 all
-
- # spoofing non-routeable address
- block in log quick on $iext from $noroute to any
- block out log quick on $iext from any to $noroute
-
- # broadcast
- block in quick on $iext from any to 255.255.255.255
-
- #FIXME
- # on autorise tout par defaut en local
- pass in on $iint all
- pass out on $iint all
-
- # on autorise tout en loopback
- pass in quick on $iloop all
- pass out quick on $iloop all
-
- # web
- pass out on $iext inet proto tcp from any to any port 80 keep state
-
- # dns
- pass out on $iext inet proto udp from any to any port 53 keep state
-
- # icmp
- pass out on $iext inet proto icmp all icmp-type 8 code 0 keep state
-
- # pop
- pass out on $iext proto tcp from any to any port 110 keep state
|
En fait, pour le "pop" (par ex), je voudrais que la machine 192.168.1.1 ait uniquement le droit de poper ses mails. lorsque je met any, ça marche mais si je remplace any par 192.168.1.1, ca marche plus.