• Home
  • Kernel
  • Adding OpenVPN (tun.ko) module at kernel compilation time

Adding OpenVPN (tun.ko) module at kernel compilation time

Make menuconfig.

Look for the line:

CONFIG_TUN=m
[/code]

in .config

If not present, add it.

It usually comes as a block here:

CONFIG_BLK_DEV_DM=y
CONFIG_DM_DEBUG=y
CONFIG_DM_CRYPT=y
# CONFIG_DM_SNAPSHOT is not set
# CONFIG_DM_MIRROR is not set
# CONFIG_DM_ZERO is not set
# CONFIG_DM_MULTIPATH is not set
# CONFIG_DM_DELAY is not set
CONFIG_DM_UEVENT=y
CONFIG_NETDEVICES=y
CONFIG_IFB=y
CONFIG_DUMMY=y
# CONFIG_BONDING is not set
# CONFIG_MACVLAN is not set
# CONFIG_EQUALIZER is not set
CONFIG_TUN=m
# CONFIG_VETH is not set
# CONFIG_PHYLIB is not set
CONFIG_NET_ETHERNET=y
CONFIG_MII=y
# CONFIG_AX88796 is not set
# CONFIG_SMC91X is not set
# CONFIG_DM9000 is not set
# CONFIG_ENC28J60 is not set
# CONFIG_ETHOC is not set
# CONFIG_SMC911X is not set
# CONFIG_SMSC911X is not set
# CONFIG_DNET is not set
[/code]

You can use the following code to quickly make a TUN module setting in a virgin .config:

sed s/'# CONFIG_TUN is not set'/'CONFIG_TUN=m'/ mconfig
cp mconfig .config[/code]