Skip to content

Instantly share code, notes, and snippets.

@KROSF
Created March 19, 2021 16:48
Show Gist options
  • Save KROSF/53072ad5e68a1429b9b12939c7ab79bc to your computer and use it in GitHub Desktop.
Save KROSF/53072ad5e68a1429b9b12939c7ab79bc to your computer and use it in GitHub Desktop.
Fix LXC tun
nano /etc/init.d/tun
#! /bin/sh
### BEGIN INIT INFO
# Provides:          tun
# Required-Start:    $network
# Required-Stop:     $openvpn
# Default-Start:     S 1 2
# Default-Stop:      0 6
# Short-Description: Make a tun device.
# Description:       Create a tundev for openvpn
### END INIT INFO

# Aktionen
case "$1" in
    start)
        mkdir /dev/net
        mknod /dev/net/tun c 10 200
        chmod 666 /dev/net/tun
        ;;
    stop)
        rm /dev/net/tun
        rmdir /dev/net
        ;;
    restart)
        #do nothing!
        ;;
esac

exit 0
chmod 755 /etc/init.d/tun
update-rc.d tun defaults
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment