Skip to content

👩‍💻 Documentation Request: clarify netplan for alternate ips and replacing cloud init #4013

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

Closed
Nicolas-Innocent opened this issue Nov 20, 2024 · 1 comment
Assignees

Comments

@Nicolas-Innocent
Copy link

Nicolas-Innocent commented Nov 20, 2024

Summary

the documentation for ubuntu (netplan) is very lacking

Why is it needed?

(this is written with a 24.04 ubuntu dedibox installed this week)

in the case we use ip-redirects, the default netplan needs to be replaced, this means
1/ disabling cloud-init network by creating the /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg file with content :
network: {config: disabled}

2/ copying and disabling the existing netplan
cp /etc/netplan/50-cloud-init.yaml /etc/netplan/01-myplan.yaml
mv /etc/netplan/50-cloud-init.yaml /etc/netplan/50-cloud-init.yaml-backup

3/ replacing the dhcp sections with the customer section, so

enp5s0:
      critical: true
      nameservers:
        addresses:
        - 51.159.69.156
        - 51.159.69.162
      dhcp-identifier: "mac"
      dhcp4: true

becomes

enp5s0:
            critical: true
            dhcp-identifier: mac
            dhcp4: false
            dhcp6: false
            addresses:
                - 51.111.222.333/24     # Server Main IP (/24)
                - 212.111.222.333/32   # Alternate IPs / IP Redirects (/32)
                - 212.111.222.334/32
                - 212.111.222.335/32
            routes:
                - to: 0.0.0.0/0
                  via: 62.210.0.1
                  metric: 1
                  on-link: true
            nameservers:
                addresses:
                  - 51.159.69.156
                  - 51.159.69.162

4/ disable dhcp herited routing for secondary network cards
so

enp6s0:
      dhcp4: true

becomes

enp6s0:
    dhcp4: true
            dhcp4-overrides:
                use-routes: false
            routes:
                - to: 10.88.0.0/13       #use appropriate ip/gateway from the dhcp
                  via: 10.89.23.129

6/ do netplan try (and then netplan apply) and prey it works, or spend a while rewriting the file via the kvm/ip because any error WILL bork your configuration

Want to write this documentation yourself?

No

Related PR(s)

No response

(Optional) Scaleway Organization ID

No response

Email address

n.innocent@groupe-dasilva.com

@Nicolas-Innocent Nicolas-Innocent changed the title 👩‍💻 Documentation Request: clarify netplan for alternate ipd and replacing cloud init 👩‍💻 Documentation Request: clarify netplan for alternate ips and replacing cloud init Nov 20, 2024
@bene2k1 bene2k1 self-assigned this Nov 20, 2024
@ofranc
Copy link
Collaborator

ofranc commented Mar 10, 2025

@ofranc ofranc closed this as completed Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants