Saturday, February 22, 2020

Windows 10 fails to use correct source address with "ping -S"

I was doing some troubleshooting with a Windows 10 system and discovered that the ping -S argument, which is supposed to specify the source address used in the ping, is not working correctly.

If I do this:

C:\WINDOWS\system32>ping -S 1.2.3.4 10.0.0.8 Pinging 10.0.0.8 from 1.2.3.4 with 32 bytes of data: 

But then do a tcpdump on my nearby router, it's using the wrong address as the source for the ping.

some-firewall:~$ sudo /usr/sbin/tcpdump -n -i eth1 dst 10.0.0.8 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth1, link-type EN10MB (Ethernet), capture size 262144 bytes 19:19:12.654581 IP 1.2.3.101 > 10.0.0.8: ICMP echo request, id 1, seq 94, length 40 19:19:17.176845 IP 1.2.3.101 > 10.0.0.8: ICMP echo request, id 1, seq 95, length 40 

Fucking Windows.

The system has two IP addresses assigned on it's single network interface. Inbound connections to that secondary IP work fine.



No comments:

Post a Comment