Score:1

Netplan config with IPv4 and IPV6

mg flag

I am trying to update a server with IPv4 and IPv6 addresses to 22.04.1. I was trying to get netplan updated and it wanted routes, but I was having some trouble getting the config correct and lost network on the server. The netplan examples don't have much in the way of IPv6 examples and I've not found anything helpful while searching.

    network:
  version: 2
#  renderer: networkd
  ethernets:
    eth0:
      addresses:
        - xxx.xxx.xxx.xxx/18
        - aaaa:aaaa:aaa:aa::aaa:aaaa/64
      gateway4: 111.111.1.1
      gateway6: bbbb:bbbb:bbb:bb::b
      nameservers:
        addresses: 
#quad 9 DNS servers
          - 9.9.9.9
          - 149.112.112.112
          - 2620:fe::fe 
          - 2620:fe::9
Score:3
uy flag

A netplan file with ipv6 looks like

network:
  version: 2
  ethernets:
    enp2s0:
      critical: true
      dhcp-identifier: mac
      dhcp4: false
      addresses:
        - 192.168.1.20/26
        - 2001:0db8:100:2::20/64
      routes:
        - to: default    # defaut ipv4
          via: 192.168.1.1
        - to: "::/0"      # defaut ipv6
          via: "2001:0db8:100:2::1"
          on-link: true

  nameservers:
    addresses:
    - 192.168.1.1
    - 2001:0db8:100:2::1
      

please note gateway4 and gateway6 are deprecated. Use regulary routes as shown.

Thystra avatar
mg flag
I had to edit the nameserver section, and then I got this warning: ** (generate:4248): WARNING **: 15:43:42.578: Problem encountered while validating default route consistency.Please set up multiple routing tables and use `routing-policy` instead. Error: Conflicting default route declarations for IPv4 (table: main, metric: default), first declared in enp2s0 but also in eth0
dummyuser avatar
uy flag
You may need to adopt some settings like interface names to your needs. I posted a sample, not a full solution for you.
Thystra avatar
mg flag
I think I found part of the issue - I had setup a strongswan VPN server on the box as well, and it has another IP address on eth0, which is probably causing the conflict
dummyuser avatar
uy flag
perfect, if you want to get support, it makes sense to provide as much info as possible.
Thystra avatar
mg flag
I didn't catch it until I had logged back in on another terminal and it displayed the IP address.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.