show the ARP cache
every network interface card (NIC)/LAN network card has a unique-as-possible vendor-asigned MAC address in the format 00:15:5d:00:07:08
this address is changeable like this:
ip link set dev eth0 down; ip link set dev eth0 address 00:15:5d:00:07:09; ip link set dev eth0 up;
(thanks)
WARNING! Changing your NIC’s MAC will massively reset your connectivity 😀 (switch, router, dhcp will have to relearn about those changes))
the first thing a NIC does when hooked up to a switch – it announces it’s presence – to the switch and all other attached devices by broadcasting to FF:FF:FF:FF:FF:FF (ARP broadcast = send to all address)
“hello i am 00:22:4d:6a:e5:c6 and looking for a DHCP server to get an dynamic IP asigned”
when properly configured the DHCP server answers like this
“hello 00:22:4d:6a:e5:c6 please take that IP 172.20.0.7”
so everyone on the network knows that 00:22:4d:6a:e5:c6 can be reached via TCP via IP 172.20.0.7
[root@CentOS7 user]# arp -an ? (172.20.0.2) auf 2c:76:8a:aa:60:3a [ether] auf eth0 ? (172.20.0.1) auf 34:31:c4:53:37:8a [ether] auf eth0 ? (172.20.0.7) auf 00:22:4d:6a:e5:c6 [ether] auf eth0 ? (192.168.1.1) auf 00:15:5d:00:07:08 [ether] auf eth0 ? (192.168.1.3) auf 00:15:5d:00:07:09 [ether] auf eth0 [root@CentOS7 user]# ip neighbour show 172.20.0.2 dev eth0 lladdr 2c:76:8a:aa:60:3a STALE 172.20.0.1 dev eth0 lladdr 34:31:c4:53:37:8a STALE 172.20.0.7 dev eth0 lladdr 00:22:4d:6a:e5:c6 REACHABLE 192.168.1.1 dev eth0 lladdr 00:15:5d:00:07:08 STALE 192.168.1.3 dev eth0 lladdr 00:15:5d:00:07:09 STALE
listen to the ARP IP<->MAC messages
suse12:~ # ip monitor 172.20.0.2 dev eth0 lladdr 2c:76:8a:aa:60:3a STALE 172.20.0.7 dev eth0 lladdr 00:22:4d:6a:e5:c6 STALE 172.20.0.7 dev eth0 lladdr 00:22:4d:6a:e5:c6 STALE 172.20.0.7 dev eth0 lladdr 00:22:4d:6a:e5:c6 PROBE 172.20.0.7 dev eth0 lladdr 00:22:4d:6a:e5:c6 REACHABLE 172.20.0.2 dev eth0 lladdr 2c:76:8a:aa:60:3a STALE 172.20.0.2 dev eth0 lladdr 2c:76:8a:aa:60:3a PROBE 172.20.0.2 dev eth0 lladdr 2c:76:8a:aa:60:3a REACHABLE 172.20.0.7 dev eth0 lladdr 00:22:4d:6a:e5:c6 STALE 172.20.0.7 dev eth0 lladdr 00:22:4d:6a:e5:c6 STALE 172.20.0.7 dev eth0 lladdr 00:22:4d:6a:e5:c6 STALE 172.20.0.7 dev eth0 lladdr 00:22:4d:6a:e5:c6 PROBE 172.20.0.7 dev eth0 lladdr 00:22:4d:6a:e5:c6 REACHABLE 172.20.0.2 dev eth0 lladdr 2c:76:8a:aa:60:3a STALE ...
monitor – watch for netlink messages.
manpages:
Links:
https://dwaves.de/2013/03/19/wie-funktioniert-arp-how-does-arp-work-specs-definition-specification/
liked this article?
- only together we can create a truly free world
- plz support dwaves to keep it up & running!
- (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
- really really hate advertisement
- contribute: whenever a solution was found, blog about it for others to find!
- talk about, recommend & link to this blog and articles
- thanks to all who contribute!