LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-27-2007, 07:12 AM   #1
Whyte
LQ Newbie
 
Registered: Mar 2007
Distribution: Ubuntu
Posts: 17

Rep: Reputation: 4
How to create a virtual interface?


I need a network interface that will be completely bound to a usermode program.. No physical card involved. The process will handle all packets sent to this interface, and should be able to send packets out of it, as if the process was a network card.

I didn't find anything that allows me to create such an interface. I noticed that VMWare installs a kernel module to handle its vmnetN interfaces. So the only way I can think of is to create a kernel module for it, not sure where to start though.

Am I missing something? Is there any existing library that allows me to do this? If not, is there an existing module? Or places to look at for examples? Any tips at all would be helpful.
 
Old 03-27-2007, 12:56 PM   #2
sandgroper
Member
 
Registered: Jul 2004
Location: Perth , Western Australia
Distribution: Fedora Core 5 , Mint 9
Posts: 118

Rep: Reputation: 15
Quote:
Originally Posted by Whyte
I need a network interface that will be completely bound to a usermode program.. No physical card involved. The process will handle all packets sent to this interface, and should be able to send packets out of it, as if the process was a network card.

I didn't find anything that allows me to create such an interface. I noticed that VMWare installs a kernel module to handle its vmnetN interfaces. So the only way I can think of is to create a kernel module for it, not sure where to start though.

Am I missing something? Is there any existing library that allows me to do this? If not, is there an existing module? Or places to look at for examples? Any tips at all would be helpful.
To add a virtual interface with a different IP address , open up the Network Configuration Tool and go to the Devices Tab and then add a new device.

Click on the "New" button and a wizard comes up , select Ethernet Conection , click Forward , select the default NIC , click on Forward and then enter a IP address , subnet mask : 255.255.1255.0 and your default gateway address.
 
Old 03-27-2007, 01:07 PM   #3
Whyte
LQ Newbie
 
Registered: Mar 2007
Distribution: Ubuntu
Posts: 17

Original Poster
Rep: Reputation: 4
Heheh.. what? No.

Anyways, after four hours of coffee and Google, I found it.

The answer is ethertap, a module which creates an interface tap0 in ifconfig, all I need is to read/write packets on /dev/tap0, exactly what I wanted. Thankies though!
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bonding a virtual interface frd4460 Linux - Networking 3 11-01-2013 03:48 PM
Create routing between virtual interface in linux attojung Linux - Networking 2 03-13-2009 01:06 PM
Virtual Interface montrhano Linux - Networking 0 08-28-2006 05:30 AM
virtual interface eth0:0 irfanasim Linux - General 2 10-11-2002 11:58 AM
Virtual Interface Limit mjakob Linux - Networking 0 11-27-2001 07:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration