cancel
Showing results for 
Search instead for 
Did you mean: 

Can't ping between Windows and Linux CDC ECM - Ethernet

Gwen1
Associate II

Hi, I have a problem with pinging PCs with my adapter USB-Ethernet with an STM32F207. I'm currently working with CDC-ECM for Ethernet-Over-USB. 

First case: I have 2 VMs with Linux on them. The USB is connected to the first VM (VM1) and the Ethernet is connected to the second (VM2). I can ping VM1 with VM2 but I can't ping VM2 with VM1.

Second case: I have one VM with Linux and a Windows machine. The USB is connected to the VM and the ethernet is connected to the Windows machine. When I ping the VM with Windows or Windows with the VM I have only loss packets...

 

Does someone have any idea why ?

Thanks,

1 REPLY 1
STackPointer64
ST Employee

Hello @Gwen1,

Case 1: Two Linux VMs

  • I suggest verifying the IP addresses, subnet masks, and routing in particular on both VMs using ip addr,ip route and in your virtualization application settings. Make sure they are in the same subnet or have proper routing rules.
  • Please confirm that the USB CDC-ECM interface on VM1 is up and properly configured (ip link show), with the correct IP assigned.
  • It would be helpful to temporarily disable firewalls on both VMs (sudo iptables -F and sudo ufw disable) to rule out any ICMP blocking.
  • Check the ARP tables (arp -n) to ensure MAC address resolution is working; if ARP fails, packets won’t be delivered.
  • Since VM2 can ping VM1 but not vice versa, I recommend reviewing the USB CDC-ECM driver logs on VM1 (dmesg) for any errors or dropped packets.

Case 2: Linux VM and Windows machine

  • Please confirm the IP addresses and subnet masks on both systems (ipconfig /all on Windows; ip addr and ip route on Linux).
  • I advise checking the Windows Firewall settings, as it often blocks ICMP by default. You can temporarily disable it or allow ping through the firewall with:
     
    netsh advfirewall firewall add rule name="ICMP Allow inbound" protocol=icmpv4:8,any dir=in action=allow
    
  • Make sure the USB CDC-ECM interface on Linux is recognized and configured properly; check dmesg for any driver errors.
  • Verify that the Ethernet link between STM32 and Windows is active by checking link LEDs and using ethtool on Linux if available.
  • Check ARP resolution on both sides (arp -a on Windows, arp -n on Linux), since failure here will cause ping to fail.

Best regards,

To improve visibility of answered topics, please click Accept as Solution on the reply that resolved your issue or answered your question.