Hi.
we have got system - Rocky Linux release 9.5
which default missing iptables commands , system using only NFT.
compiled fwcloud script contains references to iptables commands per example to clear firewall:
whole script is working fine but there are errors on startup:
error are caused by missing "iptables" command,
how can modify compilation process to don't use iptables command on NFT only system ?
in fwcloud config this firewall is set compiler to NFT
we have got system - Rocky Linux release 9.5
which default missing iptables commands , system using only NFT.
compiled fwcloud script contains references to iptables commands per example to clear firewall:
Code:
iptables_default_filter_policy() {
$IPTABLES -P OUTPUT $1
$IPTABLES -P INPUT $1
$IPTABLES -P FORWARD $1
$IP6TABLES -P OUTPUT $1
$IP6TABLES -P INPUT $1
$IP6TABLES -P FORWARD $1
}
reset_iptables_v4() {
$IPTABLES --flush
$IPTABLES -X
$IPTABLES --flush
$IPTABLES --flush FORWARD
$IPTABLES --flush INPUT
$IPTABLES --flush OUTPUT
$IPTABLES --table nat --flush
$IPTABLES --table nat --delete-chain
$IPTABLES --table mangle --flush
$IPTABLES --table mangle --delete-chain
$IPTABLES --delete-chain
}
whole script is working fine but there are errors on startup:
Code:
Nov 28 08:10:01 host fwcloud.sh[5466]: FWCloud.net - Loading firewall policy generated: Wed Nov 20 2024 08:11:04 GMT+0100 (Central European Standard Time)
Nov 28 08:10:01 host fwcloud.sh[5523]: /etc/fwcloud/fwcloud.sh: line 66: --flush: command not found
Nov 28 08:10:01 host fwcloud.sh[5524]: /etc/fwcloud/fwcloud.sh: line 67: -X: command not found
Nov 28 08:10:01 host fwcloud.sh[5525]: /etc/fwcloud/fwcloud.sh: line 68: --flush: command not found
Nov 28 08:10:01 host fwcloud.sh[5526]: /etc/fwcloud/fwcloud.sh: line 69: --flush: command not found
Nov 28 08:10:01 host fwcloud.sh[5527]: /etc/fwcloud/fwcloud.sh: line 70: --flush: command not found
Nov 28 08:10:01 host fwcloud.sh[5528]: /etc/fwcloud/fwcloud.sh: line 71: --flush: command not found
Nov 28 08:10:01 host fwcloud.sh[5529]: /etc/fwcloud/fwcloud.sh: line 72: --table: command not found
Nov 28 08:10:01 host fwcloud.sh[5530]: /etc/fwcloud/fwcloud.sh: line 73: --table: command not found
Nov 28 08:10:01 host fwcloud.sh[5531]: /etc/fwcloud/fwcloud.sh: line 74: --table: command not found
Nov 28 08:10:01 host fwcloud.sh[5532]: /etc/fwcloud/fwcloud.sh: line 75: --table: command not found
Nov 28 08:10:01 host fwcloud.sh[5533]: /etc/fwcloud/fwcloud.sh: line 76: --delete-chain: command not found
Nov 28 08:10:01 host fwcloud.sh[5534]: /etc/fwcloud/fwcloud.sh: line 82: -t: command not found
Nov 28 08:10:01 host fwcloud.sh[5536]: /etc/fwcloud/fwcloud.sh: line 87: -t: command not found
Nov 28 08:10:01 host fwcloud.sh[5537]: /etc/fwcloud/fwcloud.sh: line 82: -t: command not found
Nov 28 08:10:01 host fwcloud.sh[5539]: /etc/fwcloud/fwcloud.sh: line 87: -t: command not found
Nov 28 08:10:01 host fwcloud.sh[5540]: /etc/fwcloud/fwcloud.sh: line 82: -t: command not found
Nov 28 08:10:01 host fwcloud.sh[5542]: /etc/fwcloud/fwcloud.sh: line 87: -t: command not found
Nov 28 08:10:01 host fwcloud.sh[5466]: ******************************
Nov 28 08:10:01 host fwcloud.sh[5466]: * NFTABLES TABLES AND CHAINS *
Nov 28 08:10:01 host fwcloud.sh[5466]: ******************************
Nov 28 08:10:01 host fwcloud.sh[5578]: /etc/fwcloud/fwcloud.sh: line 44: -P: command not found
Nov 28 08:10:01 host fwcloud.sh[5579]: /etc/fwcloud/fwcloud.sh: line 45: -P: command not found
Nov 28 08:10:01 host fwcloud.sh[5580]: /etc/fwcloud/fwcloud.sh: line 46: -P: command not found
Nov 28 08:10:01 host fwcloud.sh[5581]: /etc/fwcloud/fwcloud.sh: line 47: -P: command not found
Nov 28 08:10:01 host fwcloud.sh[5582]: /etc/fwcloud/fwcloud.sh: line 48: -P: command not found
Nov 28 08:10:01 host fwcloud.sh[5583]: /etc/fwcloud/fwcloud.sh: line 49: -P: command not found
error are caused by missing "iptables" command,
how can modify compilation process to don't use iptables command on NFT only system ?
in fwcloud config this firewall is set compiler to NFT