Little top posting here since i am not completely sure i understand what 
Shlomi wants to do but i think i have an idea. In 2.6, the kernel views 
network addresses as SYSTEM addresses thus, pings will never hit the drivers 
it will be done in the kernel.
Here is an excerpt from LDD3:
"Unfortunately, this effect can't be accomplished through IP number 
assignments alone, because the kernel wouldn't send out a packet through 
interface A that was directed to its own interface B. Instead, it would use 
the loopback channel without passing through snull. To be able to establish a 
communication through the snull interfaces, the source and destination 
addresses need to be modified during data transmission. In other words, 
packets sent through one of the interfaces should be received by the other, 
but the receiver of the outgoing packet shouldn't be recognized as the local 
host. The same applies to the source address of received packets.

To achieve this kind of "hidden loopback," the snull interface toggles the 
least significant bit of the third octet of both the source and destination 
addresses; that is, it changes both the network number and the host number of 
class C IP numbers. The net effect is that packets sent to network A 
(connected to sn0, the first interface) appear on the sn1 interface as 
packets belonging to network B."

I.e., go and write/modify a driver to do that or find a way to do that in the 
packet "mid-flight".

On Tuesday 13 March 2007 08:08, Shachar Shemesh wrote:
> Amos Shapira wrote:
> > I'm still curious, though - will the Linux kernel in your situation go
> > through the hassle to assemble and transmit Ethernet frames or will it
> > notice that it's actually sending to its own address and just say "sod
> > it - I'll just copy the buffer in memory" (which is what I half expect)?
> >
> > --Amos
>
> I haven't checked the kernel's code, but from what I know, Oron's
> solution will not work. I don't think there is a way to do what Shlomi
> is looking to do.
>
> The kernel views all IP addresses of all interfaces as "his" addresses.
> I know for a fact that, at least in the past, it would answer ARP
> requests destined for one of its interfaces, even if the request arrived
> on another interface. I don't remember at the moment for sure, but I
> think even the "proxy arp" would not affect this setting. One thing is
> for sure, though. If any kernel option will affect this case, it is
> proxy arp, and not IP forwarding. It's the layer 2 you wish to bypass,
> not the layer 3.
>
> One thing I would try is to send it to the broadcast address, rather
> than to the specific address for the other interface. This will, for
> sure, cause the packet to go out on the wire. You can disconnect the
> cable to find out whether it will also prevent the kernel from
> short-looping the packet.
>
> Shachar

-- 
Regards,
        Tzahi.
--
Tzahi Fadida
Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info
WARNING TO SPAMMERS:  see at 
http://members.lycos.co.uk/my2nis/spamwarning.html

================================================================To unsubscribe, 
send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to