Skip to content

Update documentation for network-config-format-v2#701

Merged
OddBloke merged 5 commits into
canonical:masterfrom
ggiesen:patch-1
Dec 9, 2020
Merged

Update documentation for network-config-format-v2#701
OddBloke merged 5 commits into
canonical:masterfrom
ggiesen:patch-1

Conversation

@ggiesen
Copy link
Copy Markdown
Contributor

@ggiesen ggiesen commented Nov 30, 2020

Routes are a per-interface property, not a global network property

Proposed Commit Message

Update documentation for network-config-format-v2 to reflect the fact that
routes are a per-interface property, not a global network property

Additional Context

Test setup consists of the following:
CentOS 8.2.2004
cloud-init v.19.4
cloud-init-vmware-guestinfo v1.4.1

Test Steps

The following config (per the example in the documentation) does not install a static route:

instance-id: host
local-hostname: host
network:
  version: 2
  ethernets:
    ens192:
      dhcp4: false
      addresses:
      - 192.0.2.10/28
      gateway4: 192.0.2.1
      nameservers:
        addresses:
        - 192.0.2.5
        search:
        - example.com
    ens224:
      dhcp4: false
      addresses:
      - 192.0.2.26/28
  routes:
  - to: 192.0.2.128/25
    via: 192.0.2.17
	metric: 1

The following metadata config does install the static route:

instance-id: host
local-hostname: host
network:
  version: 2
  ethernets:
    ens192:
      dhcp4: false
      addresses:
      - 192.0.2.10/28
      gateway4: 192.0.2.1
      nameservers:
        addresses:
        - 192.0.2.5
        search:
        - example.com
    ens224:
      dhcp4: false
      addresses:
      - 192.0.2.26/28
      routes:
      - to: 192.0.2.128/25
        via: 192.0.2.17
		metric: 1

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly
  • I have updated or added any documentation accordingly

Routes are a per-interface property, not a global network property
Copy link
Copy Markdown
Collaborator

@raharper raharper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching that. Indeed routes are per device, not a top-level key in v2.

Since you here, it may be useful to update the docs on where to go for netplan info:

https://netplan.io

This has examples and a FAQ, we could link to that instead of the launchpad.net/netplan URL at the bottom of this file.

Thoughts?

@ggiesen
Copy link
Copy Markdown
Contributor Author

ggiesen commented Dec 2, 2020

I agree and I've updated the netplan URL to https://netplan.io

Copy link
Copy Markdown
Collaborator

@OddBloke OddBloke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@OddBloke OddBloke merged commit 7ec314a into canonical:master Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants