diff --git a/etc/net/options.d/00-default b/etc/net/options.d/00-default index 5bdfddf..2e5df8a 100644 --- a/etc/net/options.d/00-default +++ b/etc/net/options.d/00-default @@ -27,6 +27,7 @@ INSMOD=/sbin/insmod RMMOD=/sbin/rmmod SYSCTL=/sbin/sysctl IFRENAME=/sbin/ifrename +TUNCTL=/usr/sbin/tunctl # IPv4LL ZCIP_CLIENT=/sbin/zcip @@ -65,7 +66,7 @@ NEVER_RMMOD=no AUTO_BROADCAST=off IFGROUP[0]='lo dummy' -IFGROUP[1]='eth plip usb dvb bnep' +IFGROUP[1]='eth plip usb dvb bnep tuntap' IFGROUP[2]='vlan bond bri teql' IFGROUP[3]='iptun ipsectun ovpn' IFGROUP[4]='ppp' diff --git a/etc/net/scripts/create-tuntap b/etc/net/scripts/create-tuntap new file mode 100755 index 0000000..97f461f --- /dev/null +++ b/etc/net/scripts/create-tuntap @@ -0,0 +1,22 @@ +#!/bin/bash + +pickup_defaults +pickup_options + +if [ ! -c /dev/net/tun ]; then + $MODPROBE tun || { + print_error "tuntap kernel module not found" + exit 1 + } + [ -c /dev/net/tun ] || { + print_error "tuntap control node does not exist" + exit 1 + } +fi + +[ -x "${TUNCTL:=$DEFAULT_TUNCTL}" ] || { + print_error "$TUNCTL does not exist or is not executable. Try installing tunctl RPM." + exit 1 +} + +$TUNCTL -t "$NAME" ${TUNTAP_USER:+-u $TUNTAP_USER} > /dev/null diff --git a/etc/net/scripts/destroy-tuntap b/etc/net/scripts/destroy-tuntap new file mode 100755 index 0000000..655bfcf --- /dev/null +++ b/etc/net/scripts/destroy-tuntap @@ -0,0 +1,11 @@ +#!/bin/bash + +pickup_defaults +pickup_options + +[ -x "${TUNCTL:=$DEFAULT_TUNCTL}" ] || { + print_error "$TUNCTL does not exist or is not executable. Try installing tunctl RPM." + exit 1 +} + +$TUNCTL -d "$NAME" > /dev/null diff --git a/etc/net/scripts/functions b/etc/net/scripts/functions index a11c1b9..1fdefe0 100644 --- a/etc/net/scripts/functions +++ b/etc/net/scripts/functions @@ -21,6 +21,7 @@ DEFAULT_PLIPCONFIG=/sbin/plipconfig DEFAULT_VCONFIG=/usr/bin/vconfig DEFAULT_IPSECADM=/usr/sbin/ipsecadm DEFAULT_IFENSLAVE=/sbin/ifenslave +DEFAULT_TUNCTL=/usr/sbin/tunctl DEFAULT_BRCTL=/usr/sbin/brctl DEFAULT_ETHTOOL=/usr/sbin/ethtool DEFAULT_PPPD=/usr/sbin/pppd diff --git a/etcnet.spec b/etcnet.spec index e691882..1e63fa5 100644