Re: Creating virtual interface using C++
flat view
From: Chin Shi Hong <hidden>
Date: 2011-01-16 15:26:17
2011/1/16 Rémi Denis-Courmont [off-list ref]:
Hello, Le dimanche 16 janvier 2011 16:37:05 Chin Shi Hong, vous avez écrit :quoted
Can someone give me suggestion for C++ codes that will create a virtual network interfaceIt depends what you mean by virtual. Normally, you should use /dev/net/tun which is documented at linux-2.6/Documentation/networking/tuntap.txtquoted
for the existing network interface (including wired and wireless network interface)?But that part of your question does not make any sense. -- Rémi Denis-Courmont http://www.remlab.net/ http://fi.linkedin.com/in/remidenis
Don't know how to explain by virtual. But, you know the "iw" utility (http://wireless.kernel.org/en/users/Documentation/iw)? If you installed this utility, and then run the command "sudo iw dev <wireless interface> interface add <virtual interface name> type <wireless mode>", for example "sudo iw dev wlan0 interface add mon0 type monitor", it will add an virtual wireless interface named "mon0" for the wireless interface "wlan0", then switch it to monitor mode. if you run that command, you will know what I mean.