2

I have a simple network setup as follows (both switches are layer 3, and switch 1 is also a router to reach outside network): enter image description here

I need to move an IP address from PC A to PC B (following a PC failure). The network above is attached to eth1 on both PC's. (eth0 is connected to an unrelated network).

After failover, I issue this command from PC B:

arping -U -I eth1 -c 5 172.31.253.4
ARPING 172.31.253.4 from 172.31.253.4 eth1
Sent 5 probes (5 broadcast(s))
Received 0 response(s)

As you can see no responses are received. If I issue ifconfig on PC B I can confirm the NIC is up and running:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.1.15  netmask 255.255.255.0  broadcast 192.168.1.255
    ether 00:50:56:a5:19:72  txqueuelen 1000  (Ethernet)
    RX packets 27854916  bytes 15728132541 (14.6 GiB)
    RX errors 0  dropped 91  overruns 0  frame 0
    TX packets 19645321  bytes 2992871301 (2.7 GiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 172.31.253.4  netmask 255.255.255.0  broadcast 172.31.253.255
    ether 00:0c:29:1e:b0:1d  txqueuelen 1000  (Ethernet)
    RX packets 13397  bytes 7034331 (6.7 MiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 11998  bytes 6102989 (5.8 MiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
  1. Why is the ARP update (arping) failing? (no responses)
  2. How should I notify switch 1 (router) that the path to the old IP has changed? (and arping along from PC A won't reach switch 1 since it's 2 hops away)
1

A switch will update its MAC address table from any frame it receives on a port. Switches aren't interested in IP, or any other layer-3, addresses, only layer-2 (MAC) addresses. ARP is a host protocol to resolve a layer-3 address to a layer-2 address.

Since the layer-2 addresses of the PCs aren't changing, the switches are unaffected by the change in IP address.

You can clear the ARP cache on the router. It will eventually time out anyway, probably during the time it takes you to notice that PC A is down and move the IP address to PC B.

You are trying to arping you own address, and you don't get a reply. If you arping the gateway address, you should get a reply.

Edit:

First, a layer-3 switch is primarily a layer-2 switch. The layer-3 router of the switch is separate from the layer-2 switch part, connected to the layer-2 switch via (a) virtual interface(s), as if it was a separate external device. The router is only concerned with what are connected to its layer-3 interfaces, virtual, or physical.

Just as if it was a separate router, the router of the layer-3 switch maintains an ARP cache for a connection to a layer-2 network, but it only knows which layer-3 interface to which it should send traffic, not which particular layer-2 port to which an individual host is connected.

The layer-2 switch part is just like any other layer-2 switch, it maintains a MAC address table which tells it to which port a MAC address is connected, and it knows nothing about layer-3 addresses.

The router ARP cache and the MAC address table entries are temporal; they time out after a certain period of time. This time period may be configurable, depending on the switch model. The time period is probably much less than the amount of time it takes for you to notice that PC A is down, plus the amount of time it takes for you to configure PC B with the IP address from PC A.

The layer-2 part of the switch is the part concerned with the physical switch port to which PC B is connected, and it only cares about PC B's MAC address, which I doubt you changed when changing its IP address.

The router's ARP cache is only concerned with which MAC address should be related to the IP address, not the physical switch port to which PC A or B is connected. The ARP cache entry may be stale, but not for long, and probably not at all.

Hosts, including routers, are constantly timing out ARP cache entries when traffic isn't received from the IP addresses. Assigning the IP address to PC B will cause it to ARP for the router's MAC address when it needs to contact the router, and that will change the router's ARP cache entry for that IP address to point to PC B's MAC address.

TL;DR

In short, there is nothing you need to do to the switches when PC A is disabled, and you assign the address from PC A to PC B.

| improve this answer | |
  • Both of the switches are layer 3 switches. If traffic comes in from the outside world (top of graphic), how does switch 1 know whether to direct the traffic to 172.31.254.4 to the left or right branch? – TSG May 30 '16 at 20:38
  • Are the two PCs using the same network? If so, the switches are using layer-2. Layer-3 switches are first layer-2 switches. The layer-3 part is only for routing between networks. – Ron Maupin May 30 '16 at 20:50
  • In this case switch 1 actually routes between networks. – TSG May 30 '16 at 20:55
  • I may be missing something theoretical here. Doesn't a switch track which MAC is on which port using the ARP cache? (Isn't that how it knows where to direct traffic)? – TSG May 30 '16 at 21:01
  • No, it does not. A switch maintains a MAC address table to track a MAC address to a particular port. An ARP cache is for hosts which need to resolve a layer-3 address into a layer-2 address. Switches don't care about layer-3 addresses. A host will encapsulate a layer-3 packet in a layer-2 frame, and the switch will switch the traffic based on the layer-2 destination address in the layer-2 frame header. Switches can carry a variety of layer-3 packets (e.g. IPv4, IPX, IPv6), each of which have different layer-3 addressing. – Ron Maupin May 30 '16 at 21:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.