cloud-init icon indicating copy to clipboard operation
cloud-init copied to clipboard

[docs]: Questions About Route Configuration

Open xiaoge1001 opened this issue 1 year ago • 5 comments

Documentation request

I use the following routing configuration: https://cloudinit.readthedocs.io/en/latest/reference/network-config-format-v1.html#route-example

dev name and mac_address match the one in my environment, not the one in the example. However, the route in the example cannot be queried. image

I get 192.168.23.0/24, not 192.168.24.0/24. Why is that?

xiaoge1001 avatar Dec 24 '24 03:12 xiaoge1001

That example would only work if the route was added as an "onlink" route (a "normal" route requires the gateway to have an IP address in the machine's subnet).

Which distro, which cloud-init version, and which cloud-init network renderer are you using?

Only the netplan and networkd renderers appear to support "onlink".

dermotbradley avatar Dec 24 '24 18:12 dermotbradley

That example would only work if the route was added as an "onlink" route (a "normal" route requires the gateway to have an IP address in the machine's subnet).

Which distro, which cloud-init version, and which cloud-init network renderer are you using?

Only the netplan and networkd renderers appear to support "onlink".

I get it,Thanks

distro: openEuler cloud-init version:23.4.1 cloud-init network renderer:sysconfig

xiaoge1001 avatar Dec 25 '24 01:12 xiaoge1001

https://cloudinit.readthedocs.io/en/latest/reference/network-config-format-v1.html#nameserver-example

network:
  version: 1
  config:
    - type: physical
      name: interface0
      mac_address: '00:11:22:33:44:55'
      subnets:
         - type: static
           address: 192.168.23.14/27
           gateway: 192.168.23.1
    - type: nameserver
      interface: interface0  # Ties nameserver to interface0 only
      address:
        - 192.168.23.2
        - 8.8.8.8
      search:
        - exemplary

Is this supported by some network renderers? I test it and the cloud-init command is successfully executed, but the nameserver information cannot be found.

xiaoge1001 avatar Dec 27 '24 08:12 xiaoge1001

The example does not specify which network renderers are supported. The cloud-init execution logs do not contain information such as unsupported or error information.

I'm sorry, but I'd like to ask. Where can I find this explanation? Thanks.

xiaoge1001 avatar Dec 27 '24 08:12 xiaoge1001

https://cloudinit.readthedocs.io/en/latest/reference/network-config-format-v1.html#nameserver-example

network:
  version: 1
  config:
    - type: physical
      name: interface0
      mac_address: '00:11:22:33:44:55'
      subnets:
         - type: static
           address: 192.168.23.14/27
           gateway: 192.168.23.1
    - type: nameserver
      interface: interface0  # Ties nameserver to interface0 only
      address:
        - 192.168.23.2
        - 8.8.8.8
      search:
        - exemplary

Is this supported by some network renderers? I test it and the cloud-init command is successfully executed, but the nameserver information cannot be found.

https://github.com/canonical/cloud-init/blob/main/cloudinit/distros/networking.py#L268 https://github.com/canonical/cloud-init/blob/main/cloudinit/net/init.py#L588 I looked at the code and found that the "type" configuration only seems to support "physical."

xiaoge1001 avatar Jan 02 '25 11:01 xiaoge1001