Fix network issue on Logger.
This commit is contained in:
1
HyperV/Vagrantfile
vendored
1
HyperV/Vagrantfile
vendored
@@ -15,6 +15,7 @@ Vagrant.configure("2") do |config|
|
||||
cfg.vm.provision "reload"
|
||||
cfg.vm.provision :shell, path: "check-eth0-ip.sh"
|
||||
cfg.vm.provision :shell, path: "../Vagrant/logger_bootstrap.sh"
|
||||
cfg.vm.provision :shell, path: "reset-static-ip.sh"
|
||||
cfg.vm.provision :shell, path: "fix-motd.sh"
|
||||
|
||||
|
||||
|
||||
24
HyperV/reset-static-ip.sh
Normal file
24
HyperV/reset-static-ip.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
reset_static_ip() {
|
||||
# The bootstrap script assumes that there are two adapters and attempts to set the ip address
|
||||
# to the eth1 adapter. This corrects the 01-netcfg.yaml file
|
||||
|
||||
MAC=$(ip a | grep "link/ether" | cut -d ' ' -f 6)
|
||||
cat > /etc/netplan/01-netcfg.yaml << EOL
|
||||
network:
|
||||
ethernets:
|
||||
eth0:
|
||||
match:
|
||||
macaddress: $MAC
|
||||
dhcp4: no
|
||||
addresses: [192.168.38.105/24]
|
||||
gateway4: 192.168.38.1
|
||||
nameservers:
|
||||
addresses: [8.8.8.8,8.8.4.4]
|
||||
set-name: eth1
|
||||
version: 2
|
||||
renderer: networkd
|
||||
EOL
|
||||
|
||||
}
|
||||
|
||||
reset_static_ip
|
||||
Reference in New Issue
Block a user