Ajout du tp06
This commit is contained in:
parent
49e9a22250
commit
a116ae4538
17
sisr1/tp06-firewall/current_ruleset.nft
Normal file
17
sisr1/tp06-firewall/current_ruleset.nft
Normal file
@ -0,0 +1,17 @@
|
||||
define netif = enp0s3
|
||||
define lanif = enp0s8
|
||||
define dmzif = enp0s9
|
||||
|
||||
table ip ipfilter {
|
||||
chain routing {
|
||||
type filter hook forward priority filter; policy accept;
|
||||
icmp type echo-request iif { $netif, $dmzif } drop
|
||||
icmp type { echo-reply, echo-request } accept
|
||||
drop
|
||||
}
|
||||
|
||||
chain system_in {
|
||||
type filter hook input priority filter; policy accept;
|
||||
icmp type echo-request iif { $netif, $dmzif } drop
|
||||
}
|
||||
}
|
17
sisr1/tp06-firewall/fw_part1.nft
Normal file
17
sisr1/tp06-firewall/fw_part1.nft
Normal file
@ -0,0 +1,17 @@
|
||||
define netif = enp0s3
|
||||
define lanif = enp0s8
|
||||
define dmzif = enp0s9
|
||||
|
||||
table ip ipfilter {
|
||||
chain routing {
|
||||
type filter hook forward priority filter; policy accept;
|
||||
icmp type echo-request iif { $netif, $dmzif } drop
|
||||
icmp type { echo-reply, echo-request } accept
|
||||
drop
|
||||
}
|
||||
|
||||
chain system_in {
|
||||
type filter hook input priority filter; policy accept;
|
||||
icmp type echo-request iif { $netif, $dmzif } drop
|
||||
}
|
||||
}
|
7
sisr1/tp06-firewall/test_firewall.sh
Normal file
7
sisr1/tp06-firewall/test_firewall.sh
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
ipfirewall=192.168.0.140
|
||||
dir=/root/firewall
|
||||
ruleset=current_ruleset.nft
|
||||
|
||||
scp current_releset.nft root@$ipfirewall:$dir/$ruleset
|
||||
ssh root@$ipfirewall "bash $dir/refresh_firewall.sh"
|
Loading…
x
Reference in New Issue
Block a user