Networking Forums

Networking Forums > Computer Networking > Linux Networking > tun on a small Linux-System

Reply
Thread Tools Display Modes

tun on a small Linux-System

 
 
Markus Wenke
Guest
Posts: n/a

 
      12-06-2003, 09:47 PM
Hi,

I try to get openVPN on a small embedded Linux-System (2.4.22)
I compiled the tun-module and openvpn, and "insmod tun" worked fine.
But if I try so set up the net-Device with ifconfig, ifconfig can't find
the device:
SIOCSIFADDR: No such device
SIOCSIFNETMASK: No such device
SIOCSIFMTU: No such device
SIOCGIFFLAGS: No such device

I use this ifconfig-command:
ifconfig tap0 172.16.4.10 netmask 255.255.255.0 mtu 1300 up

The Linux-System have no modules.conf.
I created a new modules.conf:
-------
alias char-major-10-200 tun
alias tap0 tun
--------

and now, if i do the ifconfig-command "ifconfig tap0 172.16.4.10 netmask
255.255.255.0 mtu 1300 up"
Linux loads automaticly the module tun, but the same error appears!
The device /dev/net/tun is created automaticly while loading the module

So, how can I say ifconfig that it must use the tun module for the
net-Device?

The init-files uses "ip" instead of "ifconfig", but "ip" creates also an
error-message.

What's the difference between ip and ifconfig?

Markus

 
Reply With Quote
 
 
 
 
Neil Horman
Guest
Posts: n/a

 
      12-08-2003, 12:12 PM

Markus Wenke wrote:
> Hi,
>
> I try to get openVPN on a small embedded Linux-System (2.4.22)
> I compiled the tun-module and openvpn, and "insmod tun" worked fine.
> But if I try so set up the net-Device with ifconfig, ifconfig can't find
> the device:
> SIOCSIFADDR: No such device
> SIOCSIFNETMASK: No such device
> SIOCSIFMTU: No such device
> SIOCGIFFLAGS: No such device
>
> I use this ifconfig-command:
> ifconfig tap0 172.16.4.10 netmask 255.255.255.0 mtu 1300 up
>
> The Linux-System have no modules.conf.
> I created a new modules.conf:
> -------
> alias char-major-10-200 tun
> alias tap0 tun
> --------
>
> and now, if i do the ifconfig-command "ifconfig tap0 172.16.4.10 netmask
> 255.255.255.0 mtu 1300 up"
> Linux loads automaticly the module tun, but the same error appears!
> The device /dev/net/tun is created automaticly while loading the module
>
> So, how can I say ifconfig that it must use the tun module for the
> net-Device?
>
> The init-files uses "ip" instead of "ifconfig", but "ip" creates also an
> error-message.
>
> What's the difference between ip and ifconfig?
>
> Markus
>


The functionality of ifconfig or ip is not the problem here. The
problem is how you use the tun/tap device. the tun module allows a file
descriptor to be connected to an ethernet device. Every time
/dev/net/tun is opened, and a particular ioctl is called (I can't
remember the exact ioctl number, so you'll need to grep the source or
the docs), a new network interface is created which corresponds to that
file descriptor. Until that file is opened, the network interface
simply does not exist, and so ifconfig or ip will not work properly.
I've not used openVPN before, but I assume that there is an application
portion which you need to run which will in turn open /dev/net/tun for
you and create the interface which you can then configure.

HTH
Neil

--
/************************************************** *
*Neil Horman
*Software Engineer
*Red Hat, Inc., http://people.redhat.com/nhorman
*gpg keyid: 1024D / 0x92A74FA1
*http://www.keyserver.net
************************************************** */

 
Reply With Quote
 
Markus Wenke
Guest
Posts: n/a

 
      12-08-2003, 09:09 PM
Neil Horman wrote:
>
> Markus Wenke wrote:
>
>> Hi,
>>
>> I try to get openVPN on a small embedded Linux-System (2.4.22)
>> I compiled the tun-module and openvpn, and "insmod tun" worked fine.
>> But if I try so set up the net-Device with ifconfig, ifconfig can't
>> find the device:
>> SIOCSIFADDR: No such device
>> SIOCSIFNETMASK: No such device
>> SIOCSIFMTU: No such device
>> SIOCGIFFLAGS: No such device
>>
>> I use this ifconfig-command:
>> ifconfig tap0 172.16.4.10 netmask 255.255.255.0 mtu 1300 up
>>
>> The Linux-System have no modules.conf.
>> I created a new modules.conf:
>> -------
>> alias char-major-10-200 tun
>> alias tap0 tun
>> --------
>>
>> and now, if i do the ifconfig-command "ifconfig tap0 172.16.4.10
>> netmask 255.255.255.0 mtu 1300 up"
>> Linux loads automaticly the module tun, but the same error appears!
>> The device /dev/net/tun is created automaticly while loading the module
>>
>> So, how can I say ifconfig that it must use the tun module for the
>> net-Device?
>>
>> The init-files uses "ip" instead of "ifconfig", but "ip" creates also
>> an error-message.
>>
>> What's the difference between ip and ifconfig?
>>
>> Markus
>>

