Ethernet "test" its connected and can pass packets.

  • Thread starter Deleted member 115935
  • Start date

Thread Starter

Deleted member 115935

Joined Dec 31, 1969
0
Hi

Have a need to "test" a card with multiple "ethernet" ports on it,

By test, I mean can I pass packets between the ports over the cable,
not worried about speed, throughput or such like,

I can not connect the "ethernet" ports to a switch / network, all I can do is loopback on the card,

Each port gets an IP address, but the OS is to clever, ( both W10 and Linux ) and the ping to that IP works with cable in or out.

Any ideas how to pass some packets between the two ports ? Linux or W10 is fine,

Note also , can't use external test gear , needs to be done with a loop back "cable"
 

Dave Lowther

Joined Sep 8, 2016
106
Any ideas how to pass some packets between the two ports ?
I don't actually know what algorithm the IP stacks in Windows/Linux use to determine whether a packet should be sent on the wire or whether it can be routed from tx to rx in the stack without going via the Ethernet interface.
I'd try sending a broadcast UDP (to address 255.255.255.255), or broadcast Ethernet frame (to address FF:FF:FF:FF:FF:FF) and then see if they need the loopback wire to work.
 

eetech00

Joined Jun 8, 2013
2,660
Hi

Have a need to "test" a card with multiple "ethernet" ports on it,

By test, I mean can I pass packets between the ports over the cable,
not worried about speed, throughput or such like,

I can not connect the "ethernet" ports to a switch / network, all I can do is loopback on the card,

Each port gets an IP address, but the OS is to clever, ( both W10 and Linux ) and the ping to that IP works with cable in or out.

Any ideas how to pass some packets between the two ports ? Linux or W10 is fine,

Note also , can't use external test gear , needs to be done with a loop back "cable"
The loopback cable will auto-test ethernet connectivity. When plugged into the ethernet port, the port LED's should become active.

Don't use the loopback address to test IP connectivity.
Assign an IP with a different subnet mask to each port, then ping one of the IPs.
Without the loopback cable, the ping test should fail.
 
Last edited:

Yaakov

Joined Jan 27, 2019
3,768
It's all down to the routing table. You need to make sure the route to the each port has a gateway that is the other port. If the stack can't use the gateway port to reach the target, it will fail. You might want to look at socat (https://linux.die.net/man/1/socat) which, at least under Linux, interface option that will let you specify the source interface so you don't have to munge the routing table.

It's an absurdly flexible tool, very complex, but there are many example and you only need the functionality you need, so you can ignore all if the other amazing stuff it can do.
 

Thread Starter

Deleted member 115935

Joined Dec 31, 1969
0
Thank you

yes the leds light and flash, but they light before drivers were installed,
qed, thats a hardware level test of packets,
which is part way there, its a connection, but not for the PC.

UDP good, but did not work, cable in or out same result.

My sw guy suggested the different sub net masks, but the windows complained about trying to send a packet , as its sent to the default gateway. which as mentioned, we dont have , as we have only the loop back cable.

I will suggest socat and linux to the sw guy ,

thank you
 

eetech00

Joined Jun 8, 2013
2,660
Thank you

yes the leds light and flash, but they light before drivers were installed,
qed, thats a hardware level test of packets,
which is part way there, its a connection, but not for the PC.

UDP good, but did not work, cable in or out same result.

My sw guy suggested the different sub net masks, but the windows complained about trying to send a packet , as its sent to the default gateway. which as mentioned, we dont have , as we have only the loop back cable.

I will suggest socat and linux to the sw guy ,

thank you
Instead of using loopback cable, try connecting an ethernet crossover cable between two ports to be tested.
The gateway shouldn't matter. When a ping is generated, the interface should "ARP" for the MAC address of the target IP.
As long as it can receive the ARP reply, the ping should work.

Try assigning each test port an IP on the same network, with the same subnet mask.
For example:

Port 1 IP:192.168.1.10 SM:255.255.255.0 GW:192.168.1.20
Port 2 IP:192.168.1.20 SM:255.255.255.0 GW:192.168.1.10

I've shown a GW IP but it shouldn't matter. The GW won't be used with the IP config shown above.

Try to ping with the above configuration using a ethernet crossover cable connected between port 1 and port 2.

C:\Temp> Ping -S 192.168.1.10 192.168.1.20

The ping should succeed (or fail without the crossover cable).
 
Last edited:

Thread Starter

Deleted member 115935

Joined Dec 31, 1969
0
Instead of using loopback cable, try connecting an ethernet crossover cable between two ports to be tested.
The gateway shouldn't matter. When a ping is generated, the interface should "ARP" for the MAC address of the target IP.
As long as it can receive the ARP reply, the ping should work.

Try assigning each test port an IP on the same network, with the same subnet mask.
For example:

Port 1 IP:192.168.1.10 SM:255.255.255.0 GW:192.168.1.20
Port 2 IP:192.168.1.20 SM:255.255.255.0 GW:192.168.1.10

I've shown a GW IP but it shouldn't matter. The GW won't be used with the IP config shown above.

Try to ping with the above configuration using a ethernet crossover cable connected between port 1 and port 2.

C:\Temp> Ping -S 192.168.1.10 192.168.1.20

The ping should succeed (or fail without the crossover cable).
Thank you

As the ethernet leds ligth, we assume the cable link is made, as when we unplug the cables, then the leds go out,

The OS is to clever, the two NICs have different IP addresses / Mac addresses, but the Ping command as you list wrks if we have cable in or out !
 

eetech00

Joined Jun 8, 2013
2,660
Thank you

As the ethernet leds ligth, we assume the cable link is made, as when we unplug the cables, then the leds go out,

The OS is to clever, the two NICs have different IP addresses / Mac addresses, but the Ping command as you list wrks if we have cable in or out !
That makes no sense...

Try assigning each test port an IP on a different network, with the same subnet mask shown below.
For example:

Port 1 IP:192.168.1.1 SM:255.255.255.252 GW:192.168.1.5
Port 2 IP:192.168.1.5 SM:255.255.255.252 GW:192.168.1.1

Make sure to clear existing ARP entries we've used if they exist.

C:\temp> arp -a (this will list the ARP entries)
C:\temp> arp -d n.n.n.n (this will delete the IP entry) <---be careful with this! If the computer is in production, and you delete a vital ARP entry, it will disrupt service to that IP for a few minutes.

Then:

C:\Temp> Ping -S 192.168.1.5 192.168.1.1
 

Thread Starter

Deleted member 115935

Joined Dec 31, 1969
0
That makes no sense...

Try assigning each test port an IP on a different network, with the same subnet mask shown below.
For example:

Port 1 IP:192.168.1.1 SM:255.255.255.252 GW:192.168.1.5
Port 2 IP:192.168.1.5 SM:255.255.255.252 GW:192.168.1.1

Make sure to clear existing ARP entries we've used if they exist.

C:\temp> arp -a (this will list the ARP entries)
C:\temp> arp -d n.n.n.n (this will delete the IP entry) <---be careful with this! If the computer is in production, and you delete a vital ARP entry, it will disrupt service to that IP for a few minutes.

Then:

C:\Temp> Ping -S 192.168.1.5 192.168.1.1
Thank you,

I will chat to the software guys, and get back to you

Have good night
 
Top