Clean all iptables rules on stop
Prevents the "iptables: Chain already exists." error by making sure that we don't leave any chain on start. The ideal solution is to use iptables-restore instead, which will do the right job. But this needs to be changed in NixOS entirely. Reviewed-by: Aleix Boné <abonerib@bsc.es>
This commit is contained in:
		
							parent
							
								
									a912b76ab4
								
							
						
					
					
						commit
						27636dc66e
					
				| @ -56,6 +56,11 @@ | ||||
|         iptables -A nixos-fw -p tcp -s 10.0.40.30 --dport 23080 -j nixos-fw-log-refuse | ||||
|         iptables -A nixos-fw -p tcp -s 10.0.40.0/24 --dport 23080 -j nixos-fw-accept | ||||
|       ''; | ||||
|       # Flush all rules and chains on stop so it won't break on start | ||||
|       extraStopCommands = '' | ||||
|         iptables -F | ||||
|         iptables -X | ||||
|       ''; | ||||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user