Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Configuring IPv6 with Netplan on GreencloudVPS
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Configuring IPv6 with Netplan on GreencloudVPS

fartfart Member

I got a VPS from Greencloud from their recent sale, and I'm trying to set up IPv6 on it. The VPS is running Ubuntu 22.04, and therefore uses netplan.

Unfortunately, their support wasn't very helpful and pointed me to general netplan documentation, followed by a request for my root password(!), so here I am:

I have the following configuration:

network:
  ethernets:
    ens3:
      dhcp4: true
      accept-ra: false
      gateway6: "2607:9000:8000:22::1"
      addresses:
        - "2607:9000:8000:22::XX:XXXX/112"
  version: 2

However, this does not lead to IPv6 connectivity, as can be confirmed by running ping:

$ ping -6 google.com 
ping: connect: Network is unreachable

How would I go about fixing this?
Thanks!

Comments

  • add_iTadd_iT Member
    edited January 2023

    Are using reconfigure networking from solusvm not work?

  • Tagging @yoursunny as resident IPv6 guru
    also so he can get shredded.

  • yoursunnyyoursunny Member, IPv6 Advocate

    This is what I use in Singapore location:

    network:
      version: 2
      ethernets:
        uplink:
          match:
            macaddress: 00:16:3c:23:29:47
          set-name: uplink
          dhcp4: true
          dhcp6: false
          link-local: []
          addresses:
            - 2001:db8:44e6:789b::565:2/112
            - 2001:db8:44e6:789b::565:80/112:
                lifetime: 0
          routes:
            - to: ::/0
              via: 2001:db8:44e6:789b::1
              on-link: true
          nameservers:
            addresses:
            - 2001:4860:4860::8888
            - 2606:4700:4700::1111
    

    match.macaddress field is the MAC address of the uplink interface.
    I use MAC address matching rather than name matching, to avoid loss of connectivity due to unexpected name changes.
    See Disabling VNC in Virtualizor ⇒ Lost Connectivity?.

    There are two IPv6 addresses listed.
    The first one can be selected for outgoing connections.
    The second one is only for incoming connections.
    See How to Select Default IPv6 Source Address for Outbound Traffic with Netplan.

  • @add_iT said: Are using reconfigure networking from solusvm not work?

    That typically just changes the /etc/network/interfaces file, which is of no use in a netplan setup.

    @yoursunny said:
    This is what I use in Singapore location:

    Thanks for the pointers, is there a reason for adding a route block? Does it simply act as a replacement for the gateway6 attribute which netplan reports as being deprecated?

  • brueggusbrueggus Member, IPv6 Advocate
    edited January 2023

    @yoursunny said:
    This is what I use in Singapore location:

    Thanks for the pointers, is there a reason for adding a route block? Does it simply act as a replacement for the gateway6 attribute which netplan reports as being deprecated?

    I don't use netplan but I suspect the route-block is required since the gateway IP is outside your /112 subnet.

    Thanked by 1yoursunny
  • yoursunnyyoursunny Member, IPv6 Advocate

    @brueggus said:
    the route-block is required since the gateway IP is outside your /112 subnet.

    Correct.
    It needs to have on-link: true.

    Some ill-advised tutorials may tell you to artificially enlarge your subnet so that the gateway is in your subnet.
    The consequence for that is breaking communication to destinations within your enlarged subnet.

    Thanked by 2brueggus fart
  • In SolusVM network tab you have ipv6 info.. Using that info follow this

    ip -6 addr add Ipv6/sub dev ens3
    ip -6 route add GW dev ens3
    ip -6 route add default via GW dev ens3

    after testing if all works just add these in rc.local so they load on restart.

    just for sample this is mine

    ip -6 addr add 2001:41d1:f:3a5::b00b/64 dev eth0
    ip -6 route add 2001:41d0:e:3ff:ff:ff:ff:ff dev eth0
    ip -6 route add default via 2001:41d0:e:3ff:ff:ff:ff:ff dev eth0

Sign In or Register to comment.