i'm using ubuntu 20.04 on a virtual machine and i have changed mi ip conf from dymanic to static, but i do not have network connection; the file 00-installer-config.yaml
located at /etc/netplan
was at the beginning:
network:
ethernets:
enp0s3:
dhcp4: true
version: 2
i changed the file, through nano, to:
network:
ethernets:
enp0s3:
dhcp4: no
addresses: [10.10.2.188/24]
gateway4: 10.10.0.1
nameservers:
addresses: [10.10.1.7, 10.10.0.1]
version: 2
then i use the command $sudo netplan apply
and i do not get any error, although i can see my host computer through ping, i do not get any network connection.
Here is an output from netplan debug:
user:~$ sudo netplan --debug generate
DEBUG:command generate: running ['/lib/netplan/generate']
** (generate:1348): DEBUG: 16:04:25.389: Processing input file /etc/netplan/00-installer-config.yaml..
** (generate:1348): DEBUG: 16:04:25.391: starting new processing pass
** (generate:1348): DEBUG: 16:04:25.392: We have some netdefs, pass them through a final round of validation
** (generate:1348): DEBUG: 16:04:25.394: enp0s3: setting default backend to 1
** (generate:1348): DEBUG: 16:04:25.395: Configuration is valid
** (generate:1348): DEBUG: 16:04:25.397: Generating output files..
** (generate:1348): DEBUG: 16:04:25.398: openvswitch: definition enp0s3 is not for us (backend 1)
** (generate:1348): DEBUG: 16:04:25.400: NetworkManager: definition enp0s3 is not for us (backend 1)
(generate:1348): GLib-DEBUG: 16:04:25.401: posix_spawn avoided (fd close requested)
(generate:1348): GLib-DEBUG: 16:04:25.411: posix_spawn avoided (fd close requested)
I know it is something simple, but i do not understand why this is not working. Am I missing something?
Thanks in advance.
@chili555 this is the file hook-network-manager:
#!/bin/sh
# this file is part of cloud-init. See LICENSE file for license information #
# This script hooks into NetworkManager(8) via its scripts
# arguments are 'interface-name' and 'action'
#
is_azure() {
local dmi_path="/sys/class/dmi/id/board_vendor" vendor=""
if [ -e "$dmi_path" ] && read vendor < "$dmi_path"; then
[ "$vendor" = "Microsoft Corporation" ] && return 0
fi
return 1
}
is_enabled() {
# only execute hooks if cloud-init is enabled and on azure
[ -e /run/cloud-init/enabled ] || return 1
is_azure
}
if is_enabled; then
case "$1:$2" in
*:up) exec cloud-init dhclient-hook up "$1";;
*:down) exec cloud-init dhclient-hook down "$1";;
esac
fi