On SUSE mixed static and dhcp setups are no properly configured

Bug #1858808 reported by Robert Schweikert
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Expired
Undecided
Robert Schweikert

Bug Description

It should be possible to have a static IPv4 address and a DHCP IPv6 address and vice versa. This does not work on SUSE distributions as the "BOOTPROTO" setting in the generated ifcfg-* file is not correct.

The BOOTPROTO setting should be

dhcp - if both IPv6 and IPv4 configurations are expected to be supplied by a DHCP server
dhcp4 - if IPv4 configuration is expected to be supplied by a DHCP server, IPv6 configuration can be static
dhcp6 - IPv6 configuration is expected to be supplied by a DHCP server, IPv4 configuration can be static
static - if both IPv6 and IPv4 configurations are defined, or if only one protocol is used and the IP is static

Changed in cloud-init:
assignee: nobody → Robert Schweikert (rjschwei)
Revision history for this message
Ryan Harper (raharper) wrote :

openSuSE docs[1] suggest a bit more detail on BOOTPROTO values:

# With BOOTPROTO you can choose in which mode the interface will be set up:
# - static: Set up static address(es)
# - dhcp: Start a dhcp client (IPV4 and IPv6) on that interface.
# - dhcp4: Start a dhcp client (IPv4 only) on that interface.
# - dhcp6: Start a dhcp client (IPv6 only) on that interface.
# - autoip: Automatic search for a free address and assign it statically.
# - dhcp+autoip: Try dhcp4 and use autoip if dhcp fails.
# - 6to4: Set up ipv6 over ipv4 tunnel (see man ifcfg-tunnel)
# - none: Do not set up the link or ip, a (bonding) master will do it.
# If you use dhcp or autoip you may additionally specify static address(es).
#
BOOTPROTO=

Note, 'static' is not valid per the docs.

On RedHat etc.

BOOTPROTO=protocol
where protocol is one of the following:
none — No boot-time protocol should be used.
bootp — The BOOTP protocol should be used.
dhcp — The DHCP protocol should be used.

Revision history for this message
Robert Schweikert (rjschwei) wrote :

From SLES man page:

BOOTPROTO {static*|dhcp|dhcp4|dhcp6|autoip|dhcp+autoip|auto6|6to4|none}
              Setup protocol. If this variable is empty or missing, it
              defaults to static.
              static
                     A fixed addresses specified in IPADDR and related vari-
                     ables and static routing as defined in routes and
                     ifroute-<interface name> files is configured. This option
                     does not prevent from getting dynamic IPv6 addresses and
                     routes from Router Advertisements, though.
              dhcp4 dhcp6 dhcp
                     A DHCPv4, DHCPv6 or both clients are started to configure
                     the interface. The setup is considered successful, when
                     at least one dhcp client configures the interface. Addi-
                     tionally to the dhcp client configuration, fixed
                     addresses and routes may also be specified.
                     Note:
                     Static routes take precedence over routes provides by
                     dhcp or other leases, that is, a DHCPv4 route with same
                     metrics as a static one will be skipped. DHCPv6 does not
                     support routing options, an IPv6 Router Advertisement
                     (RA) is applying them.

Revision history for this message
Robert Schweikert (rjschwei) wrote :

and the rest from the man page:

             auto4 autoip dhcp+autoip
                     may be used for a IPv4 zeroconf setup or as fall back to
                     autoip if dhcp4 fails.
              auto6
                     can be used to request to wait for IPv6 autoconfig (in
                     kernel), usable also in combination with dhcp or static
                     modes, e.g. dhcp+auto6 to request dhcp4, dhcp6 and also
                     wait for auto6. Default is to not wait, but apply the
                     RDNSS and DNSSL resolver (lowerered prio in netconfig)
                     settings when they arrive.
              6to4
                     to set up IPv6 tunnel interfaces running in the "6to4"
                     mode.
                     See also ifcfg-tunnel(5) manual page.
              none
                     For bonding slaves, to skip the link-layer (MTU, MAC
                     address) setup and IP configuration of the interface in
                     ifup. The bonding script handles the link layer settings
                     itself at enslave time. See also ifcfg-bonding(5) man
                     page. Note: Do not use to just skip the IP setup -- use
                     BOOTPROTO="static" without any addresses in the IPADDR
                     variables (or routes) instead.

Revision history for this message
Ryan Harper (raharper) wrote :

Yes, static is valid. It "works" on RedHat since sysconfig there only expects 'dhcp' or 'bootp' which sets DYNCONFIG=true; so a BOOTPROTO value of 'static' is equivalent.

I suspect having the sysconfig Renderer take a config value of 'flavor' would allow control flow around settings BOOTPROTO and other settings correctly.

Revision history for this message
Robert Schweikert (rjschwei) wrote :
Dan Watkins (oddbloke)
Changed in cloud-init:
status: New → In Progress
Revision history for this message
James Falcon (falcojr) wrote :
Changed in cloud-init:
status: In Progress → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.