2016-09-08 07:05:43 +08:00
|
|
|
alias fw="sudo firewall-cmd"
|
|
|
|
alias fwp="sudo firewall-cmd --permanent"
|
|
|
|
alias fwr="sudo firewall-cmd --reload"
|
|
|
|
alias fwrp="sudo firewall-cmd --runtime-to-permanent"
|
2016-09-07 19:56:19 +08:00
|
|
|
|
|
|
|
function fwl () {
|
|
|
|
# converts output to zsh array ()
|
|
|
|
# @f flag split on new line
|
2018-08-30 02:57:02 +08:00
|
|
|
zones=("${(@f)$(sudo firewall-cmd --get-active-zones | grep -v 'interfaces\|sources')}")
|
2016-09-07 19:56:19 +08:00
|
|
|
|
|
|
|
for i in $zones; do
|
2023-10-24 19:33:04 +08:00
|
|
|
sudo firewall-cmd --zone ${i/ \(default\)} --list-all
|
2016-09-07 19:56:19 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
echo 'Direct Rules:'
|
2016-09-08 07:05:43 +08:00
|
|
|
sudo firewall-cmd --direct --get-all-rules
|
2016-09-07 19:56:19 +08:00
|
|
|
}
|