Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have installed an new RPM.. i still face the same problem
[root@localhost root]# modprobe tun
[root@localhost root]# lsmod | grep tun
tun 5696 0 (unused)
[root@localhost root]# ifconfig tun0 10.0.0.1 netmask 255.255.255.0 up
SIOCSIFADDR: No such device
tun0: unknown interface: No such device
SIOCSIFNETMASK: No such device
tun0: unknown interface: No such device
[root@localhost root]# uname -r
2.4.20-8
[root@localhost root]#
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
I checked documentation in kernel source, copied an example code and added includes to compile (frankly, I also changed error handling to compile, but it is not so interesting). While the program runs (after it has issued ioctl), tun0 exists. So if you want a program to use tun, this program should call tun_alloc before configuring tun0 interface. This way it will already have its pipe end to get data and tun0 created.
Am getting compiling errors as
[root@localhost peter]# gcc mytun.c -o tun
In file included from mytun.c:3:
/usr/include/linux/if.h:86: field `ifru_addr' has incomplete type
/usr/include/linux/if.h:87: field `ifru_dstaddr' has incomplete type
/usr/include/linux/if.h:88: field `ifru_broadaddr' has incomplete type
/usr/include/linux/if.h:89: field `ifru_netmask' has incomplete type
/usr/include/linux/if.h:90: field `ifru_hwaddr' has incomplete type
[root@localhost peter]#
Hi Peter I am facing same problem how did you fix it?
/usr/include/linux/if.h:165: error: field 'ifru_addr' has incomplete type
/usr/include/linux/if.h:166: error: field 'ifru_dstaddr' has incomplete type
/usr/include/linux/if.h:167: error: field 'ifru_broadaddr' has incomplete type
/usr/include/linux/if.h:168: error: field 'ifru_netmask' has incomplete type
/usr/include/linux/if.h:169: error: field 'ifru_hwaddr' has incomplete type
Hello.c:48:2: warning: no newline at end of file
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.