82 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			82 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| Etape 1 : Toutes les requêtes entrantes sont bloquées par défaut.
 | |
| 
 | |
| table ip ipfilter{
 | |
|  
 | |
| 	chain prerouting {
 | |
| 		type filter hook prerouting priority filter; policy drop;
 | |
| 	}
 | |
|  
 | |
| 	chain input {
 | |
| 		type filter hook input priority filter; policy drop;
 | |
| 	}
 | |
|  
 | |
| 	chain routing {
 | |
| 		type filter hook forward priority filter; policy drop;
 | |
| 	}
 | |
|  
 | |
| 	chain output {
 | |
| 		type filter hook output priority filter; policy drop;
 | |
| 	}
 | |
|  
 | |
| 	chain postrouting {
 | |
| 		type filter hook postrouting priority filter; policy drop;
 | |
| 	}
 | |
|  
 | |
| }
 | |
| 
 | |
| Etape 2: Pare-feu accessible en SSH depuis le réseau sio
 | |
| 
 | |
| define firewall_internet = 192.168.0.160
 | |
| 
 | |
| Ajouter dans chaines PREROUTING et INPUT  :
 | |
| 
 | |
| 	tcp dport 22 ip daddr $firewall_internet accept
 | |
| 
 | |
| Ajouter dans les 5 chaines : 
 | |
| 	ct state established,related accept
 | |
| 
 | |
| 
 | |
| Etape 3 : Les deux serveurs sont accessibles en SSH uniquement depuis le pare-feu
 | |
| 
 | |
| define dmzip = 172.17.0.254
 | |
| define lanip = 172.16.0.254
 | |
| define srv_dmz = 172.17.0.1
 | |
| define srv_lan = 172.16.0.1
 | |
| 
 | |
| Ajouter dans chaines PREROUTING system_in system_out postrooting
 | |
| 
 | |
| tcp dport 22 ip saddr $dmzip ip daddr $srv_dmz accept  
 | |
| tcp dport 22 ip saddr $lanip ip daddr $srv_lan accept 
 | |
| 
 | |
| Etape 4 :Le réseau interne doit pouvoir ping la DMZ ; le pare-feu doit pouvoir ping toutes les machines ; 
 | |
| tous les autres pings sont désactivés.
 | |
| 
 | |
| define dmz-ntw = 172.17.0.1-172.17.0.254
 | |
| define lan-ntw = 172.16.0.1-172.16.0.254
 | |
| 
 | |
| 
 | |
|   chain prerouting {
 | |
|                         # gestion des pings
 | |
|                 icmp type echo-request iif $lanif ip daddr $dmz-ntw accept
 | |
|                 icmp type echo-reply accept
 | |
| }
 | |
| 
 | |
| chain routing {
 | |
|                 type filter hook forward priority filter; policy drop;
 | |
|                         # gestion des pings
 | |
|                 icmp type echo-request iif $lanif oif $dmzif accept
 | |
|                 icmp type echo-reply iif $dmzif oif $lanif accept
 | |
| }
 | |
| 
 | |
| 
 | |
| chain postrouting {
 | |
|                         # gestion des pings
 | |
|                 icmp type echo-request ip saddr $lan-ntw ip daddr $dmz-ntw accept
 | |
|                 icmp type echo-reply ip saddr dmz-ntw oif lan-ntw accept
 | |
| 
 | |
| }
 | |
| 
 | |
| Etape 5 :
 | |
| 
 | |
| 
 |