From ada2459bd36eba588680bc06cd2220df1a2e95f5 Mon Sep 17 00:00:00 2001 From: "jm.dupuy" Date: Sun, 19 Jan 2025 09:35:23 +0100 Subject: [PATCH] correction de la mise en page des commandes --- sisr1/tp01-nat-dhcp/nat/README.md | 2 +- sisr1/tp01-nat-dhcp/nat/nat.sh | 6 ++++++ sisr1/tp02-dns/nat/README.md | 4 ++-- sisr1/tp02-dns/nat/nat.sh | 6 ++++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sisr1/tp01-nat-dhcp/nat/README.md b/sisr1/tp01-nat-dhcp/nat/README.md index cf42b15..78b8384 100644 --- a/sisr1/tp01-nat-dhcp/nat/README.md +++ b/sisr1/tp01-nat-dhcp/nat/README.md @@ -1,3 +1,3 @@ * **nat.sh** : script activant la NAT dynamique sans filtrage * A placer à /root/nat.sh - * Rendre exécutable : ''chmod +x /root/nat.sh'' + * Rendre exécutable : //chmod +x /root/nat.sh// diff --git a/sisr1/tp01-nat-dhcp/nat/nat.sh b/sisr1/tp01-nat-dhcp/nat/nat.sh index e69de29..04b2a95 100644 --- a/sisr1/tp01-nat-dhcp/nat/nat.sh +++ b/sisr1/tp01-nat-dhcp/nat/nat.sh @@ -0,0 +1,6 @@ +#!/bin/bash +echo "1" > /proc/sys/net/ipv4/ip_forward +nft add table basic_nat_table +nft add chain basic_nat_table prerouting {type nat hook prerouting priority 0 \; } +nft add chain basic_nat_table postrouting {type nat hook postrouting priority 0 \; } +nft add rule basic_nat_table postrouting masquerade \ No newline at end of file diff --git a/sisr1/tp02-dns/nat/README.md b/sisr1/tp02-dns/nat/README.md index d5c952d..0b7511a 100644 --- a/sisr1/tp02-dns/nat/README.md +++ b/sisr1/tp02-dns/nat/README.md @@ -1,6 +1,6 @@ * **nat.sh** : script activant la NAT dynamique sans filtrage * A placer à /root/nat.sh - * Rendre exécutable : ''chmod +x /root/nat.sh'' + * Rendre exécutable : //chmod +x /root/nat.sh// * **nat.service** : service lançant le script au démarrage * A placer à /etc/systemd/system/nat.service - * Activer le service : ''systemctl enable nat.service'' \ No newline at end of file + * Activer le service : //systemctl enable nat.service// \ No newline at end of file diff --git a/sisr1/tp02-dns/nat/nat.sh b/sisr1/tp02-dns/nat/nat.sh index e69de29..04b2a95 100644 --- a/sisr1/tp02-dns/nat/nat.sh +++ b/sisr1/tp02-dns/nat/nat.sh @@ -0,0 +1,6 @@ +#!/bin/bash +echo "1" > /proc/sys/net/ipv4/ip_forward +nft add table basic_nat_table +nft add chain basic_nat_table prerouting {type nat hook prerouting priority 0 \; } +nft add chain basic_nat_table postrouting {type nat hook postrouting priority 0 \; } +nft add rule basic_nat_table postrouting masquerade \ No newline at end of file