Logon onto a terminal session on sandbox.
Identify the Ethernet addresses which have been used by your computer.
Type:
/sbin/arp -a
The address resolution protocol (arp) is an important protocol which IP networks use to transmit datagrams over Ethernet LANs. The "arp" program prints the contents of the computer's address resolution protocol (arp) cache. This consists of a list of IP addresses which have recently been used to contact remote computers on the same LAN. Alongside each IP address is the hardware (or Medium Access Control, MAC) address information corresponding to each computer. This information is required before the computer may communicate with any other computer directly connected to the LAN, since it is used in the destination address field of the MAC header which encapsulates each IP packet.Now try to identify the Ethernet address of another computer
Type:
/sbin/arp followed by an IP address in dotted decimal. notation.
It is suggested that you pick an IP address which has the first three decimal numbers the same as other entries in the arp cache. (if you can't remember how to find out the IP address of your own computer look at exercise 1 again). The arp program will tell you whether it can find out the Ethernet hardware address (also known as the MAC address) corresponding to the specified IP address.Have you now found an IP address which is not currently in use?
You may have found that the arp-request sent by the arp program could not complete. You may remember that the arp protocol uses an Ethernet Broadcast frame which is sent to all systems which are directly connected to the local Ethernet LAN. Although all computers receive the arp-request, only the computer with the specified IP address (known as the "target") replies. Therefore if no reply is received (i.e. the arp-request is not completed), it indicates that there is currently no computer on the connected LAN with the specified IP address.Type:
/usr/sbin/ping x.x.x.y
Use ping (ICMP) again, but select other values for the final part of the IP address (i.e. the last of the four decimal numbers separated by dots). One suggestion is to use a high number (e.g. y=250). Since most network administrators start numbering their computers in succession starting with "1", the higher the number the greater the chance of the number not being allocated to an operating computer.What did you find out?
Finding other computers connected to the LAN
As a final experiment, you may like to use the IP network broadcast address which you previously found out from exercise 1. (This was found using ifconfig -a). The IP broadcast address may be used to find the IP addresses of all other computers on the same network. Try typing the following (but make sure you use the broadcast address specified by ifconfig -a, not the one in this example!!!)Type:
/usr/sbin/ping -b x.x.x.255
Did you receive a reply?Type:The ping command will complete as soon as it receives one valid ICMP echo response. If you used a broadcast address, you should have received a response from each computer in your IP network. The ping command will have completed when you received the first response to the transmitted ICMP echo request.
To find out the list of all active computers, you will need to again look into your arp cache.
/usr/sbin/arp -a
This will display the current arp cache which should now contain an entry for every host on your network!The arp cache is of a finite size, and therefore on a large LAN some entries may overflow the cache and will be discarded. After a period of use, the cache would become full of incomplete and obsolete entries for computers that are not is use if it was allowed to grow without check. The arp cache is therefore periodically flushed of all entries. This deletes unused entries and frees space in the cache. It also removes any unsuccessful attempts to contact computers which are not currently running.
Do not use the ping command with the broadcast address often! It asks every host on the network to reply, and should not be typed frequently - since it would cause a lot of network traffic!!