Let's take a look at how some static ARP configurations can
cause some problems within the network.
I'll start with my Windows command prompt.
To make sure I have the default-gateway in my ARP cache, I'll ping 20.
1.
Then I'll check my ARP cache with arp -a and there I can see my
default-gateway at 00-23-5e-e2-5f-ee as a dynamically learned entry.
Thinking that I can save some ARP overhead,
I'm going to change that to a static entry.
Within Windows 10,
we'll have to use the netsh command to set a static entry in our ARP cache.
The full command needed to change this from a dynamic entry
to a static entry is netsh interface ipv4 set neighbors
Ethernet0 is my network card's name, the 20.
1.
1 is the default-gateway's IP address,
and there is the default-gateway's MAC address on the end.
Now notice this command requires elevation so I've got
an administrator command prompt open.
I'll check my ARP cache to make sure that it's there and we can see
that the dynamic entry is now changed to a static one.
The static entry should work just as well at pinging the default-gateway,
but I'll check to make sure.
Let's go over to the Ubuntu Linux host to see how that works there.
I'll open my command prompt and I'll ping 20.
1.
1, this'll make sure that I have the ARP cache entry,
so I'll check with ARP, and likewise,
we'll see the default-gateway at the MAC address of 00:23:5e:e2:5f:ee.
Within Linux, I can set that as a static entry with arp -s,
give the IP address of the default-gateway,
and then I'll copy and paste that MAC address to make sure I get it right.
Checking my ARP cache entry,
we can see that it's marked with the flag M for manually entered address.
Another way to check is with the arp -an where we can see
its permanently entered as a static entry.
Now let's return to the Windows host where we'll make some
changes to our default-gateway router.
I'll bring up the routers command prompt and I'll show interface f0/0,
which is servicing the LAN.
At the top, we can see the theater faces up,
that its MAC address and IP address match what's in our host.
Since this is my only default-gateway,
I want to create some redundancy in the network by adding another router
and adding a router redundancy protocol like HSRP.
I've already staged another router,
connected it to the LAN and configured it for HSRP.
Let's go take a look at that router.
I'll log in and I'll show the running configuration on its interface f0/1,
which is now plugged into our LAN.
That interface has an IP address of 20.
1.
254 with a /24 mask.
I've also configured it for HSRP, or Hot Standby Routing Protocol,
with a group number of 5 and set its IP address to 20.
1.
1 matching the LAN as the default-gateway.
You'll notice it's in shutdown mode because my other router LabRouter3 is
currently servicing the LAN as the default-gateway.
To have this router take over as the default-gateway and
start my hot standby routing protocol,
I'll have to bring that FastEthernet 0/1 out of shutdown.
I'll go to global configuration mode to the interface f0/1.
Now before I take that out of shutdown,
I'm actually going to create a service interruption
by shutting off the LabRouter3, which is currently servicing hosts.
I'll move back to LabRouter3,
go to global configure mode into its interface fast ethernet 0/0,
which is servicing the LAN, and I'll issue the shutdown command.
I'll quickly move back to my LabRouter1 and I'll issue the no shutdown
command to bring that on and start servicing hosts.
To make sure my LabRouter1 is working, I'll show interface f0/1.
I see that the interface is up, it's at the address 20.
1.
254/24, and I'll show the standby configuration for HSRP.
We see the fast ethernet 0/1 is actively servicing hosts at the IP 20.
1.
So let's return to my Windows command prompt and ping 20.
1.
Here, I'm getting request timed out,
but it's not because my HSRP is misconfigured or I don't have a default-gateway.
The problem is that static MAC address in my ARP cache.
If we look at the standby configuration on the router,
we can see that there is a virtual MAC address that's been
assigned to the HSRP group that MAC address 0000:0c07:ac05 is
the well-known HSRP MAC address,
but it doesn't match the static configuration within my Windows.
For this reason, Windows can't reach the default-gateway.
To clear my ARP cache, I'm going to use arp -d and then 20.
1.
1 to clear out that static entry.
I'll check my ARP cache and see that it's cleared out.
Now when I ping 20.
1.
1 dynamic ARP should resolve the IP to MAC address
binding for the new default-gateway.
I'll check my ARP cache again and there we can see the
well-known HSRP MAC address dynamically learned and matching
our default-gateway IP address of 20.
1.
Let's return to the Ubuntu Linux host.
If I ping 20.
1.
1, that static entry has the exact same problem, it's encapsulating data for 20.
1.
1 to the MAC address of 00:23:5e:e2:5f:ee, not the new HSRP MAC address.
I'll hit Ctrl+C to break it and we can say that 20 packets
transmitted and none received resulting in 100% loss.
I'll use the same command, arp -d 20.
1.
1 to clear that static entry and check my ARP cache.
Currently, it says incomplete, so I'll ping the default-gateway at 20.
1.
1 and let dynamic ARP pick up the information we need.
I'll check my ARP cache entry,
and now we can see the default-gateway with its HSRP configured MAC address.
Of course, if this were a real redundancy scenario,
I would need to add another HSRP router.
Instead, let's check out how static ARP entries are created on Cisco routers,
how they create similar problems, and how you can remove them.
I'm going to create a static entry on my router pointing at my Ubuntu server.
To make sure I know my server's MAC and IP address, I'm going to ping it at 20.
1.
16.
I'll check my ARP cache and can see that its MAC address is set to aa11.
bb22.
cc33.
To set that as a static entry, I'll use the ARP 20.
1.
16 with the MAC address aa11.
bb22.
cc33 with the arpa keyword.
I'll check my ARP cache with show ARP again,
and now we can see that it's a static entry.
Notice in the minutes timer column, there is a dash there.
This means that dynamic ARP learning for that entry is
disabled and that this is a static entry.
Of course, when I ping 20.
1.
16, that entry worked fine.
However, if I move over to my Ubuntu host and we make a change to the system,
for example, change out its network card,
turn on some link redundancy protocols,
or create a server cluster at this machine's IP address,
then its MAC address is going to change.
On my Linux Server, I'll bring up the command line,
I'll use the ifconfig command to show its IP and MAC address,
and to simulate a network card changeover,
I'll use the ip link command and I'll set device ens33,
which is the name for my network card,
to MAC address aa:11:bb:22:cc and changing the 33 to 00.
And now if I return to my router's command prompt and I ping 20.
1.
16, the Ubuntu host, we can see that we're getting timeouts.
This is because the static entry I created on the router for 20.
1.
16 at aa11.
bb22.
cc33 doesn't match the change I just made on the Ubuntu host network card.
Now to clear out the static entry,
I'll move to global configuration mode and I'll erase
the static entry with no arp 20.
1.
16.
Now if I check my ARP cache, we'll see that there is no entry, and if I ping 20.
1.
16, dynamic ARP should figure things out for us.
So I'll check my ARP cache again and we can see that the new
MAC address is in there with the IP 20.
1.
16.
As we've seen, static ARP entries ignore dynamic ARP updates,
so when IP to MAC address bindings change in the network,
they can't adapt.
For this reason and because the overhead in
maintaining static ARP entries are so high, it's best to know how to remove them and let dynamic ARP do its job.