[orchagent]: Add ARP update script to maintain VLAN neighbors (#401)
- Extend ARP reachable time to 30min - Add arping to docker-swss - Add arp_update script to routinely probe neighbors Signed-off-by: Shuotian Cheng <shuche@microsoft.com>
This commit is contained in:
parent
910e666798
commit
8af03fd0f9
@ -232,6 +232,8 @@ set /files/etc/sysctl.conf/net.ipv4.conf.all.arp_filter 0
|
|||||||
set /files/etc/sysctl.conf/net.ipv4.conf.all.arp_notify 1
|
set /files/etc/sysctl.conf/net.ipv4.conf.all.arp_notify 1
|
||||||
set /files/etc/sysctl.conf/net.ipv4.conf.all.arp_ignore 2
|
set /files/etc/sysctl.conf/net.ipv4.conf.all.arp_ignore 2
|
||||||
|
|
||||||
|
set /files/etc/sysctl.conf/net.ipv4.neigh.default.base_reachable_time_ms 1800000
|
||||||
|
|
||||||
set /files/etc/sysctl.conf/net.ipv6.conf.default.forwarding 1
|
set /files/etc/sysctl.conf/net.ipv6.conf.default.forwarding 1
|
||||||
set /files/etc/sysctl.conf/net.ipv6.conf.all.forwarding 1
|
set /files/etc/sysctl.conf/net.ipv6.conf.all.forwarding 1
|
||||||
set /files/etc/sysctl.conf/net.ipv6.conf.eth0.forwarding 0
|
set /files/etc/sysctl.conf/net.ipv6.conf.eth0.forwarding 0
|
||||||
|
@ -5,7 +5,7 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
|
|
||||||
RUN apt-get install -f -y ifupdown libdbus-1-3 libdaemon0 libjansson4
|
RUN apt-get install -f -y ifupdown arping libdbus-1-3 libdaemon0 libjansson4
|
||||||
|
|
||||||
## Install redis-tools dependencies
|
## Install redis-tools dependencies
|
||||||
## TODO: implicitly install dependencies
|
## TODO: implicitly install dependencies
|
||||||
@ -26,7 +26,7 @@ debs/{{ deb }}{{' '}}
|
|||||||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
||||||
RUN rm -rf /debs
|
RUN rm -rf /debs
|
||||||
|
|
||||||
COPY ["start.sh", "orchagent.sh", "swssconfig.sh", "/usr/bin/"]
|
COPY ["arp_update", "start.sh", "orchagent.sh", "swssconfig.sh", "/usr/bin/"]
|
||||||
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||||
COPY ["ipinip.json.j2", "/usr/share/sonic/templates/"]
|
COPY ["ipinip.json.j2", "/usr/share/sonic/templates/"]
|
||||||
COPY ["mirror.json.j2", "/usr/share/sonic/templates/"]
|
COPY ["mirror.json.j2", "/usr/share/sonic/templates/"]
|
||||||
|
17
dockers/docker-orchagent/arp_update
Executable file
17
dockers/docker-orchagent/arp_update
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# usage:
|
||||||
|
# arp_update: Send gratuitous ARP requests to VLAN member neighbors to refresh
|
||||||
|
# the neighbors state.
|
||||||
|
|
||||||
|
VLAN=`sonic-cfggen -m /etc/sonic/minigraph.xml -v 'minigraph_vlans.keys() | join(" ")'`
|
||||||
|
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
|
@ -32,3 +32,8 @@ supervisorctl start neighsyncd
|
|||||||
|
|
||||||
supervisorctl start swssconfig
|
supervisorctl start swssconfig
|
||||||
|
|
||||||
|
# Start arp_update when VLAN exists
|
||||||
|
VLAN=`sonic-cfggen -m /etc/sonic/minigraph.xml -v 'minigraph_vlans.keys() | join(" ")'`
|
||||||
|
if [ "$VLAN" != "" ]; then
|
||||||
|
supervisorctl start arp_update
|
||||||
|
fi
|
||||||
|
@ -59,3 +59,10 @@ autorestart=false
|
|||||||
stdout_logfile=syslog
|
stdout_logfile=syslog
|
||||||
stderr_logfile=syslog
|
stderr_logfile=syslog
|
||||||
|
|
||||||
|
[program:arp_update]
|
||||||
|
command=bash -c "/usr/bin/arp_update && sleep 300"
|
||||||
|
priority=8
|
||||||
|
autostart=false
|
||||||
|
autorestart=true
|
||||||
|
stdout_logfile=syslog
|
||||||
|
stderr_logfile=syslog
|
||||||
|
Loading…
Reference in New Issue
Block a user