>
> The functionality of ifconfig or ip is not the problem here. The
> problem is how you use the tun/tap device. the tun module allows a file
> descriptor to be connected to an ethernet device. Every time
> /dev/net/tun is opened, and a particular ioctl is called (I can't
> remember the exact ioctl number, so you'll need to grep the source or
> the docs), a new network interface is created which corresponds to that
> file descriptor. Until that file is opened, the network interface
> simply does not exist, and so ifconfig or ip will not work properly.
> I've not used openVPN before, but I assume that there is an application
> portion which you need to run which will in turn open /dev/net/tun for
> you and create the interface which you can then configure.
>


Thanks a lot,

I find the tool "tunctl", bit it reports the error:
TUNSETIFF: File descriptor in bad state

It happens, while ioctl (you write it)

what can I do?
It seems, that the module ist loaded corectly,...

thanks in advance

Markus

 
Reply With Quote
 
Neil Horman
Guest
Posts: n/a

 
      12-09-2003, 11:43 AM
Markus Wenke wrote:
> Neil Horman wrote:
>
>>
>> Markus Wenke wrote:
>>
>>> Hi,
>>>
>>> I try to get openVPN on a small embedded Linux-System (2.4.22)
>>> I compiled the tun-module and openvpn, and "insmod tun" worked fine.
>>> But if I try so set up the net-Device with ifconfig, ifconfig can't
>>> find the device:
>>> SIOCSIFADDR: No such device
>>> SIOCSIFNETMASK: No such device
>>> SIOCSIFMTU: No such device
>>> SIOCGIFFLAGS: No such device
>>>
>>> I use this ifconfig-command:
>>> ifconfig tap0 172.16.4.10 netmask 255.255.255.0 mtu 1300 up
>>>
>>> The Linux-System have no modules.conf.
>>> I created a new modules.conf:
>>> -------
>>> alias char-major-10-200 tun
>>> alias tap0 tun
>>> --------
>>>
>>> and now, if i do the ifconfig-command "ifconfig tap0 172.16.4.10
>>> netmask 255.255.255.0 mtu 1300 up"
>>> Linux loads automaticly the module tun, but the same error appears!
>>> The device /dev/net/tun is created automaticly while loading the module
>>>
>>> So, how can I say ifconfig that it must use the tun module for the
>>> net-Device?
>>>
>>> The init-files uses "ip" instead of "ifconfig", but "ip" creates also
>>> an error-message.
>>>
>>> What's the difference between ip and ifconfig?
>>>
>>> Markus
>>>

>>
>> The functionality of ifconfig or ip is not the problem here. The
>> problem is how you use the tun/tap device. the tun module allows a
>> file descriptor to be connected to an ethernet device. Every time
>> /dev/net/tun is opened, and a particular ioctl is called (I can't
>> remember the exact ioctl number, so you'll need to grep the source or
>> the docs), a new network interface is created which corresponds to
>> that file descriptor. Until that file is opened, the network
>> interface simply does not exist, and so ifconfig or ip will not work
>> properly. I've not used openVPN before, but I assume that there is an
>> application portion which you need to run which will in turn open
>> /dev/net/tun for you and create the interface which you can then
>> configure.
>>

>
> Thanks a lot,
>
> I find the tool "tunctl", bit it reports the error:
> TUNSETIFF: File descriptor in bad state
>
> It happens, while ioctl (you write it)
>
> what can I do?
> It seems, that the module ist loaded corectly,...
>
> thanks in advance
>
> Markus
>

tunctl --help
that will give you the proper useage for tunctl

--
/************************************************** *
*Neil Horman
*Software Engineer
*Red Hat, Inc., http://people.redhat.com/nhorman
*gpg keyid: 1024D / 0x92A74FA1
*http://www.keyserver.net
************************************************** */

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Small Linux Print Server Geoff Lane Linux Networking 8 04-08-2008 08:08 PM
pump/dhcp on Damn Small Linux harold@hallikainen.com Linux Networking 1 08-10-2007 01:18 AM
Looking for cheap/small/quiet GNU/Linux server Stefan Monnier Linux Networking 16 07-23-2004 07:06 PM
Need to install a 'small linux' - help required in finding one AAVF IT Linux Networking 16 06-19-2004 09:42 AM
Wanted: Small footprint HW for Linux router C. Olive Linux Networking 10 08-22-2003 03:27 AM



1 2 3 4 5 6 7 8 9 10 11