mirror of
				https://github.com/Telecominfraproject/ols-nos.git
				synced 2025-11-03 19:47:56 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			556 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			556 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/bash
 | 
						|
#
 | 
						|
# usage:
 | 
						|
# arp_update: Send gratuitous ARP requests to VLAN member neighbors to refresh
 | 
						|
# the neighbors state.
 | 
						|
 | 
						|
VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'`
 | 
						|
for vlan in $VLAN; do
 | 
						|
    # generate a list of arping commands:
 | 
						|
    #   arping -q -w 0 -c 1 -i <VLAN interface> <IP 1>;
 | 
						|
    #   arping -q -w 0 -c 1 -i <VLAN interface> <IP 2>;
 | 
						|
    #   ...
 | 
						|
    arpingcmd="sed -e 's/ / -i /' -e 's/^/arping -q -w 0 -c 1 /' -e 's/$/;/'"
 | 
						|
    ipcmd="ip -4 neigh show | grep $vlan | cut -d ' ' -f 1,3 | $arpingcmd"
 | 
						|
 | 
						|
    eval `eval $ipcmd`
 | 
						|
done
 |