Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Verifying for a hardware loopback connection: (6 Items)
   
Verifying for a hardware loopback connection  
Hi,

I had a requirement in which I need to verify for a hardware loopback connection running in QNX on a Target Board. In  
order to test for the loopback connection I need to ping via one interface (assume en0) to other interface ( assume wm0 
) and vice versa. The ping should only respond if the two interfaces are physically connected, and shouldn't respond 
when not connected physically.
I am not able to find any suitable method to implement this, as QNX doesnt have support for ping via interface as in 
Linux using '-I' as selected interface neither it has support for IP Tables in my knowledge.
Any guidance to implement hardware loopback connection will be of great help.

Thanks,
Prashant. 
Re: Verifying for a hardware loopback connection  
If your interfaces are on the same layer 3 network then this won't work 
since all packets will always leave from only one interface because of 
how the routing table works. To work around this you would either need 
make sure the interfaces are on different layer 3 networks and setup 
static routes for each OR you will need to run two instances of io-pkt, 
one for each interface then you can have both interfaces on the same 
layer 3 - you will also need to give set io-pkt option "-ptcpip 
prefix=/altX" (where X is the instance number) for each instance so that 
applications can target a specific instance:

SOCK=/alt1 ping <destination address2>
SOCK=/alt2 ping <destination address1>

See the online documentation for io-pkt for details.

On 14-06-18 06:14 AM, Prashant Singh Parihar wrote:
> Hi,
>
> I had a requirement in which I need to verify for a hardware loopback connection running in QNX on a Target Board. In 
 order to test for the loopback connection I need to ping via one interface (assume en0) to other interface ( assume wm0
 ) and vice versa. The ping should only respond if the two interfaces are physically connected, and shouldn't respond 
when not connected physically.
> I am not able to find any suitable method to implement this, as QNX doesnt have support for ping via interface as in 
Linux using '-I' as selected interface neither it has support for IP Tables in my knowledge.
> Any guidance to implement hardware loopback connection will be of great help.
>
> Thanks,
> Prashant.
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post110740
> To cancel your subscription to this discussion, please e-mail general-networking-unsubscribe@community.qnx.com

Re: Verifying for a hardware loopback connection  
Does it have to be a ping? Using BPF it's possible to send a particular packet and also receive packets. It would be 
quite simple to build a ping-like application.
Re: Verifying for a hardware loopback connection  
Thanks for replying!
I tried to implement Packet Filtering before this posting this problem in Forum, but as it is a Target Board, with very 
limited permission, and that needs other configuration to be setup like pf.conf etc to use which I am not able to 
configure, thus that possibility is ruled out. 
Re: Verifying for a hardware loopback connection  
Packet filtering with lsm-pf is different from the BPF API. However BPF is still going to require root access.
Re: Verifying for a hardware loopback connection  
I tried the method you suggested, as I verified by checking for 'ls /alt1' and 'ls /alt2' but I am not sure that they 
are still in same layer, as when I tried I got following o/p:

I tried to ping 192.168.2.14 (wm0 interface).
# SOCK=/alt2 ping 192.168.2.14
PING 192.168.2.14 (192.168.2.14): 56 data bytes
ping: sendto: No route to host
ping: sendto: No route to host
ping: sendto: No route to host
ping: sendto: No route to host

here '/alt2' is assigned to en1 ( physically USB to ethernet dongle) with IP as 192.168.3.11
Both the interfaces are physically connected.
This doesn't works for me. 
Any suggestions will be helpful in this respect?
Thanks,
Prashant