Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: TUN device error #633

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,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
Expand All @@ -185,7 +187,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
Expand All @@ -197,7 +199,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

Expand Down
Loading