Ubuntu14.04 Virtual Network Device tun installation

Source: Internet
Author: User

1, the detection system exists Tun module, ctrl+alt+t open Ubuntu terminal, enter:

①modinfo Tun
Modinfo:ERROR:Module Tun not found.
②modprobe Tun
Lsmod | grep Tun
Without any output


Which means there's no such Tun module


2. Update Ubuntu

① Log in as root

Input: su

Password

If you forget your password, use:sudo passwd root to reset your password

② Synchronous Source.list

Input: Apt-get update

After the update is successful

Input: Apt-get Install Linux-source

Y


3. Configuration Module Driver

① Input: cd/usr/src/linux-source-3.13.0/

Note the folder path, in the previous step apt-get install Linux-source, the terminal displays


Here you can see that the path should be 3.13.0

② Decompression (Note: If you use the virtual machine, to ensure that the virtual machine space is large enough, I have just started to use the VBox default 8G space, there is a lack of space hints)

Input: Tar xvjf linux-source-3.13.0.tar.bz2

③ into the unpacked directory: CD linux-source-3.13.0/

④ installation Libncurses5-dev

Input: Apt-get Install Libncurses5-dev

⑤ Input: Make Menuconfig

Pop-up window


Find and enter: Device Drivers---->

Find and enter: Network Device Support--->

You can see universal TUN/TAP device driver Support


See Front is <*>, keyboard input M, turn <m>, exit and save, back to Terminal

Note:[*],<*> is compiled into the kernel,<m> to compile modules, if you do not know an option, and there is a module optional, then you can directly select the module

⑥ compiling all the module drivers

Input: Make modules

This process takes a period of time (1-2 hours), and the same is true to ensure that the virtual machine space is large enough


4. Add modules to the kernel

① Copy Tun

Input: cp/usr/src/linux-source-3.13.0/linux-source-3.13.0/drivers/net/tun.ko/lib/modules/3.13.0-32-generic/kernel/ Net/tun.ko

Note: The version number will change to see the generic version under your/lib/modules/

② analysis of the dependencies of the loaded modules

Input: Depmod


5. Verification

Input: Modinfo Tun

Can print out the information of Tun



6. Load Kernel module

Input: Modprobe Tun
Lsmod | grep Tun

Output: Tun 10548 1

After the use of Tun, see http://www.tuicool.com/articles/mu6vY3


Reference: http://blog.csdn.net/jayxujia123/article/details/37767189

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.