ifconfig tun(N) destroy does not work !

Stay d dandee at volny.cz
Mon Sep 5 08:01:30 PDT 2005


Hi all,
 
maybe I haven´t read something what I souhld read it, and if it is true I am
sorry for anoying you.
 
Let me ask you for tun devices.
 
roztyly# ifconfig tun1 destroy
ifconfig: SIOCIFDESTROY: Invalid argument

I found out from manual page tun(4) that:
 
"These network interfaces persist until the if_tun.ko module is unloaded (if
tun is built into your kernel, the network interfaces cannot be removed)."
 
Of course the generic kernel defines "device tun", so I commented the line
and recompiled the kernel.
 
After that, I tried again "destroy command" and with no changes.
 
I tried "create command" and the same error message happens.
 
roztyly# kldstat
Id Refs Address    Size     Name
 1    9 0xc0400000 5bb9fc   kernel
 2   16 0xc09bc000 63f04    acpi.ko
 3    1 0xc1848000 23000    nfsserver.ko
 4    1 0xc18b0000 1a000    linux.ko
 6    1 0xc2926000 5000     if_gif.ko

roztyly# ifconfig tun10 create
ifconfig: SIOCIFCREATE: Invalid argument

roztyly# kldstat
Id Refs Address    Size     Name
 1   10 0xc0400000 5bb9fc   kernel
 2   16 0xc09bc000 63f04    acpi.ko
 3    1 0xc1848000 23000    nfsserver.ko
 4    1 0xc18b0000 1a000    linux.ko
 6    1 0xc2926000 5000     if_gif.ko
 7    1 0xc2910000 5000     if_tun.ko
 
It seems automatic loading if_tun.ko and if_gif.ko works well.
 
Opposite to tun device is gif device which works fine:
 
roztyly# kldstat
Id Refs Address    Size     Name
 1   10 0xc0400000 5bb9fc   kernel
 2   16 0xc09bc000 63f04    acpi.ko
 3    1 0xc1848000 23000    nfsserver.ko
 4    1 0xc18b0000 1a000    linux.ko
 6    1 0xc2926000 5000     if_gif.ko
 7    1 0xc2910000 5000     if_tun.ko

roztyly# kldunload -v -i 6
Unloading if_gif.ko, id=6

roztyly# kldunload -v -i 7
Unloading if_tun.ko, id=7

roztyly# kldstat
Id Refs Address    Size     Name
 1    8 0xc0400000 5bb9fc   kernel
 2   16 0xc09bc000 63f04    acpi.ko
 3    1 0xc1848000 23000    nfsserver.ko
 4    1 0xc18b0000 1a000    linux.ko

roztyly# ifconfig gif0 create

roztyly# ifconfig gif0
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280

roztyly# ifconfig gif0 destroy

roztyly# ifconfig gif0
ifconfig: interface gif0 does not exist

roztyly# kldstat
Id Refs Address    Size     Name
 1    9 0xc0400000 5bb9fc   kernel
 2   16 0xc09bc000 63f04    acpi.ko
 3    1 0xc1848000 23000    nfsserver.ko
 4    1 0xc18b0000 1a000    linux.ko
 7    1 0xc2910000 5000     if_gif.ko

roztyly# ifconfig tun0 create
ifconfig: SIOCIFCREATE: Invalid argument

roztyly# kldstat
Id Refs Address    Size     Name
 1   10 0xc0400000 5bb9fc   kernel
 2   16 0xc09bc000 63f04    acpi.ko
 3    1 0xc1848000 23000    nfsserver.ko
 4    1 0xc18b0000 1a000    linux.ko
 7    1 0xc2910000 5000     if_gif.ko
 8    1 0xc2926000 5000     if_tun.ko

roztyly# ifconfig tun0 destroy
ifconfig: interface tun0 does not exist

roztyly# kldstat
Id Refs Address    Size     Name
 1   10 0xc0400000 5bb9fc   kernel
 2   16 0xc09bc000 63f04    acpi.ko
 3    1 0xc1848000 23000    nfsserver.ko
 4    1 0xc18b0000 1a000    linux.ko
 7    1 0xc2910000 5000     if_gif.ko
 8    1 0xc2926000 5000     if_tun.ko

roztyly#

I use tspc2 (freenet6) port, and of course the starting/stopping scripts
deos not work as you and me expect. :(
 
Dan
 
Bye


More information about the freebsd-current mailing list