Ethernet Loopback plug - running a ping

For sure :)

# ip address list dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:1e:4f:9b:4a:ab brd ff:ff:ff:ff:ff:ff
    inet 10.10.141.83/24 brd 10.10.141.255 scope global eth0
    inet6 fe80::21e:4fff:fe9b:4aab/64 scope link 
       valid_lft forever preferred_lft forever
# ip address add 10.10.141.253/24 dev eth0
# ip address list dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:1e:4f:9b:4a:ab brd ff:ff:ff:ff:ff:ff
    inet 10.10.141.83/24 brd 10.10.141.255 scope global eth0
    inet 10.10.141.253/24 scope global eth0
    inet6 fe80::21e:4fff:fe9b:4aab/64 scope link 
       valid_lft forever preferred_lft forever
# ping -I 10.10.141.83 10.10.141.253
PING 10.10.141.253 (10.10.141.253) from 10.10.141.83 : 56(84) bytes of data.
64 bytes from 10.10.141.253: icmp_seq=1 ttl=64 time=0.050 ms
64 bytes from 10.10.141.253: icmp_seq=2 ttl=64 time=0.034 ms
64 bytes from 10.10.141.253: icmp_seq=3 ttl=64 time=0.038 ms
^C
--- 10.10.141.253 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.034/0.040/0.050/0.010 ms
# ip address delete 10.10.141.253/24 dev eth0
# ping -I 10.10.141.83 10.10.141.253
PING 10.10.141.253 (10.10.141.253) from 10.10.141.83 : 56(84) bytes of data.
From 10.10.141.83 icmp_seq=1 Destination Host Unreachable
From 10.10.141.83 icmp_seq=2 Destination Host Unreachable
From 10.10.141.83 icmp_seq=3 Destination Host Unreachable
^C
--- 10.10.141.253 ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3016ms

Actually dead simple. :) (Just kidding, it's always simple if you already know it)

I'm not sure L2 would really work but with ip neigh you can should be able to modify the arp cache also (so much for dead simple)


You might find that arping is more likely to hit the wire, as this uses arp, and therefore avoids the IP stack completely.