:: Re: [DNG] How to turn off the firew…
Góra strony
Delete this message
Reply to this message
Autor: Federico Fanton
Data:  
Dla: dng
Temat: Re: [DNG] How to turn off the firewall
On 22/02/21 16:29, Steve Litt wrote:

> On a Devuan machine, how do I turn off the firewall entirely, so all
> ports are accessible? I need to do this for experimentation, not as a
> permanent thing.


To completely reset the firewall, see this script:

#!/usr/bin/env bash
set -eu
declare -A chains=(
     [filter]=INPUT:FORWARD:OUTPUT
     [raw]=PREROUTING:OUTPUT
     [mangle]=PREROUTING:INPUT:FORWARD:OUTPUT:POSTROUTING
     [security]=INPUT:FORWARD:OUTPUT
     [nat]=PREROUTING:INPUT:OUTPUT:POSTROUTING
)
for table in "${!chains[@]}"; do
     echo "${chains[$table]}" | tr : $"\n" | while IFS= read -r; do
         iptables -t "$table" -P "$REPLY" ACCEPT
     done
     iptables -t "$table" -F
     iptables -t "$table" -X
done


(from https://gist.github.com/x-yuri/da5de61959ae118900b685fed78feff1 )

Bye!