mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 05:20:02 +08:00
TUN interface
This commit is contained in:
parent
597ae170e2
commit
9848cc0a3d
@ -12,7 +12,6 @@ RUN apt-get update && apt-get -y upgrade && \
|
|||||||
jq \
|
jq \
|
||||||
curl \
|
curl \
|
||||||
cpio \
|
cpio \
|
||||||
kmod \
|
|
||||||
wget \
|
wget \
|
||||||
unzip \
|
unzip \
|
||||||
procps \
|
procps \
|
||||||
|
12
network.sh
12
network.sh
@ -91,19 +91,13 @@ MAJOR=""
|
|||||||
_DhcpIP=""
|
_DhcpIP=""
|
||||||
|
|
||||||
# Create the necessary file structure for /dev/net/tun
|
# Create the necessary file structure for /dev/net/tun
|
||||||
if ( [ ! -c /dev/net/tun ] ); then
|
# Create the necessary file structure for /dev/net/tun
|
||||||
if ( [ ! -d /dev/net ] ); then
|
if [ ! -c /dev/net/tun ]; then
|
||||||
mkdir -m 755 /dev/net
|
[ ! -d /dev/net ] && mkdir -m 755 /dev/net
|
||||||
fi
|
|
||||||
mknod /dev/net/tun c 10 200
|
mknod /dev/net/tun c 10 200
|
||||||
chmod 666 /dev/net/tun
|
chmod 666 /dev/net/tun
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Load the tun module if not already loaded
|
|
||||||
if ( !(lsmod | grep -q "^tun\s") ); then
|
|
||||||
[ -f /lib/modules/tun.ko ] && insmod /lib/modules/tun.ko
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ ! -c /dev/net/tun ] && echo "Error: TUN network interface not available..." && exit 85
|
[ ! -c /dev/net/tun ] && echo "Error: TUN network interface not available..." && exit 85
|
||||||
|
|
||||||
#log "INFO" "Little dirty trick ..."
|
#log "INFO" "Little dirty trick ..."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user