elio lafourcade
This commit is contained in:
		
							
								
								
									
										6
									
								
								sisr1/tp02-dns/nat/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								sisr1/tp02-dns/nat/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
  * **nat.sh** : script activant la NAT dynamique sans filtrage
 | 
			
		||||
    * A placer à /root/nat.sh
 | 
			
		||||
    * Rendre exécutable : <code>chmod +x /root/nat.sh</code>
 | 
			
		||||
  * **nat.service** : service lançant le script au démarrage
 | 
			
		||||
    * A placer à /etc/systemd/system/nat.service
 | 
			
		||||
    * Activer le service : <code>systemctl enable nat.service</code>
 | 
			
		||||
							
								
								
									
										13
									
								
								sisr1/tp02-dns/nat/nat.service
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								sisr1/tp02-dns/nat/nat.service
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
[Unit]
 | 
			
		||||
 
 | 
			
		||||
Description=execute /root/nat.sh
 | 
			
		||||
 
 | 
			
		||||
After=default.target
 | 
			
		||||
 
 | 
			
		||||
[Service]
 | 
			
		||||
 
 | 
			
		||||
ExecStart=bash /root/nat.sh
 | 
			
		||||
 
 | 
			
		||||
[Install]
 | 
			
		||||
 
 | 
			
		||||
WantedBy=default.target
 | 
			
		||||
							
								
								
									
										6
									
								
								sisr1/tp02-dns/nat/nat.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								sisr1/tp02-dns/nat/nat.sh
									
									
									
									
									
										Normal file
									
								
							@@ -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
 | 
			
		||||
		Reference in New Issue
	
	Block a user