Networking Forums

Networking Forums > Computer Networking > Linux Networking > pinging between two NIC on my PC

Reply
Thread Tools Display Modes

pinging between two NIC on my PC

 
 
Ken
Guest
Posts: n/a

 
      04-22-2004, 07:28 AM
Hi.

Is it possible to ping two NIC on the same PC?
I connected two NIC with cross cable, and set NIC1's IP as
192.168.0.1, NIC2's IP as 192.168.0.2.
Pinging 192.168.0.1 or 192.168.0.2 has reply.
But even after disconnecting cable.

What I want to do is sending or receiving IP packet VIA cable.
Could anybody have any idea, please?

TIA
Kenji
 
Reply With Quote
 
 
 
 
Paul Black
Guest
Posts: n/a

 
      04-22-2004, 07:37 AM
Ken wrote:
> Hi.
>
> Is it possible to ping two NIC on the same PC?
> I connected two NIC with cross cable, and set NIC1's IP as
> 192.168.0.1, NIC2's IP as 192.168.0.2.
> Pinging 192.168.0.1 or 192.168.0.2 has reply.
> But even after disconnecting cable.


Correct. You can always ping your local IP address and each IP address
you're trying to ping is local.


> What I want to do is sending or receiving IP packet VIA cable.
> Could anybody have any idea, please?


I'm curious: why?


--
Paul Black mailto(E-Mail Removed)
Oxford Semiconductor Ltd http://www.oxsemi.com
25 Milton Park, Abingdon, Tel: +44 (0) 1235 824 909
Oxfordshire. OX14 4SH Fax: +44 (0) 1235 821 141
 
Reply With Quote
 
Toni Erdmann
Guest
Posts: n/a

 
      04-22-2004, 07:48 AM
Ken wrote:

> Hi.
>
> Is it possible to ping two NIC on the same PC?
> I connected two NIC with cross cable, and set NIC1's IP as
> 192.168.0.1, NIC2's IP as 192.168.0.2.
> Pinging 192.168.0.1 or 192.168.0.2 has reply.
> But even after disconnecting cable.
>
> What I want to do is sending or receiving IP packet VIA cable.
> Could anybody have any idea, please?
>
> TIA
> Kenji


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 ...
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 tries to measure
the up- and downlink delays using only one
Laptop. Having 2 Laptops (1 for ppp0 and 1 for eth0)
cause problems with time synchronization.

Toni
 
Reply With Quote
 
Ken
Guest
Posts: n/a

 
      04-23-2004, 11:56 AM
HI Paul.


> Correct. You can always ping your local IP address and each IP address
> you're trying to ping is local.


Yes, And I tried to change route table, but it couldn't work.


> > What I want to do is sending or receiving IP packet VIA cable.
> > Could anybody have any idea, please?

>
> I'm curious: why?


This is because I need to make a test program which checks both
ethernet on board and pc-card network card work fine.
I cannot expect that pc connects to other machines during testing.
So I want to connect them with cross cable then test.


Kenji
 
Reply With Quote
 
Ken
Guest
Posts: n/a

 
      04-23-2004, 12:13 PM
Thanks Toni for your reply.
Sounds difficult.

What do you think this idea:
1. Run UDP server process which listen certain port.
2. Run UDP client process which does broadcast.
3. Then check if server process gets packets.

Kenji


> > Is it possible to ping two NIC on the same PC?
> > I connected two NIC with cross cable, and set NIC1's IP as
> > 192.168.0.1, NIC2's IP as 192.168.0.2.
> > Pinging 192.168.0.1 or 192.168.0.2 has reply.
> > But even after disconnecting cable.
> >
> > What I want to do is sending or receiving IP packet VIA cable.
> > Could anybody have any idea, please?
> >
> > TIA
> > Kenji

>
> 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 ...
> 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 tries to measure
> the up- and downlink delays using only one
> Laptop. Having 2 Laptops (1 for ppp0 and 1 for eth0)
> cause problems with time synchronization.
>
> Toni

 
Reply With Quote
 
Toni Erdmann
Guest
Posts: n/a

 
      04-23-2004, 12:40 PM
Ken wrote:
> Thanks Toni for your reply.
> Sounds difficult.


Not really. We made it within a few hours
spending most of the time compiling and linking
the kernel.

>
> What do you think this idea:
> 1. Run UDP server process which listen certain port.
> 2. Run UDP client process which does broadcast.
> 3. Then check if server process gets packets.


No, I'm afraid that goes the short path too.


If you only like to know, whether somehing can
be sent and received ...

ping -I eth0 ip-of-eth1

start 'ethereal' capturing on eth1

or

start 'tcpdump -i eth1'

if you can see something coming in, all is ok.

Toni
 
Reply With Quote
 
Ken
Guest
Posts: n/a

 
      04-26-2004, 03:01 AM
Thanks for your idea.

> Not really. We made it within a few hours
> spending most of the time compiling and linking
> the kernel.


I'm afraind We cannot take this because the customer requires to use
their own kernel.


> If you only like to know, whether somehing can
> be sent and received ...
>
> ping -I eth0 ip-of-eth1
>
> start 'ethereal' capturing on eth1
>
> or
>
> start 'tcpdump -i eth1'
>
> if you can see something coming in, all is ok.
>
> Toni


But this really helps me.
I appreciate you so much.

Regards,
Kenji
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pinging Dr Teeth Home Networking 3 05-17-2007 11:40 AM
pinging hostnames bill tie Windows Networking 7 07-04-2005 04:24 AM
pinging =?Utf-8?B?c3Rob21wc29u?= Windows Networking 5 02-10-2005 08:01 PM
Pinging over home LAN between XP and 98 Paul Windows Networking 0 06-15-2004 12:09 AM
Pinging Skid Windows Networking 1 11-11-2003 03:37 AM



1 2 3 4 5 6 7 8 9 10 11