From 8bff6ab80ac784e44192a5ed57a09c8ad0349ad0 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 3 Dec 2024 11:48:38 +0100 Subject: [PATCH 1/2] fix: TUN device error --- src/network.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/network.sh b/src/network.sh index f157ca13..19c037eb 100644 --- a/src/network.sh +++ b/src/network.sh @@ -168,6 +168,8 @@ configureUser() { configureNAT() { + local tuntap="TUN device is missing. $ADD_ERR --device /dev/net/tun" + # Create the necessary file structure for /dev/net/tun if [ ! -c /dev/net/tun ]; then [ ! -d /dev/net ] && mkdir -m 755 /dev/net @@ -177,7 +179,7 @@ configureNAT() { fi if [ ! -c /dev/net/tun ]; then - error "TUN device missing. $ADD_ERR --device /dev/net/tun --cap-add NET_ADMIN" && return 1 + error "$tuntap" && return 1 fi # Check port forwarding flag @@ -189,7 +191,6 @@ configureNAT() { fi local tables="The 'ip_tables' kernel module is not loaded. Try this command: sudo modprobe ip_tables iptable_nat" - local tuntap="The 'tun' kernel module is not available. Try this command: 'sudo modprobe tun' or run the container with 'privileged: true'." # Create a bridge with a static IP for the VM guest From df8d6184ebd41a2fed896ccc10468b40e312b06f Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 3 Dec 2024 11:50:02 +0100 Subject: [PATCH 2/2] fix: TUN device error --- src/network.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/network.sh b/src/network.sh index 19c037eb..cee17710 100644 --- a/src/network.sh +++ b/src/network.sh @@ -169,6 +169,7 @@ configureUser() { configureNAT() { local tuntap="TUN device is missing. $ADD_ERR --device /dev/net/tun" + local tables="The 'ip_tables' kernel module is not loaded. Try this command: sudo modprobe ip_tables iptable_nat" # Create the necessary file structure for /dev/net/tun if [ ! -c /dev/net/tun ]; then @@ -190,8 +191,6 @@ configureNAT() { fi fi - local tables="The 'ip_tables' kernel module is not loaded. Try this command: sudo modprobe ip_tables iptable_nat" - # Create a bridge with a static IP for the VM guest { ip link add dev dockerbridge type bridge ; rc=$?; } || :