Update network.sh

This commit is contained in:
Kroese 2025-05-27 00:48:13 +02:00 committed by GitHub
parent b215dd09d2
commit 6678fecb17
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -209,8 +209,9 @@ configureNAT() {
# Check port forwarding flag
if [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then
{ sysctl -w net.ipv4.ip_forward=1 > /dev/null; rc=$?; } || :
{ sysctl -w net.ipv4.ip_forward=1 > /dev/null 2>&1; rc=$?; } || :
if (( rc != 0 )) || [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then
[[ "$PODMAN" == [Yy1]* ]] && return 1
error "IP forwarding is disabled. $ADD_ERR --sysctl net.ipv4.ip_forward=1"
return 1
fi