systemvm: vpc router fix /etc/network/interfaces is misconfigured (#6435)

This PR fixes that the /etc/network/interfaces is misconfigured in VPC VR startup, which causes VPC VR to be stuck for 1 minute and continue working.

The issue is because ifup eth0 and ifdown eth0 do not work when /etc/network/interfaces is not correct in VPC VR.
This commit is contained in:
Wei Zhou 2022-12-09 13:40:20 +01:00 committed by GitHub
parent b7f845ab13
commit 11d27a5a3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 5 deletions

View File

@ -188,6 +188,7 @@ setup_interface_sshd() {
setup_sshd $ETH1_IP "eth1"
elif [ "$TYPE" == "vpcrouter" ]; then
init_interfaces "eth0"
setup_interface "0" $ETH0_IP $ETH0_MASK $GW
setup_sshd $ETH0_IP "eth0"

View File

@ -25,11 +25,6 @@ setup_vpcrouter() {
grep -q $NAME /etc/hosts || echo "127.0.0.1 $NAME" >> /etc/hosts;
fi
cat > /etc/network/interfaces << EOF
auto lo eth0
iface lo inet loopback
EOF
echo $NAME > /etc/hostname
echo 'AVAHI_DAEMON_DETECT_LOCAL=0' > /etc/default/avahi-daemon
hostnamectl set-hostname $NAME