This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/files/image_config/interfaces/interfaces-config.sh
lguohan 11b0cd93e8
[baseimage]: bring down eth0 before restart networking (#1555)
cfggen generates new eth0 configuration. Need to first
clean existing configuration on eth0 before bring up
new configuration on eth0. Thus, we need to first bring
down eth0 before putting new configuration into /etc/network/
interfaces

Signed-off-by: Guohan Lu <gulv@microsoft.com>
2018-04-01 21:36:43 -07:00

12 lines
276 B
Bash
Executable File

#!/bin/bash
ifdown eth0
sonic-cfggen -d -t /usr/share/sonic/templates/interfaces.j2 > /etc/network/interfaces
[ -f /var/run/dhclient.eth0.pid ] && kill `cat /var/run/dhclient.eth0.pid` && rm -f /var/run/dhclient.eth0.pid
systemctl restart networking
ifdown lo && ifup lo