Score:0

Choosing Ping source interface has no effect

in flag

I'm testing some networking changes and would like to send a ping from a Ubuntu box using a dummy interface as the source address. I use -I and it looks correct:

10.90.90.90 is the dummy interface's address and 10.80.20.22 is the ethernet address.

$ ping 10.0.10.156 -I 10.90.90.90
PING 10.0.10.156 (10.0.10.156) from 10.90.90.90 : 56(84) bytes of data.
64 bytes from 10.0.10.156: icmp_seq=1 ttl=64 time=30.2 ms
64 bytes from 10.0.10.156: icmp_seq=2 ttl=64 time=27.6 ms

However when I run tcpdump on the ping's destination I can see the packets are arriving with the source's main ethernet address, not the one it says from...

$ sudo tcpdump icmp -n
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
12:14:10.980956 IP 10.80.10.22 > 10.0.10.156: ICMP echo request, id 1, seq 12, length 64
12:14:10.980988 IP 10.0.10.156 > 10.80.10.22: ICMP echo reply, id 1, seq 12, length 64

Why is ping lying to me?

A.B avatar
cl flag
A.B
Are you using iptables/nftables rules doing NAT?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.