A good to know command line tool that you can use is the arp command, ARP stands for address resolution protocol.
The Arp command line tool:
It is a network protocol and it is used for resolution of the network layer addresses into the link layer addresses, convert an IP address into its physical address, like Ethernet address.
What is link layer?
The OSI, Open Systems Interconnection, model is the standard functionality in a communications system in terms of abstraction layers.
A group with the same functionality lays in the same logical layer. So a layer is actually a group of communication methods from the same type (like a group of protocols). ‘A’ function is not in the ‘A’ layer will only serve the above layer and can only be served by the below layer.
The Open Systems Interconnection (OSI) model contains 7 logical layers:
7. The Application Layer.
6. The Presentation Layer.
5. The Session Layer.
4. The Transport Layer.
3. The Network Layer.
2. The Data Link Layer.
1. The Physical Layer.
More information on the OSI Model can be found on the Wikipedia OSI Model page.
Example of the command output:
Here is the output for the /? command parameter (show the help screen):
Displays and modifies the IP-to-Physical address translation tables used by address resolution protocol.
Use: ARP -s inet_addr eth_addr [if_addr]
Or: ARP -d inet_addr [if_addr]
ARP -a [inet_addr] [-N if_addr] [-v]
- -a: Displays current address resolution protocol entries by interrogating the current protocol data. If inet_addr is specified, the IP and Physical addresses for only the specified computer are displayed. If more than one network interface uses ARP, entries for each address resolution protocol table are displayed.
- -g: Same as -a.
- -v Displays current ARP entries in verbose mode. All invalid entries and entries on the loopback interface will be shown. inet_addr Specifies an internet address.
- -N: if_addr Displays the ARP entries for the network interface specified by if_addr.
- -d: Deletes the host specified by inet_addr. inet_addr may be wildcarded with * to delete all hosts.
- -s: Adds the host and associates the Internet address inet_addr with the Physical address eth_addr. The Physical address is given as 6 hexadecimal bytes separated by hyphens. The entry is permanent.
- eth_addr: Specifies a physical address.
- if_addr: If present, this specifies the Internet address of the interface whose address translation table should be modified.
- If not present, the first applicable interface will be used.
arp -s 18.104.22.168 00-aa-00-62-c6-09: Adds a static entry.
arp -a: Displays the address resolution protocol table.
Using this command will show you the Internet address, the physical address and its type: dynamic or static.