Computer lessons

Reset windows arp table. Clearing network address caches

Hi all! Today I will tell you how to watch arp table on Windows. What is arp - an address recognition protocol designed to convert IP addresses to MAC addresses, often also called physical addresses. Earlier I already told you what a cisco arp table looks like. I think that for many colleagues who are just beginning to get acquainted with the network infrastructure of this operating system, this information will be of good help in forming the foundation. The main thing here is to understand the principle of operation and purpose; everything else is the nuances of different vendors.

An important feature of the Ethernet interface is that each interface card has its own unique address. Each card manufacturer is allocated its own pool of addresses within which it can issue cards. According to the Ethernet protocol, each interface has a 6-byte address. The address is written as six groups of hexadecimal digits of two each (hexadecimal byte notation). The first three bytes are called the prefix, and they are assigned to the manufacturer. Each prefix defines 224 different combinations, which is equal to almost 17 million addresses.

In networks, there is no one-to-one correspondence between the physical address of a network interface (MAC address of the network card) and its IP address. Searching for the corresponding Ethernet address by IP address is performed by the ARP protocol, which operates at the media access level. The protocol maintains a dynamic arp table in RAM for the purpose of caching received information. Open the command line in Windows.

How to view the arp table

Enter the command

Where you see the IP address on the left, and on the right you see the Physical address (mac address). This is the windows arp table.

By default, this cache lives for 300 seconds.

clearing arp table

Done using the command

And we see that the arp table has been cleared

How to add your entry to the arp table

This is done using the command

arp -s 157.55.85.212 00-aa-00-62-c6-09

Increasing the lifetime of an arp record in Windows 7 to 10

Let's look at the example of Windows 8.1 to see how you can increase the lifetime of arp records, why this may be necessary, well, to relieve the network of excess traffic if there is little that changes on your network. This is all done through the Windows registry

Press Win+R and enter regedit and go to the branch

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

Here, to change the period of data storage in the ARP cache, you need to create a DWORD Parameter, if your system is 32-bit, then create 32, if 64, then the same.

We set the name ArpCacheLife and set the value in seconds, after which you need to reboot and your arp record lifetime will change.

Here is the complete help for the arp command

Display and change IP to physical address conversion tables,
used by the Address Resolution Protocol (ARP).

ARP -s inet_addr eth_addr
ARP -d inet_addr
ARP -a [-N if_addr] [-v]

  • -a Displays current ARP entries by querying for current protocol data. If inet_addr is specified, then the IP and physical addresses only for the specified computer will be displayed. If ARPs are used on more than one network interface, then entries for each table will be displayed.
  • -g Same as -a option.
  • -v Displays current ARP entries in verbose logging mode. All invalid entries and entries in the feedback interface will be displayed.
    inet_addr Specifies the IP address.
  • -N if_addr Displays ARP entries for the network interface specified in if_addr.
  • -d Removes the node specified by inet_addr. The inet_addr parameter can contain the wildcard * to remove all nodes.
  • -s Adds a host and associates the Internet address inet_addr with the physical address eth_addr. The physical address is specified as 6 bytes (in hexadecimal), separated by a hyphen. This association is permanent. eth_addr Defines the physical address.
  • if_addr - If specified, it specifies the address of the Internet interface whose address translation table should change. If the parameter is not specified, the first available interface will be used.

RARP

