A netplan file with ipv6

Hi, i have installed Ubuntu 24.04 LTS manually and set the DHCP server manually for ipv4 and ipv6. However the netplan not show ipv4 gateway and the NAT forwarding not work when i have ipv6 setup. can you help what is the right way to revise this to have ipv4 gateway working?


this file is automatically generated based on similar setting. screenshot in not from same vm x.102 but x.104

here only ipv4 setting works perfectly.

i am looking if we have something to setup like

     routes:
        # IPv4 default route
        - to: default
          via: 192.168.1.1
        # IPv6 default route
        - to: default
          via: ipv6::1

not sure if this have to set differently. i want to change the default for ipv6 so it work along with ipv4. i am expecting like this

- to: ipv6::/64

or have older settings gateway4,gateway6 working?

Got it working with this. i don’t know why routes for each ipv4 and ipv6 is not being assigned during manual first setup. If i am setting ipv4 first and second ipv6, the gateway assign ipv6. if i setup ipv6 first, ipv4 gateway being assigned during fresh install but not both for each.

strange no one seems to help, how to report this?

network:
  version: 2
  ethernets:
    ens18:
      addresses:
        - 192.168.1.102/24
        - fd3b:14ca:3674:5011::102/64
      nameservers:
        addresses:
          - 1.1.1.1
          - 8.8.8.8
          - 2606:4700:4700::1111
          - 2001:4860:4860::8888
        search: []
      routes:
        - to: 0.0.0.0/0
          via: 192.168.1.1
        - to: ::/0
          via: fd3b:14ca:3674:5011::1

You did ask in the middle of a two-week holiday period for many contributors, so we do ask for patience.

You report problems using the Ubuntu Bug Tracker: Netplan in Launchpad

1 Like

oh, i was not aware with the holidays. My apologies.

my preinstalled ubuntu templates offers changes via /etc/network/interfaces for the same version. is netplan new?

as this netplan configuration being made via ubuntu gui, i don’t think it is netplan issue but ubuntu package that writes the yaml configuration.

I have already reported this in ubuntu plan Bug #2092837 “netplan routes issue with static ipv4 and ipv6” : Bugs : plan package : Ubuntu

I have reported here now Bug #2092860 “netplan routes issue with static ipv4 and ipv6” : Bugs : Netplan

i am still not sure if my yaml file is correct or not. if someone from netplan team can confirm this so i can make this changes to other vms.

Thanks.

Depends how you define “new” … in the light of the age of the universe it definitely is … :slight_smile:
In Ubuntu it was introduced in 2014 and became the default in 16.04, so it has been around as the default for 8 years now …

i am very new to linux and haven’t got the chance to dig deeper while my preconfigured vps was working. i recently switched to dedicated server and then i started working on this.

my vps preconfigured ubuntu 24.04 lts manage network via /etc/network/interfaces while the same ubuntu version iso i use in proxmox uses netplan.

Could you help how different it is?

also if you know if netplan config is a bug or not?

Thanks.

While I’m using netplan regulary, I rarely have to deal with ipv6, so I won’t be of much help here, the netplan documentation is at:

https://netplan.readthedocs.io/en/stable/

… perthaps that has some hints for you …

And from next week on people should slowly show up to work again and I’m sure someone will look at your bug report then …

Thank you.

as mentioned i don’t think the issue is in netplan.

The issue is Ubuntu GUI not writes the network configuration properly in /etc/netplan/50-cloud-init.yaml or .yaml file during the first time setup/os installation.

i will wait for some help from other team members.

Well, I dont know what the GUI in your two last screenshots is, the first ones clearly show “subiquity” though … which is the name of the server installer … you might want to add an additional task to your bug to include subiquity

Last two screenshot is from Proxmox noVNC. That’s what we use to install os on proxmox VM.

first two are simply a cropped version of novnc window or ssh client. There is no specific installation method that would complicate this. it is like a regular installation with iso.

The issue is, like you see in first two screenshot, the network DHCP is set for both ipv4 and ipv6 but the DHCP gateway adds a single one based on which network type was set in last.

hope this clears this.

This might help or might not but could be a interesting read
ipv6 on ubuntu

I use netplan on my 3 Servers but don’t have any set to static on the servers found it easier to set the IP’s static via the router. I also don’t VM, pretty much stick to a simple setup to do 1 task per server. So the link may not assist you but could provide a better look into setup of netplan.

interesting, this has the similar code which i used. https://wiki.crowncloud.net/?configure_ipv6_on_ubuntu#Method+2+-+Configure+both+IPv4+and+IPv6+as+static

network:
  version: 2
  renderer: networkd
  ethernets:
    ens3:
      dhcp4: false
      dhcp6: false
      addresses:
        - 185.228.83.67/24
        - 2a0b:3c40:11:71d8::1/48
      nameservers:
        addresses:
          - 8.8.8.8
          - 8.8.4.4
          - 2001:4860:4860::8888
          - 2001:4860:4860::8844
      routes:
          # IPv4 route
          - to: default
            via: 185.228.83.1
          # IPv6 route
          - to: "::/0"
            via: "a0b:3c40:11::1"
            on-link: true

not sure if i need to add the following line as it is working without adding this.

      dhcp4: false
      dhcp6: false
on-link: true

again, the issue is not netplan, it is ubuntu os installer network screem which not adding the routes it should for both ipv4, ipv6.

however the above doc almost confirm that my code is correct and can be used without any issue. i will wait for some response before deploying it on other vms.

given a fresh install and adding new screenshot of the issue. You notice while i manually set the static ipv4, ipv6 including the gateway, one is not being added in routes.