Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs]: Questions About Route Configuration #5940

Open
xiaoge1001 opened this issue Dec 24, 2024 · 5 comments
Open

[docs]: Questions About Route Configuration #5940

xiaoge1001 opened this issue Dec 24, 2024 · 5 comments
Labels
documentation This Pull Request changes documentation new An issue that still needs triage

Comments

@xiaoge1001
Copy link
Contributor

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 xiaoge1001 added documentation This Pull Request changes documentation new An issue that still needs triage labels Dec 24, 2024
@dermotbradley
Copy link
Contributor

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".

@xiaoge1001
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

xiaoge1001 commented Dec 27, 2024

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
Copy link
Contributor Author

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."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This Pull Request changes documentation new An issue that still needs triage
Projects
None yet
Development

No branches or pull requests

2 participants