Compare commits

...

5 Commits

@ -37,6 +37,7 @@ List of tested platforms only:
| Devuan | 2 | | Devuan | 2 |
| Fedora | 34, 35 | | Fedora | 34, 35 |
| FreeBSD | 12, 13 | | FreeBSD | 12, 13 |
| MSVSphere | 8, 9 |
| openSUSE | 15 | | openSUSE | 15 |
| Oracle Linux | 7, 8 | | Oracle Linux | 7, 8 |
| Red Hat Enterprise Linux | 7, 8, 9 | | Red Hat Enterprise Linux | 7, 8, 9 |
@ -77,20 +78,20 @@ Following IPv6 configuration methods are supported via NIC attribute `IP6_METHOD
Selectable configuration types and IP configuration methods are **supported only on the following platforms**: Selectable configuration types and IP configuration methods are **supported only on the following platforms**:
| Platform | Network Type (`NETCFG_TYPE`) | | Platform | Network Type (`NETCFG_TYPE`) |
|---------------------------------------------------------------|-------------------------------------------| |-----------------------------------------------------------------|-------------------------------------------|
| Alpine Linux 3.14+ | `interfaces` | | Alpine Linux 3.14+ | `interfaces` |
| ALT Linux p10, Sisyphus | `networkd`, `nm` | | ALT Linux p10, Sisyphus | `networkd`, `nm` |
| Amazon Linux 2 | `scripts` | | Amazon Linux 2 | `scripts` |
| Debian 10+ | `interfaces`, `netplan`, `nm`, `networkd` | | Debian 10+ | `interfaces`, `netplan`, `nm`, `networkd` |
| Devuan 2 | `interfaces` | | Devuan 2 | `interfaces` |
| Fedora 34+ | `scripts`, `nm`, `networkd` | | Fedora 34+ | `scripts`, `nm`, `networkd` |
| FreeBSD 12+ | `bsd` | | FreeBSD 12+ | `bsd` |
| openSUSE 15 | `scripts` | | openSUSE 15 | `scripts` |
| RHEL-like 7 (CentOS, Oracle Linux) | `scripts` | | RHEL-like 7 (CentOS, Oracle Linux) | `scripts` |
| RHEL-like 8 (CentOS, Oracle/Rocky/AlmaLinux) | `scripts`, `nm`, `networkd` | | RHEL-like 8 (CentOS, Oracle/Rocky/AlmaLinux/MSVSphere) | `scripts`, `nm`, `networkd` |
| RHEL-like 9 (CentOS Stream 9, Oracle/Rocky/AlmaLinux) | `nm`, `networkd` | | RHEL-like 9 (CentOS Stream 9, Oracle/Rocky/AlmaLinux/MSVSphere) | `nm`, `networkd` |
| Ubuntu 18.04, 20.04, 21.10, 22.04 | `interfaces`, `netplan`, `nm`, `networkd` | | Ubuntu 18.04, 20.04, 21.10, 22.04 | `interfaces`, `netplan`, `nm`, `networkd` |
(other than listed platforms are not supported for using `NETCFG_TYPE` nor `METHOD`/`IP6_METHOD`!): (other than listed platforms are not supported for using `NETCFG_TYPE` nor `METHOD`/`IP6_METHOD`!):

@ -41,7 +41,7 @@ fi
### ###
VERSION=${VERSION:-6.4.1} VERSION=${VERSION:-6.6.0}
RELEASE=${RELEASE:-1} RELEASE=${RELEASE:-1}
MAINTAINER=${MAINTAINER:-OpenNebula Systems <contact@opennebula.io>} MAINTAINER=${MAINTAINER:-OpenNebula Systems <contact@opennebula.io>}
LICENSE=${LICENSE:-Apache 2.0} LICENSE=${LICENSE:-Apache 2.0}

@ -39,7 +39,7 @@ if [ -z "${NETCFG_TYPE}" ] ; then
debian|devuan|ubuntu) debian|devuan|ubuntu)
NETCFG_TYPE='interfaces netplan nm networkd' NETCFG_TYPE='interfaces netplan nm networkd'
;; ;;
fedora|centos|rhel|almalinux|ol|rocky) fedora|centos|rhel|almalinux|ol|rocky|msvsphere)
NETCFG_TYPE='scripts nm networkd' NETCFG_TYPE='scripts nm networkd'
;; ;;
opensuse*|sles|sled) opensuse*|sles|sled)

@ -41,7 +41,7 @@ configure_network()
# booting of current systems, so we execute netplan apply on the background # booting of current systems, so we execute netplan apply on the background
case "${NETCFG_NETPLAN_RENDERER}" in case "${NETCFG_NETPLAN_RENDERER}" in
''|networkd) ''|networkd)
nohup netplan apply &>/dev/null & flock /var/run/one-context/netplan.lock nohup netplan apply &>/dev/null &
;; ;;
esac esac
} }
@ -56,14 +56,14 @@ start_network()
netplan generate netplan generate
nm_symlink_run_connections nm_symlink_run_connections
service networking start service networking start
netplan apply flock /var/run/one-context/netplan.lock netplan apply
} }
reload_network() reload_network()
{ {
netplan generate netplan generate
nm_symlink_run_connections nm_symlink_run_connections
netplan apply flock /var/run/one-context/netplan.lock netplan apply
} }
# #

@ -269,6 +269,13 @@ gen_network_configuration()
{ {
_context_interfaces=$(get_context_interfaces) _context_interfaces=$(get_context_interfaces)
_networkd_version=$(networkctl --version | head -1 | awk '{print $2}')
if [ -n "$_networkd_version" ]; then
# put some dummy low version if not detected
_networkd_version="100"
fi
for _iface in $_context_interfaces; do for _iface in $_context_interfaces; do
setup_iface_vars "$_iface" setup_iface_vars "$_iface"
@ -286,12 +293,16 @@ gen_network_configuration()
# #
# This occurs at least with systemd/networkd version 248, which is on # This occurs at least with systemd/networkd version 248, which is on
# Cent OS 8 for example. # Cent OS 8 for example.
if is_networkd_iface_managed "${dev}" ; then
# networkctl up/down is not on ubuntu <21.04
networkctl down "$dev" 2>/dev/null || true
# this is still necessary to really unconfigure the interface
ip addr flush "$dev" if [ $_networkd_version -le 250 ]; then
if is_networkd_iface_managed "${dev}" ; then
# networkctl up/down is not on ubuntu <21.04
networkctl down "$dev" 2>/dev/null || true
# this is still necessary to really unconfigure the interface
ip addr flush "$dev"
fi
fi fi
{ {

@ -513,7 +513,7 @@ syscheck()
debian|ubuntu|devuan) debian|ubuntu|devuan)
return 0 return 0
;; ;;
fedora|centos|rhel|almalinux|ol|rocky|amzn) fedora|centos|rhel|almalinux|ol|rocky|amzn|msvsphere)
return 0 return 0
;; ;;
opensuse*|sles|sled) opensuse*|sles|sled)
@ -553,7 +553,7 @@ enter_single_mode()
return 0 return 0
fi fi
;; ;;
debian|ubuntu|devuan|fedora|centos|rhel|almalinux|ol|rocky|altlinux|opensuse*) debian|ubuntu|devuan|fedora|centos|rhel|almalinux|ol|rocky|msvsphere|altlinux|opensuse*)
_runlevel=$(runlevel | cut -d" " -f2) _runlevel=$(runlevel | cut -d" " -f2)
case "$_runlevel" in case "$_runlevel" in
1|S) 1|S)
@ -589,7 +589,7 @@ enter_single_mode()
msg "Entering single user mode..." msg "Entering single user mode..."
rc single rc single
;; ;;
debian|ubuntu|devuan|fedora|centos|rhel|almalinux|ol|rocky|altlinux|opensuse*) debian|ubuntu|devuan|fedora|centos|rhel|almalinux|ol|rocky|msvsphere|altlinux|opensuse*)
ask_to_enter_single_user_mode ask_to_enter_single_user_mode
msg "Entering single user mode..." msg "Entering single user mode..."
telinit 1 telinit 1

Loading…
Cancel
Save