mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-13 12:16:29 +00:00
Use technology neutral "auto" instead of "dhcp" for autoconfiguration (#2241)
* Use technology neutral "auto" instead of "dhcp" for autoconfiguration IPv6 is often run with SLAAC which does not use a DHCP server but still does automatic address configuration. Follow wording of NetworkManager and use "auto" instead. * Use "auto" also in interface_update.tmpl * Update interface_update.tmpl * remove newline Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch> Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
This commit is contained in:
parent
5f2d183b1d
commit
d558ad2d76
@ -234,7 +234,7 @@ class APINetwork(CoreSysAttributes):
|
||||
ipv4_config = None
|
||||
if ATTR_IPV4 in body:
|
||||
ipv4_config = IpConfig(
|
||||
body[ATTR_IPV4].get(ATTR_METHOD, InterfaceMethod.DHCP),
|
||||
body[ATTR_IPV4].get(ATTR_METHOD, InterfaceMethod.AUTO),
|
||||
body[ATTR_IPV4].get(ATTR_ADDRESS, []),
|
||||
body[ATTR_IPV4].get(ATTR_GATEWAY, None),
|
||||
body[ATTR_IPV4].get(ATTR_NAMESERVERS, []),
|
||||
@ -243,7 +243,7 @@ class APINetwork(CoreSysAttributes):
|
||||
ipv6_config = None
|
||||
if ATTR_IPV6 in body:
|
||||
ipv6_config = IpConfig(
|
||||
body[ATTR_IPV6].get(ATTR_METHOD, InterfaceMethod.DHCP),
|
||||
body[ATTR_IPV6].get(ATTR_METHOD, InterfaceMethod.AUTO),
|
||||
body[ATTR_IPV6].get(ATTR_ADDRESS, []),
|
||||
body[ATTR_IPV6].get(ATTR_GATEWAY, None),
|
||||
body[ATTR_IPV6].get(ATTR_NAMESERVERS, []),
|
||||
|
@ -13,7 +13,7 @@
|
||||
,
|
||||
'ipv4':
|
||||
{
|
||||
{% if interface.ipv4.method == "dhcp" %}
|
||||
{% if interface.ipv4.method == "auto" %}
|
||||
'method': <'auto'>
|
||||
{% elif interface.ipv4.method == "disable" %}
|
||||
'method': <'disabled'>
|
||||
@ -36,7 +36,7 @@
|
||||
,
|
||||
'ipv6':
|
||||
{
|
||||
{% if interface.ipv6.method == "dhcp" %}
|
||||
{% if interface.ipv6.method == "auto" %}
|
||||
'method': <'auto'>
|
||||
{% elif interface.ipv6.method == "disable" %}
|
||||
'method': <'disabled'>
|
||||
|
@ -7,7 +7,7 @@ class InterfaceMethod(str, Enum):
|
||||
|
||||
DISABLED = "disabled"
|
||||
STATIC = "static"
|
||||
DHCP = "dhcp"
|
||||
AUTO = "auto"
|
||||
|
||||
|
||||
class InterfaceType(str, Enum):
|
||||
|
@ -264,7 +264,7 @@ class Interface:
|
||||
def _map_nm_method(method: str) -> InterfaceMethod:
|
||||
"""Map IP interface method."""
|
||||
mapping = {
|
||||
NMInterfaceMethod.AUTO: InterfaceMethod.DHCP,
|
||||
NMInterfaceMethod.AUTO: InterfaceMethod.AUTO,
|
||||
NMInterfaceMethod.DISABLED: InterfaceMethod.DISABLED,
|
||||
NMInterfaceMethod.MANUAL: InterfaceMethod.STATIC,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user