Adding tun0 to kernel? - BSD

This is a discussion on Adding tun0 to kernel? - BSD ; I've successfully compiled and installed a new kernel under FreeBSD 7.0.1. I need to add tun0 support. All I need to do is add "device tun" to my kernel config file. Right? After a kernel compile/install, "ifconfig" still doesn't show ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Adding tun0 to kernel?

  1. Adding tun0 to kernel?

    I've successfully compiled and installed a new kernel under FreeBSD
    7.0.1.

    I need to add tun0 support. All I need to do is add "device tun" to
    my kernel config file. Right?

    After a kernel compile/install, "ifconfig" still doesn't show tun0.

    What am I missing?

    Regards,
    MVSGuy

  2. Re: Adding tun0 to kernel?

    On Wed, 24 Sep 2008 12:41:58 -0700 (PDT), MVSGuy wrote:
    > I've successfully compiled and installed a new kernel under FreeBSD
    > 7.0.1.
    >
    > I need to add tun0 support. All I need to do is add "device tun" to
    > my kernel config file. Right?


    You can also load `if_tun.ko' as a module:

    # kldload if_tun

    > After a kernel compile/install, "ifconfig" still doesn't show tun0.
    > What am I missing?


    Someone has to ``clone'' a new interface before you see anything in
    ifconfig(8) output:

    # ifconfig tun create
    tun0

    # ifconfig tun0
    tun0: flags=8010 metric 0 mtu 1500

    # ifconfig tun0 unplumb
    ifconfig: interface tun0 does not exist

  3. Re: Adding tun0 to kernel?

    MVSGuy wrote:
    > I've successfully compiled and installed a new kernel under FreeBSD
    > 7.0.1.
    >
    > I need to add tun0 support. All I need to do is add "device tun" to
    > my kernel config file. Right?


    It's already in the GENERIC kernel. If you have a custom kernel, yes,
    you'd need to make sure device tun is in the kernel config file.

    > After a kernel compile/install, "ifconfig" still doesn't show tun0.
    >
    > What am I missing?


    From the tun(4) man page:

    tun devices are created using interface cloning. This is done using the
    ``ifconfig tunN create'' command. This is the preferred method of creat-
    ing tun devices. The same method allows removal of interfaces. For
    this, use the ``ifconfig tunN destroy'' command.

    --
    Warren Block * Rapid City, South Dakota * USA

+ Reply to Thread