(E-Mail Removed) wrote:
> Hi, folks,
>
> I have two ports on the NiC of my Linux machine, say port A and B. I have
> another machine acted as router R. How can I send packets out from A to R
> and then come back to B ?
>
> If I "ping B", the Ping packets automatically goes to B port directly
> without going out of this machine.
>
> I used static routing like "route add -host B gw R". It didn't work with
> Linux, though it worked with BSD. Any better ways ?
>
> I tried iptunnel but it's hard to make it work (the help is not clear
> enough and it's hard to find good doc on the Internet through google).
>
> Anyone has better ideas and pointers ?
There was aposting "pinging between two NIC on my PC"
on 2004-04-22 here in this group and I answered:
(also Paul Black answered to that)
<quote myself>
Hi,
that's not so easy.
1.) Linux tries to find a shorter path - local loop,
IP stack recognized IP address as being it's own
and therefore does not use any NIC
2.) even if you tell 'ping' to use a certain NIC
'ping -I eth0 <ip of eth1>' it does not work,
because:
3.) Kernel does not accept incoming IP packets from
any NIC that has source and destination address
being it's own. To allow this, this would
require
4.) a kernel patch: I must search for it ...
... its a 'delete 2 lines' fix for UDP only ...
but even then it does not work, because
5.) you can't tell the responding ICMP stack
(Echo Response) which NIC to use for sending,
so that the response goes again the short path.
We had such problems with UDP test program with
ppp0 interface and eth0 interface, both connected
via Cellular Phone over GPRS and back to eth0
(Test Center for GSM/GPRS). We tried to measure
the up- and downlink delays using only one
Laptop. Having 2 Laptops (1 for ppp0 and 1 for eth0)
causes problems with time synchronization.
</quote myself>
Toni