Reverse ARP, the reverse ARP protocol is used to find out the IP address using the existing MAC address. This protocol is used in diskless machines (https://ru.wikipedia.org/wiki/Diskless_workstation) that boot over the network. First of all, such a machine must find out its IP address and network parameters so that it can access, say, a TFTP server over the network, from which it will download the boot record. The only thing this machine knows about itself is its MAC address.

Windows OS works very carefully with the network. So gentle that out-of-date node data can be stored in cache for years.

Symptoms of outdated data can range from:

  • a ping by name goes to one address, and an attempt to connect to a terminal or resource by the same name goes to another;
  • when the gateway is physically changed (one device is replaced by another, but with the same IP address), the Internet disappears;
  • IP address conflicts appear on the local network, which is indicated by a balloon above the clock;
  • Remote printers stop working
  • and a lot of other pleasures

Why does this happen? Because there are several network caches, and the data in them ceases to correspond not only to the real state of affairs on the network, but also to each other.

It can be cured using a completely standard procedure.

0. Disconnect from the local network

A running network may prevent all existing caches from being cleared correctly.

1. Clear the ARP cache

On a local network, computers communicate with each other not via IP, but via MAC addresses, that is, at a lower (link) level.
When accessing a remote computer via IP, the first step is a broadcast request to obtain its physical address. The received address is dropped into the ARP cache to speed up subsequent requests. And only then is there a connection to the remote machine, but not via IP, but via MAC address.
In normal mode, the ARP cache entry is stored for two minutes from the last access, but no more than 10 minutes.

2. Clear the NetBIOS cache

This cache contains mappings of computers' NetBIOS names to their IP addresses. If you are lucky and there is also a WINS server on the network (something like DNS for NetBIOS names), it makes sense to clean that too.
Immediately after clearing this cache, entries from the LMHOSTS file (%SystemRoot%\System32\drivers\etc\lmhosts) are loaded there.

Many people consider the NetBIOS protocol to be outdated, but Microsoft treats it like a bag of dust. Without it, Windows behaves inappropriately on the network. At the same time, with it it creates a wild broadcast flood on the ports.

The kido virus favors the use of NetBIOS.

3. Clear the DNS cache

ipconfig /flushdns

Everything is clear here. The DNS cache is a mapping of hosts' network names to their IP addresses.
Records from the HOSTS file (%SystemRoot%\System32\drivers\etc\hosts) are also loaded into it.

By the way, viruses love to change the location of the HOSTS file.

And the path to it is set in the registry, branch HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters , key DataBasePath , type REG_EXPAND_SZ .

If the command returns an error, you need to start (or restart) the DNS client service.

4. Restore connection to the local network

5. Update network settings via DHCP

The command sends a request to the last used DHCP server (the address of this server) to obtain network settings.

All the described procedures can be done in crowds and from graphics.

In HR: StartControl PanelNetwork connections.
On the desired connection, right-click and select from the menu “ Restore" After this, the following operations will be performed:

  1. Broadcast DHCP request. Responses come from all DHCP servers.
  2. Clearing the ARP cache
  3. Clearing the NetBIOS cache. With subsequent downloading of the LMHOSTS.
  4. Clearing the DNS cache. With subsequent downloading of the HOSTS file.
  5. Attempting to register in WINS (relevant only if it exists)
  6. Attempting to register in DNS (relevant only for AD)

Unfortunately, this easy method does not work well and does not always work.

In a TCP/IP connection, ARP (Address Resolution Protocol) plays a crucial role. Therefore, if there are some problems loading some sites or lack of ping of IP addresses, then try clearing the arp cache. It is worth noting that this procedure can only be performed from the command line.

Instructions

  • First, open the command line by opening the Start menu. In the search bar, type "cmd" without the quotes, and do not press Enter. Instead, you should right-click on the “cmd.exe” link and select “Run as Administrator” (or Run as Administrator). Now you need to confirm the process in the window called “User Account Control”. After this, a command line will appear in front of you. By the way, if its icon is already pinned in Start, then you won’t have to use the search.
  • Next, proceed to execute the command "arp -a". It will display a list of all ARP entries stored on the device. However, the -a option is not the only one, as other switches are supported by the arp command. For example -d, it allows you to remove the IP address. With -d -a it is possible to remove all entries from the ARP table. The -s option, on the contrary, adds entries to the table.
  • To completely remove the ARP cache in Windows 2000/XP/Vista/7, click the “Start” button, then “Run”. In the field that appears, enter the command netsh interface ip delete arpcache. To complete the operation, click Ok.
  • Just in case, check whether the cleaning procedure was successful. To do this, run the command arp -a. If the cache has not been cleared, then the reason may be an operating system error. This error may occur when activating the Routing and Remote Access service.
  • To solve the problem, go to the control panel, in the “System and Security” section, select “Administration”. Next, launch the Computer Management application and double-click to open the Services section. Click on the “Routing and Remote Access” item, and in the menu that appears, select the “Disabled” option. Once you have completed all the necessary steps, try clearing the arp cache again.
  • In a TCP/IP connection, ARP (Address Resolution Protocol) plays a crucial role. Therefore, if there are some problems loading some sites or lack of ping of IP addresses, then try clearing the arp cache. It is worth noting that this procedure can only be performed from the command line.

    Instructions

  • First, open the command line by opening the Start menu. In the search bar, type "cmd" without the quotes, and do not press Enter. Instead, you should right-click on the “cmd.exe” link and select “Run as Administrator” (or Run as Administrator). Now you need to confirm the process in the window called “User Account Control”. After this, a command line will appear in front of you. By the way, if its icon is already pinned in Start, then you won’t have to use the search.
  • Next, proceed to execute the command "arp -a". It will display a list of all ARP entries stored on the device. However, the -a option is not the only one, as other switches are supported by the arp command. For example -d, it allows you to remove the IP address. With -d -a it is possible to remove all entries from the ARP table. The -s option, on the contrary, adds entries to the table.
  • To completely remove the ARP cache in Windows 2000/XP/Vista/7, click the “Start” button, then “Run”. In the field that appears, enter the command netsh interface ip delete arpcache. To complete the operation, click Ok.
  • Just in case, check whether the cleaning procedure was successful. To do this, run the command arp -a. If the cache has not been cleared, then the reason may be an operating system error. This error may occur when activating the Routing and Remote Access service.
  • To solve the problem, go to the control panel, in the “System and Security” section, select “Administration”. Next, launch the Computer Management application and double-click to open the Services section. Click on the “Routing and Remote Access” item, and in the menu that appears, select the “Disabled” option. Once you have completed all the necessary steps, try clearing the arp cache again.
  • Rate the article!

    The ARP protocol is designed to determine link-layer addresses (MAC addresses) from known IP addresses. This is a very important protocol; its operation directly affects the performance of the network as a whole.

    Purpose of the ARP protocol

    For devices to communicate with each other, the sending device must have the recipient's IP and MAC addresses. When one device tries to communicate with another known device, it needs to determine the recipient's MAC address. contains a special protocol called ARP (Address Resolution Protocol), which allows you to automatically obtain a MAC address. In Fig. The following illustrates the process to determine the MAC address associated with a known IP address.

    Some devices store special ARP tables that contain information about the MAC and IP addresses of other devices connected to the same local network. ARP tables allow you to establish a one-to-one correspondence between IP and MAC addresses. Such tables are stored in certain areas of RAM and are maintained automatically on each of the network devices (see tables below). In rare cases, you have to create ARP tables manually. Note that each computer on the network maintains its own ARP table.

    Wherever data is sent by a network device, the information stored in the ARP table is always used to forward it (Fig. below: one of the devices wants to transfer data to another device).


    Functioning of the ARP protocol in subnets

    To transmit data from one node to another, the sender must know the IP and MAC address of the recipient. If it cannot obtain the physical address it is looking for from its own ARP table, it initiates a process called an ARP request, which is illustrated in Figure 1. higher.

    An ARP request allows a host to determine the recipient's MAC address. The host creates an ARP request frame and sends it to all network devices. The ARP request frame consists of two parts:

    • frame header;
    • ARP request messages.

    To ensure that all devices can receive the ARP request, a MAC address broadcast is used. In the MAC addressing scheme, the broadcast address contains the hexadecimal number F in all bits and thus has the form FF-FF-FF-FF-FF-FF (This MAC address entry is called canonical, in which parts of the address are separated by a hyphen (-) ; there is also an alternative notation in which the parts of the address are separated by a colon (:).). Because ARP request packets are broadcast, all network devices connected to the local network can receive such packets and forward them to higher-level protocols for further processing. If a device's IP address matches the recipient's IP address in an ARP broadcast request, that device responds to the sender with its MAC address. This message is called an ARP response.

    After receiving the ARP response, the sending device of the ARP broadcast request retrieves the MAC address from the sender's hardware address field and updates its ARP table. This device can now properly address packets using both the MAC and IP address. The received information is used to encapsulate data at the second and third levels before sending it over the network. When the data reaches its destination, the link layer checks for address matching, discards the link header that contains the MAC addresses, and passes the data to the network layer. At the network level, the correspondence between its own IP address and the recipient's IP address contained in the third-level header is checked. At the network layer, the IP header is discarded and the encapsulated data is passed to the next layer, the transport layer (layer 4). This process is repeated until the remaining, partially unpacked, data reaches the application (layer 7), where the user portion of the data will be read.

    When adding a new router or switch to the network, the question arises of what name to register in the DNS (clinical cases when the IP address is not registered in the DNS at all, but there is simply a list of IP addresses on a piece of paper, I do not consider, although I have seen this in networks on dozens of routers.). You can come up with a name for each device separately, or you can follow the logical and convenient scheme described below.

    Setting up an NTP server on a Cisco router

    Configuring SNMP on a Cisco Router

    We indicate from which ip we allow access:

    Access-list 60 permit 192.0.2.29 access-list 60 permit 198.51.100.92

    Enable SNMP v1 with community string secret for read-only access:

    Snmp-server community secret RO 60

    Cisco Quick Tips

    Immediate restart

    To immediately restart or reboot Cisco, in enable mode write:

    Router#reload

    To restart or reboot Cisco after N minutes, in enable mode write:

    Router#reload in N

    Tip: This is useful when you are afraid that configuration changes may do something that will cut you off from the router. You tell the router the number of minutes after which it should reboot, and then make your changes. If your changes turn out to be disastrous and you can't connect to the router again to fix them, the router will reboot after a certain amount of time and restore the original configuration.

    Cisco routing

    Adding static routes on Cisco routers

    For example, in configuration mode:

    Router(config)#ip route 192.168.1.0 255.255.255.240 192.168.1.254 1

    Displaying the route table on Cisco routers

    In enable mode:

    Router#show ip route

    Cisco ARP

    Clearing the ARP table on Cisco switches or routers

    To clear the ARP table, in enable mode:

    Router#clear arp

    Displaying the ARP table on Cisco switches or routers

    To display the ARP table on Cisco, in enable mode:

    Router#show arp

    Output of processor load on Cisco switches or routers

    Like any computer, a Cisco router can be limited by the power of its processor. To view processor load in enable mode:

    Router#show proc cpu

    CPU utilization for five seconds: 37%/31%; one minute: 39%; five minutes: 40%

    Cisco Memory

    Viewing used and available memory on Cisco routers and switches

    Like any computer, a Cisco router can be limited by the amount of memory available. To view used and available memory, in enable mode:

    Router#show proc mem

    At the beginning of the output, notice a line like this:

    Total: 200234528, Used: 70508188, Free: 129726340

    Cisco Committed Access Rate (CAR)

    An example that limits an IP to 512K, with a nice, fat burst.

    First create access lists:

    Access-list 100 permit ip host 192.168.100.100 access-list 100 permit ip host 192.168.100.100 any

    Then assign rate limit rules to the appropriate interface:

    Rate-limit input access-group 100 512000 1024000 2048000 conform-action transmit exceed-action drop rate-limit output access-group 100 512000 1024000 2048000 conform-action transmit exceed-action drop

    Hint: If you specify a non-existent access list in a rate limiting rule, then the rule applies to all traffic. This is usually not a good thing.

    Notes

    see also

    Links