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
************************************************** */