Closed vholer closed 3 years ago
You seem to imply that DHCP works when using an Ethernet Address Reservation with this contextualization package, how?
I am trying to setup a virtual router where the "external" interface is setup with DHCP and requieres an specific Ethernet Address Reservation, and the "internal" interface is an IP address reservation.
Is this the case you are referring in this issue?
I don't see how to use DHCP at all with the contextualization package. I am considering doing something form a contextualization script.
@rvalle,
defining a network configuration with all but IP and IP6 fields left empty will not override the interface configuration files
Yes, but that won't autoconfigue the DHCP interface, right?
I mean, the default /etc/interfaces files in debian will only configure the loopback
Do you mean that then I should also use contextualization to setup the interface files?
This issue is planned to be covered during the refactoring of network scripts to provide more flexibility. New interface context variables will be introduced ETHx_METHOD
and ETHx_IP6_METHOD
to describe the way how interface is configured in guest. Following values will be understood:
(empty)
or static
for current static network configuration based on context information provided by OpenNebula,dhcp
for DHCPv4auto
for SLAACdhcp
for SLAAC with DHCPv6disable
to disable interface, e.g. to support IPv4-only interface we need to disable IPv6 on particular interfaceETH1_METHOD="static"
ETH1_IP6_METHOD="disable"
skip
to skip interface configurationOnly a relevant snippets follows about how to configure various guest OSes ...
ETHx_IP6_METHOD="auto"
Use
IPV6INIT=yes
IPV6_AUTOCONF=yes
ETHx_IP6_METHOD="dhcp"
Use
IPV6INIT=yes
IPV6_AUTOCONF=yes
DHCPV6C=yes
ETHx_IP6_METHOD="disable"
Only when IPv4 is configured (otherwise skip):
echo net.ipv6.conf.eth1.disable_ipv6=1 >>/etc/sysctl.conf
sysctl net.ipv6.conf.eth1.disable_ipv6=1
ETHx_IP6_METHOD="auto"
Use
iface eth1 inet6 auto
ETHx_IP6_METHOD="dhcp"
Use
iface eth1 inet6 dhcp
ETHx_IP6_METHOD="disable"
Only when IPv4 is configured (otherwise skip):
iface eth1 inet dhcp
pre-up echo 1 > /proc/sys/net/ipv6/conf/eth1/disable_ipv6
ETHx_IP6_METHOD="auto"
Use
eth1:
accept-ra: true
dhcp6: false
:warning: Combination of netplan+networkd doesn't completely disable DHCPv6, as it can still be triggered if relevant flags are in RA data.
ETHx_IP6_METHOD="dhcp"
Use
ethernets:
eth1:
accept-ra: true
dhcp6: true
ETHx_IP6_METHOD="disable"
Only when IPv4 is configured (otherwise skip):
ethernets:
eth1:
accept-ra: false
link-local: [ ]
ETHx_IP6_METHOD="auto"
nmcli c mod $DEV ipv6.method ignore
ETHx_IP6_METHOD="dhcp"
nmcli c mod $DEV ipv6.method dhcp
:warning: Netplan puts into auto
. Review!
ETHx_IP6_METHOD="disable"
nmcli c mod $DEV ipv6.method disabled
ETHx_METHOD="dhcp"
If ETHx_IP6_METHOD="dhcp"
, use
[Network]
DHCP=true
otherwise
[Network]
DHCP=ipv4
ETHx_IP6_METHOD="auto"
If ETHx_METHOD="dhcp"
[Network]
DHCP=ipv4
IPv6AcceptRA=yes
[IPv6AcceptRA]
DHCPv6Client=no
otherwise
[Network]
DHCP=false
IPv6AcceptRA=yes
[IPv6AcceptRA]
DHCPv6Client=no
ETHx_IP6_METHOD="dhcp"
If ETHx_METHOD="dhcp"
[Network]
DHCP=true
IPv6AcceptRA=yes
else
[Network]
DHCP=ipv6
IPv6AcceptRA=yes
ETHx_IP6_METHOD="disable"
Only when IPv4 is configured (otherwise skip):
[Network]
LinkLocalAddressing=no
IPv6AcceptRA=no
Implemented as part of #227.
Leaving opened as we need update in oned.conf to inherit the METHOD context variables frim NIC/VNET.
Selectable guest NIC configuration methods implemented in master.
Short description with supported combinations and few OS quirks: https://github.com/OpenNebula/addon-context-linux/blob/d5e3d3ac93607192cdd85b48cb56e9cf186cbd7b/README.md#guest-network-configuration-since-6180
There are situations where both statically and dynamically (e.g. when using just ethernet ranges) configured network interfaces are used. Currently, the scripts can work fine with one or the other, but not well with both at the same time.