LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-24-2011, 06:51 AM   #1
grreddy
LQ Newbie
 
Registered: Jan 2005
Location: india
Posts: 3

Rep: Reputation: 0
Writing virtual network Driver for Ethernet devices


Hi Everyone,

I implemented a virtual driver (similar to traffic shaper in linux) which works like this. All packets coming from protocol stack will first receive to this New virtual driver and thereafter it goes to real driver code. It was working fine with 2.6.18 Kernels in linux. I modified the code and run for 2.6.32,but I observed the strange things. If I ping from source to destination, the ping is not working. I have seen the packets through traffic analyzer, and found that the packets are going properly to destination, but the reply is not coming back to the source. Similarly with the same configuration If I ping from destination to source, the ping is not working.

After proper configuration ( making eth0 slave to virtual interface)
ifconfig and routing entries like this:

Virtual Link encap:Ethernet HWaddr 00:25:b3:5d:5e:a9
inet addr:192.168.0.108 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::225:b3ff:fe5d:5ea9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:3852 (3.8 KB)

eth0 Link encap:Ethernet HWaddr 00:25:b3:5d:5e:a9
inet addr:192.168.0.108 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::225:b3ff:fe5d:5ea9/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:707474 errors:0 dropped:0 overruns:0 frame:0
TX packets:375814 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:578708921 (578.7 MB) TX bytes:53155510 (53.1 MB)
Interrupt:17

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:3568 errors:0 dropped:0 overruns:0 frame:0
TX packets:3568 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:328104 (328.1 KB) TX bytes:328104 (328.1 KB)

And route -n

192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 Virtual
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 Virtual


I have given the same IP address of the salve and kept only Virtual
routing table entries.

Help in this regards is highly appreciated.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Virtual network driver packet reception j-osh Linux - Kernel 1 02-13-2010 05:08 AM
Writing a Simple Pass-through driver for the ethernet....?? gauravholey Linux - Kernel 0 07-09-2009 07:20 AM
Driver needed for Ethernet ID7 network card mainm Linux - Newbie 1 06-22-2009 11:52 PM
how can I get the source code for network driver of rtl8139 ethernet controller? sandeep_raju123 Linux - Networking 2 04-15-2009 04:45 AM
Error in writing a ethernet driver Morpheus Linux - Hardware 7 02-07-2006 09:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 09:05 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