LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   ARP flush (https://www.linuxquestions.org/questions/linux-networking-3/arp-flush-4175736169/)

nag30ele 04-18-2024 06:22 AM

ARP flush
 
Hello folks,

Need help..

I want to know the background/history of doing the neighbor flush for the interface Mac address change.

void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev)
{
write_lock_bh(&tbl->lock);
neigh_flush_dev(tbl, dev, false); <<<
write_unlock_bh(&tbl->lock);
}

What would be the implications if we don't flush the neighbors for interface Mac address change event.

Thanks,
Nagendra.

TB0ne 04-18-2024 06:44 AM

Quote:

Originally Posted by nag30ele (Post 6496815)
Hello folks,
Need help..I want to know the background/history of doing the neighbor flush for the interface Mac address change.
Code:

void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev)
{
        write_lock_bh(&tbl->lock);
        neigh_flush_dev(tbl, dev, false);  <<<
        write_unlock_bh(&tbl->lock);
}

What would be the implications if we don't flush the neighbors for interface Mac address change event.

You have given no details at all about your system or what you're trying to do, and posting four lines of code with zero context is similarly meaningless. If you'd like to know the "background/history" of something, you are welcome to do your own research, rather than asking us to look it up for you.

Ask a clear question and provide relevant details and we may be able to help with your problem.

nag30ele 04-18-2024 12:08 PM

Thanks for the response.

I am currently working on a Linux-based edge router (ER) router deployment, which utilizes the VRRP protocol for high availability. During my work, I encountered a scenario where the ER, upon electing as master, replaces the original MAC address with a VMAC address (00:00:5e:00:01:<VRID>). This action triggers the kernel to flush the neighbor caches, subsequently rendering static routes inactive and causing data traffic loss for a brief period, approximately 10 seconds.

In seeking to better understand this behavior, I am curious about the necessity of flushing the neighbor cache upon a MAC address change to the interface, especially when it is not relevant to any neighbor MAC address (i.e., the MAC change is local to the interface). I am interested in exploring whether there are any potential issues or implications if we opt not to flush the cache on such MAC address changes.

I would greatly appreciate any insights on this matter.

Thank you very much for your attention to this inquiry. I look forward to your response.

Regards,
Nagendra.

yvesjv 04-18-2024 03:08 PM

Hi, that is interesting.
Understand that is likely a business and you can only provide perhaps a limited amount of info.
But could you please inform on OS,kernel and routing software used?

nag30ele 04-18-2024 11:11 PM

thanks for the response.

here are the details.

uname -a
Linux 4.19.87 #1 SMP PREEMPT 2024 x86_64 x86_64 x86_64 GNU/Linux

JJJCR 04-19-2024 01:33 AM

Quote:

What would be the implications if we don't flush the neighbors for interface Mac address change event.
I believe you will experience network issue, it will mess up your network.

Layer 2 is important, if it's not updated or will not flush. You might encounter: Packet Forwarding Failures, Communication Errors etc..

Check the internet of what's the importance of Layer 2, from there you will be able to know what will be your issue if you don't update Mac.

yvesjv 04-20-2024 02:25 PM

Quote:

Originally Posted by nag30ele (Post 6496999)
Linux 4.19.87 #1 SMP PREEMPT 2024 x86_64 x86_64 x86_64 GNU/Linux

Nothing out of the ordinary there, it's a bit behind but should be ok.

Whats is the OS and the application used?

smallpond 04-20-2024 02:52 PM

The case I can think of is taking over the MAC of some other device. So just flush instead of walking through the ARP cache and try to figure out what needs to change. There is no way that flushing should cause significant delays on the network. ARP updates are done in parallel.

nag30ele 04-22-2024 12:02 AM

Quote:

Originally Posted by yvesjv (Post 6497357)
Nothing out of the ordinary there, it's a bit behind but should be ok.

Whats is the OS and the application used?

UBUNTU, VRRP router application.

yvesjv 04-22-2024 02:51 PM

Ubuntu.
Ok, assuming you are using keepalived (or something else?) your query may have already been answered, see the link below:
https://serverfault.com/questions/10...-impact-rhel-8


All times are GMT -5. The time now is 11:05 PM.