1.7 KiB
1.7 KiB
Ubuntu Desktop 1.2: Layer 2: MAC addresses, ARP and broadcast
Finding MAC addresses and the maker's prefix, watching an ARP exchange, and checking that an address is free before you use it.
Before you start
The lab sets up a second machine, the peer, at 10.99.0.2 (name peer).
It's on the same network as this VM's interface le-host (10.99.0.1),
so the two can talk directly over Ethernet. Two of the addresses
10.99.0.21, 10.99.0.22 and 10.99.0.23 are also in use on that
network; one is free. iputils-arping isn't installed. Write answers to
the files in /root/lab-answers/.
Tasks
- Find your machine's MAC address and the maker's prefix in it, and your
default gateway's MAC address. Use the interface your default route
goes out of. Write your MAC on line 1 of
/root/lab-answers/1, the prefix (its first three bytes) on line 2, and the gateway's MAC on line 3. - Empty the neighbor table, then watch the ARP exchange as you ping the
peer. Write the peer's MAC address, from its reply, to
/root/lab-answers/2. - Check which of
10.99.0.21,10.99.0.22and10.99.0.23is free before giving it to a new machine (installiputils-arpingfirst). Write the free address to/root/lab-answers/3.
Hints
ip -br link;ip route | grep defaultgives the gateway's IP; afterping -c1to it,ip neigh showlists it withlladdrand its MAC.sudo ip neigh flush dev le-host, thensudo tcpdump -i le-host -e -n arpin one terminal andping -c1 10.99.0.2in another: look forRequest who-hastoff:ff:ff:ff:ff:ffandReply ... is-at.sudo arping -D -c 2 -I le-host ADDRESS; echo $?printsReceived 0 response(s)and0for a free address, and a reply and1for one in use.