Skip to content

Instantly share code, notes, and snippets.

@dagasonhackason
Forked from jmnwong/gist:8959194
Created February 14, 2018 04:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dagasonhackason/cb0639859715f2b4db1fb17be72ce89c to your computer and use it in GitHub Desktop.
Save dagasonhackason/cb0639859715f2b4db1fb17be72ce89c to your computer and use it in GitHub Desktop.
Install missing tun module and for Ubuntu 12.04/user-mode linux
sudo apt-get install uml-utilities build-essential linux-headers-`uname -r`
mkdir faketun
cd faketun
echo -e "#include <linux/module.h>\nstatic int start__module(void) {return 0;}\nstatic void end__module(void){return;}\nmodule_init(start__module);\nmodule_exit(end__module);">tun.c
echo -e "obj-m += tun.o\nall:\n\tmake -C /lib/modules/\$(shell uname -r)/build/ M=\$(PWD) modules\nclean:\n\tmake -C /lib/modules/\$(shell uname -r)/build/ M=\$(PWD) clean\nclean-files := Module.symvers">Makefile
make
sudo install tun.ko /lib/modules/`uname -r`/kernel/net/tun.ko
sudo depmod -a
sudo modprobe tun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment