Routing IP addresses in Ubuntu 18.04Multi gateway routing in ubuntulink local (fe80::) addresses without...

What is a good reason for every spaceship to carry a weapon on board?

Why did Luke use his left hand to shoot?

Non-Cancer terminal illness that can affect young (age 10-13) girls?

Has any human ever had the choice to leave Earth permanently?

Cat is tipping over bed-side lamps during the night

Not a Long-Winded Riddle

How to write cases in LaTeX?

Will rerolling initiative each round stop meta-gaming about initiative?

Is there a verb that means to inject with poison?

Plausible reason for gold-digging ant

Boss asked me to sign a resignation paper without a date on it along with my new contract

How does Leonard in "Memento" remember reading and writing?

When Are Enum Values Defined?

Count repetitions of an array

Why is it that Bernie Sanders is always called a "socialist"?

Calculate of total length of edges in Voronoi diagram

Does the ditching switch allow an A320 to float indefinitely?

Can you determine if focus is sharp without diopter adjustment if your sight is imperfect?

Coworker asking me to not bring cakes due to self control issue. What should I do?

Taking headphones when quitting job

Why didn't Tom Riddle take the presence of Fawkes and the Sorting Hat as more of a threat?

Is Screenshot Time-tracking Common?

Why didn't the 2019 Oscars have a host?

Why do all the books in Game of Thrones library have their covers facing the back of the shelf?



Routing IP addresses in Ubuntu 18.04


Multi gateway routing in ubuntulink local (fe80::) addresses without scope make their way into /etc/resolv.conf and cause problemsConnections on Ubuntu 16.04 are not working properly. WIFI is slow and rarely works. Ethernet does not connect at allNetplan error, error on nameserverfwmark routing policy with netplanUbuntu 18.04 Netplan subnet routing (virbr0)Unable to convert partial VLAN from systemd to netplanWireless problems Lenovo Thinkpad E58018.04 - How to disable temporary/privacy IPv6 addresses?Policy Routing with NetPlan on TUN interfaces













2















I have been scratching my head about this all day. Basically, I have several servers on a private network, each with a private IPv6 address assigned and a public IPv4 and IPv6 assigned. I want the servers to only communicate with each other using their private IPv6 addresses.



I have set up the IP addresses using Netplan, but am now trying to set up the routes so that if Server A is trying to communicate with Server B it does so via Server A's private IPv6 not through any other IP assigned to the server.



This is my Netplan configuration file so far (I've XXX'd out parts of the IP addresses for security):



network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
addresses:
- 139.XXX.XXX.132/24
- "2a01:XXXX::XXXX:XXXX:XXXX:0f9c/64"
gateway4: 139.XXX.XXX.1
gateway6: "fe80::1"
routes:
- to: "2a01:XXXX:e000:01e6:1111:1111:1111:1111/64"
via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64"
on-link: true
- to: "2a01:XXXX:e000:01e7:1111:1111:1111:1111/64"
via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64"
on-link: true
- to: "2a01:XXXX:e000:01e8:1111:1111:1111:1111/64"
via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64"
on-link: true
nameservers:
addresses: [8.8.8.8, 8.8.4.4]


The problem that I have is that the routes are not showing when I do the command ip route list or ip -6 route show.



Any help would be greatly appreciated. I'm fairly new to networking and Netplan and I'm struggling with the official documentation.










share|improve this question





























    2















    I have been scratching my head about this all day. Basically, I have several servers on a private network, each with a private IPv6 address assigned and a public IPv4 and IPv6 assigned. I want the servers to only communicate with each other using their private IPv6 addresses.



    I have set up the IP addresses using Netplan, but am now trying to set up the routes so that if Server A is trying to communicate with Server B it does so via Server A's private IPv6 not through any other IP assigned to the server.



    This is my Netplan configuration file so far (I've XXX'd out parts of the IP addresses for security):



    network:
    version: 2
    renderer: networkd
    ethernets:
    eth0:
    dhcp4: no
    dhcp6: no
    addresses:
    - 139.XXX.XXX.132/24
    - "2a01:XXXX::XXXX:XXXX:XXXX:0f9c/64"
    gateway4: 139.XXX.XXX.1
    gateway6: "fe80::1"
    routes:
    - to: "2a01:XXXX:e000:01e6:1111:1111:1111:1111/64"
    via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64"
    on-link: true
    - to: "2a01:XXXX:e000:01e7:1111:1111:1111:1111/64"
    via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64"
    on-link: true
    - to: "2a01:XXXX:e000:01e8:1111:1111:1111:1111/64"
    via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64"
    on-link: true
    nameservers:
    addresses: [8.8.8.8, 8.8.4.4]


    The problem that I have is that the routes are not showing when I do the command ip route list or ip -6 route show.



    Any help would be greatly appreciated. I'm fairly new to networking and Netplan and I'm struggling with the official documentation.










    share|improve this question



























      2












      2








      2








      I have been scratching my head about this all day. Basically, I have several servers on a private network, each with a private IPv6 address assigned and a public IPv4 and IPv6 assigned. I want the servers to only communicate with each other using their private IPv6 addresses.



      I have set up the IP addresses using Netplan, but am now trying to set up the routes so that if Server A is trying to communicate with Server B it does so via Server A's private IPv6 not through any other IP assigned to the server.



      This is my Netplan configuration file so far (I've XXX'd out parts of the IP addresses for security):



      network:
      version: 2
      renderer: networkd
      ethernets:
      eth0:
      dhcp4: no
      dhcp6: no
      addresses:
      - 139.XXX.XXX.132/24
      - "2a01:XXXX::XXXX:XXXX:XXXX:0f9c/64"
      gateway4: 139.XXX.XXX.1
      gateway6: "fe80::1"
      routes:
      - to: "2a01:XXXX:e000:01e6:1111:1111:1111:1111/64"
      via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64"
      on-link: true
      - to: "2a01:XXXX:e000:01e7:1111:1111:1111:1111/64"
      via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64"
      on-link: true
      - to: "2a01:XXXX:e000:01e8:1111:1111:1111:1111/64"
      via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64"
      on-link: true
      nameservers:
      addresses: [8.8.8.8, 8.8.4.4]


      The problem that I have is that the routes are not showing when I do the command ip route list or ip -6 route show.



      Any help would be greatly appreciated. I'm fairly new to networking and Netplan and I'm struggling with the official documentation.










      share|improve this question
















      I have been scratching my head about this all day. Basically, I have several servers on a private network, each with a private IPv6 address assigned and a public IPv4 and IPv6 assigned. I want the servers to only communicate with each other using their private IPv6 addresses.



      I have set up the IP addresses using Netplan, but am now trying to set up the routes so that if Server A is trying to communicate with Server B it does so via Server A's private IPv6 not through any other IP assigned to the server.



      This is my Netplan configuration file so far (I've XXX'd out parts of the IP addresses for security):



      network:
      version: 2
      renderer: networkd
      ethernets:
      eth0:
      dhcp4: no
      dhcp6: no
      addresses:
      - 139.XXX.XXX.132/24
      - "2a01:XXXX::XXXX:XXXX:XXXX:0f9c/64"
      gateway4: 139.XXX.XXX.1
      gateway6: "fe80::1"
      routes:
      - to: "2a01:XXXX:e000:01e6:1111:1111:1111:1111/64"
      via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64"
      on-link: true
      - to: "2a01:XXXX:e000:01e7:1111:1111:1111:1111/64"
      via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64"
      on-link: true
      - to: "2a01:XXXX:e000:01e8:1111:1111:1111:1111/64"
      via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64"
      on-link: true
      nameservers:
      addresses: [8.8.8.8, 8.8.4.4]


      The problem that I have is that the routes are not showing when I do the command ip route list or ip -6 route show.



      Any help would be greatly appreciated. I'm fairly new to networking and Netplan and I'm struggling with the official documentation.







      networking 18.04 ip routing netplan






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 days ago







      matty0501

















      asked 2 days ago









      matty0501matty0501

      113




      113






















          2 Answers
          2






          active

          oldest

          votes


















          0














          Since your routes are IPv6 you should use ip -6 route show the ip route list is showing the IPV4 route only which you do not have in your netplan.



          ip -6 route add ipv6network/prefixlength via ipv6address





          share|improve this answer










          New contributor




          Alpy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





















          • I've just tried that and the routes I've added are still not showing. It's showing some presumably default routes, but not the ones I've added.

            – matty0501
            2 days ago











          • to be sure you did a 'netplan apply' ..

            – Alpy
            2 days ago











          • Yes, I did a netplan apply, and it didn't throw up any errors, but it's just not showing my routes. Thanks for your help so far, I'm really puzzled by all of this.

            – matty0501
            2 days ago











          • try to add the routes manually and see the ip -6 route show

            – Alpy
            2 days ago











          • Please forgive my naivety, how do I add the routes manually?

            – matty0501
            2 days ago



















          0














          via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64" is the wrong syntax. "via" takes a host address of a router, not a network address (when you append a netmask - i.e. /64 - it's a network address not a host address).



          You also show "2a01:XXXX:e000:01e6:1111:1111:1111:1111/64" as your to, which is irregular. Normally one would leave blank (that is, 0) the masked bits and just write "2a01:XXXX:e0000:01e6::/64". I don't know if networkd cares about this, but it might, and it's better to use the canonicalized form anyway.



          I was also able to reproduce this in a container:



          network:
          version: 2
          ethernets:
          eth0:
          dhcp4: true
          dhcp6: no
          addresses:
          - "2a01:1234::1111:1111:1111:0f9c/64"
          routes:
          - to: "2a01:1234:e000:01e6:1111:1111:1111:1111/64"
          via: "2a01:1234:e000:01e5:1111:1111:1111:1111/64"
          on-link: true


          netplan apply succeeds. journalctl --no-pager -lu systemd-networkd shows the following error:



          Feb 25 20:19:20 gnss-sdr systemd-networkd[694]: /run/systemd/network/10-netplan-eth0.network:9: Route is invalid, ignoring assignment: 2a01:1234:e000:01e5:1111:1111:1111:1111/64
          Feb 25 20:19:20 gnss-sdr systemd-networkd[694]: Route section without Gateway field configured in /run/systemd/network/10-netplan-eth0.network. Ignoring


          Clearly you're aware that this route doesn't match the netmask of the host address, which is why you've added the on-link: true to your config; but even with this set, which generates GatewayOnlink=true in the config output to networkd at /run/systemd/network/10-netplan-eth0.network, networkd is refusing to apply this route. I don't know if we should expect this to work with networkd, but either it should work, or the systemd.network(5) manpage should document that it doesn't and netplan should refuse to accept this yaml. I would recommend filing a bug report against netplan.



          To work around this behavior (and give results that are generally speaking more understandable in terms of routing rules), you should either add an additional address to your local machine on the 2a01:XXXX:e000:01e5::/64 network so that the 2a01:XXXX:e000:01e5:1111:1111:1111:1111 gateway is reachable, or else give your 2a01:XXXX:e000:01e5:1111:1111:1111:1111 gateway an additional address on the 2a01:XXXX::/64 network and use that as your via address instead.






          share|improve this answer


























          • So I've tried changing it to routes: - to: "2a01:XXXX:e000:01e6::/64" via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111" and that still isn't working. It's just not showing the route when I do ip -6 route show

            – matty0501
            2 days ago













          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1120668%2frouting-ip-addresses-in-ubuntu-18-04%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Since your routes are IPv6 you should use ip -6 route show the ip route list is showing the IPV4 route only which you do not have in your netplan.



          ip -6 route add ipv6network/prefixlength via ipv6address





          share|improve this answer










          New contributor




          Alpy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





















          • I've just tried that and the routes I've added are still not showing. It's showing some presumably default routes, but not the ones I've added.

            – matty0501
            2 days ago











          • to be sure you did a 'netplan apply' ..

            – Alpy
            2 days ago











          • Yes, I did a netplan apply, and it didn't throw up any errors, but it's just not showing my routes. Thanks for your help so far, I'm really puzzled by all of this.

            – matty0501
            2 days ago











          • try to add the routes manually and see the ip -6 route show

            – Alpy
            2 days ago











          • Please forgive my naivety, how do I add the routes manually?

            – matty0501
            2 days ago
















          0














          Since your routes are IPv6 you should use ip -6 route show the ip route list is showing the IPV4 route only which you do not have in your netplan.



          ip -6 route add ipv6network/prefixlength via ipv6address





          share|improve this answer










          New contributor




          Alpy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





















          • I've just tried that and the routes I've added are still not showing. It's showing some presumably default routes, but not the ones I've added.

            – matty0501
            2 days ago











          • to be sure you did a 'netplan apply' ..

            – Alpy
            2 days ago











          • Yes, I did a netplan apply, and it didn't throw up any errors, but it's just not showing my routes. Thanks for your help so far, I'm really puzzled by all of this.

            – matty0501
            2 days ago











          • try to add the routes manually and see the ip -6 route show

            – Alpy
            2 days ago











          • Please forgive my naivety, how do I add the routes manually?

            – matty0501
            2 days ago














          0












          0








          0







          Since your routes are IPv6 you should use ip -6 route show the ip route list is showing the IPV4 route only which you do not have in your netplan.



          ip -6 route add ipv6network/prefixlength via ipv6address





          share|improve this answer










          New contributor




          Alpy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.










          Since your routes are IPv6 you should use ip -6 route show the ip route list is showing the IPV4 route only which you do not have in your netplan.



          ip -6 route add ipv6network/prefixlength via ipv6address






          share|improve this answer










          New contributor




          Alpy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          share|improve this answer



          share|improve this answer








          edited yesterday





















          New contributor




          Alpy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          answered 2 days ago









          AlpyAlpy

          813




          813




          New contributor




          Alpy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          New contributor





          Alpy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          Alpy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.













          • I've just tried that and the routes I've added are still not showing. It's showing some presumably default routes, but not the ones I've added.

            – matty0501
            2 days ago











          • to be sure you did a 'netplan apply' ..

            – Alpy
            2 days ago











          • Yes, I did a netplan apply, and it didn't throw up any errors, but it's just not showing my routes. Thanks for your help so far, I'm really puzzled by all of this.

            – matty0501
            2 days ago











          • try to add the routes manually and see the ip -6 route show

            – Alpy
            2 days ago











          • Please forgive my naivety, how do I add the routes manually?

            – matty0501
            2 days ago



















          • I've just tried that and the routes I've added are still not showing. It's showing some presumably default routes, but not the ones I've added.

            – matty0501
            2 days ago











          • to be sure you did a 'netplan apply' ..

            – Alpy
            2 days ago











          • Yes, I did a netplan apply, and it didn't throw up any errors, but it's just not showing my routes. Thanks for your help so far, I'm really puzzled by all of this.

            – matty0501
            2 days ago











          • try to add the routes manually and see the ip -6 route show

            – Alpy
            2 days ago











          • Please forgive my naivety, how do I add the routes manually?

            – matty0501
            2 days ago

















          I've just tried that and the routes I've added are still not showing. It's showing some presumably default routes, but not the ones I've added.

          – matty0501
          2 days ago





          I've just tried that and the routes I've added are still not showing. It's showing some presumably default routes, but not the ones I've added.

          – matty0501
          2 days ago













          to be sure you did a 'netplan apply' ..

          – Alpy
          2 days ago





          to be sure you did a 'netplan apply' ..

          – Alpy
          2 days ago













          Yes, I did a netplan apply, and it didn't throw up any errors, but it's just not showing my routes. Thanks for your help so far, I'm really puzzled by all of this.

          – matty0501
          2 days ago





          Yes, I did a netplan apply, and it didn't throw up any errors, but it's just not showing my routes. Thanks for your help so far, I'm really puzzled by all of this.

          – matty0501
          2 days ago













          try to add the routes manually and see the ip -6 route show

          – Alpy
          2 days ago





          try to add the routes manually and see the ip -6 route show

          – Alpy
          2 days ago













          Please forgive my naivety, how do I add the routes manually?

          – matty0501
          2 days ago





          Please forgive my naivety, how do I add the routes manually?

          – matty0501
          2 days ago













          0














          via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64" is the wrong syntax. "via" takes a host address of a router, not a network address (when you append a netmask - i.e. /64 - it's a network address not a host address).



          You also show "2a01:XXXX:e000:01e6:1111:1111:1111:1111/64" as your to, which is irregular. Normally one would leave blank (that is, 0) the masked bits and just write "2a01:XXXX:e0000:01e6::/64". I don't know if networkd cares about this, but it might, and it's better to use the canonicalized form anyway.



          I was also able to reproduce this in a container:



          network:
          version: 2
          ethernets:
          eth0:
          dhcp4: true
          dhcp6: no
          addresses:
          - "2a01:1234::1111:1111:1111:0f9c/64"
          routes:
          - to: "2a01:1234:e000:01e6:1111:1111:1111:1111/64"
          via: "2a01:1234:e000:01e5:1111:1111:1111:1111/64"
          on-link: true


          netplan apply succeeds. journalctl --no-pager -lu systemd-networkd shows the following error:



          Feb 25 20:19:20 gnss-sdr systemd-networkd[694]: /run/systemd/network/10-netplan-eth0.network:9: Route is invalid, ignoring assignment: 2a01:1234:e000:01e5:1111:1111:1111:1111/64
          Feb 25 20:19:20 gnss-sdr systemd-networkd[694]: Route section without Gateway field configured in /run/systemd/network/10-netplan-eth0.network. Ignoring


          Clearly you're aware that this route doesn't match the netmask of the host address, which is why you've added the on-link: true to your config; but even with this set, which generates GatewayOnlink=true in the config output to networkd at /run/systemd/network/10-netplan-eth0.network, networkd is refusing to apply this route. I don't know if we should expect this to work with networkd, but either it should work, or the systemd.network(5) manpage should document that it doesn't and netplan should refuse to accept this yaml. I would recommend filing a bug report against netplan.



          To work around this behavior (and give results that are generally speaking more understandable in terms of routing rules), you should either add an additional address to your local machine on the 2a01:XXXX:e000:01e5::/64 network so that the 2a01:XXXX:e000:01e5:1111:1111:1111:1111 gateway is reachable, or else give your 2a01:XXXX:e000:01e5:1111:1111:1111:1111 gateway an additional address on the 2a01:XXXX::/64 network and use that as your via address instead.






          share|improve this answer


























          • So I've tried changing it to routes: - to: "2a01:XXXX:e000:01e6::/64" via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111" and that still isn't working. It's just not showing the route when I do ip -6 route show

            – matty0501
            2 days ago


















          0














          via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64" is the wrong syntax. "via" takes a host address of a router, not a network address (when you append a netmask - i.e. /64 - it's a network address not a host address).



          You also show "2a01:XXXX:e000:01e6:1111:1111:1111:1111/64" as your to, which is irregular. Normally one would leave blank (that is, 0) the masked bits and just write "2a01:XXXX:e0000:01e6::/64". I don't know if networkd cares about this, but it might, and it's better to use the canonicalized form anyway.



          I was also able to reproduce this in a container:



          network:
          version: 2
          ethernets:
          eth0:
          dhcp4: true
          dhcp6: no
          addresses:
          - "2a01:1234::1111:1111:1111:0f9c/64"
          routes:
          - to: "2a01:1234:e000:01e6:1111:1111:1111:1111/64"
          via: "2a01:1234:e000:01e5:1111:1111:1111:1111/64"
          on-link: true


          netplan apply succeeds. journalctl --no-pager -lu systemd-networkd shows the following error:



          Feb 25 20:19:20 gnss-sdr systemd-networkd[694]: /run/systemd/network/10-netplan-eth0.network:9: Route is invalid, ignoring assignment: 2a01:1234:e000:01e5:1111:1111:1111:1111/64
          Feb 25 20:19:20 gnss-sdr systemd-networkd[694]: Route section without Gateway field configured in /run/systemd/network/10-netplan-eth0.network. Ignoring


          Clearly you're aware that this route doesn't match the netmask of the host address, which is why you've added the on-link: true to your config; but even with this set, which generates GatewayOnlink=true in the config output to networkd at /run/systemd/network/10-netplan-eth0.network, networkd is refusing to apply this route. I don't know if we should expect this to work with networkd, but either it should work, or the systemd.network(5) manpage should document that it doesn't and netplan should refuse to accept this yaml. I would recommend filing a bug report against netplan.



          To work around this behavior (and give results that are generally speaking more understandable in terms of routing rules), you should either add an additional address to your local machine on the 2a01:XXXX:e000:01e5::/64 network so that the 2a01:XXXX:e000:01e5:1111:1111:1111:1111 gateway is reachable, or else give your 2a01:XXXX:e000:01e5:1111:1111:1111:1111 gateway an additional address on the 2a01:XXXX::/64 network and use that as your via address instead.






          share|improve this answer


























          • So I've tried changing it to routes: - to: "2a01:XXXX:e000:01e6::/64" via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111" and that still isn't working. It's just not showing the route when I do ip -6 route show

            – matty0501
            2 days ago
















          0












          0








          0







          via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64" is the wrong syntax. "via" takes a host address of a router, not a network address (when you append a netmask - i.e. /64 - it's a network address not a host address).



          You also show "2a01:XXXX:e000:01e6:1111:1111:1111:1111/64" as your to, which is irregular. Normally one would leave blank (that is, 0) the masked bits and just write "2a01:XXXX:e0000:01e6::/64". I don't know if networkd cares about this, but it might, and it's better to use the canonicalized form anyway.



          I was also able to reproduce this in a container:



          network:
          version: 2
          ethernets:
          eth0:
          dhcp4: true
          dhcp6: no
          addresses:
          - "2a01:1234::1111:1111:1111:0f9c/64"
          routes:
          - to: "2a01:1234:e000:01e6:1111:1111:1111:1111/64"
          via: "2a01:1234:e000:01e5:1111:1111:1111:1111/64"
          on-link: true


          netplan apply succeeds. journalctl --no-pager -lu systemd-networkd shows the following error:



          Feb 25 20:19:20 gnss-sdr systemd-networkd[694]: /run/systemd/network/10-netplan-eth0.network:9: Route is invalid, ignoring assignment: 2a01:1234:e000:01e5:1111:1111:1111:1111/64
          Feb 25 20:19:20 gnss-sdr systemd-networkd[694]: Route section without Gateway field configured in /run/systemd/network/10-netplan-eth0.network. Ignoring


          Clearly you're aware that this route doesn't match the netmask of the host address, which is why you've added the on-link: true to your config; but even with this set, which generates GatewayOnlink=true in the config output to networkd at /run/systemd/network/10-netplan-eth0.network, networkd is refusing to apply this route. I don't know if we should expect this to work with networkd, but either it should work, or the systemd.network(5) manpage should document that it doesn't and netplan should refuse to accept this yaml. I would recommend filing a bug report against netplan.



          To work around this behavior (and give results that are generally speaking more understandable in terms of routing rules), you should either add an additional address to your local machine on the 2a01:XXXX:e000:01e5::/64 network so that the 2a01:XXXX:e000:01e5:1111:1111:1111:1111 gateway is reachable, or else give your 2a01:XXXX:e000:01e5:1111:1111:1111:1111 gateway an additional address on the 2a01:XXXX::/64 network and use that as your via address instead.






          share|improve this answer















          via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111/64" is the wrong syntax. "via" takes a host address of a router, not a network address (when you append a netmask - i.e. /64 - it's a network address not a host address).



          You also show "2a01:XXXX:e000:01e6:1111:1111:1111:1111/64" as your to, which is irregular. Normally one would leave blank (that is, 0) the masked bits and just write "2a01:XXXX:e0000:01e6::/64". I don't know if networkd cares about this, but it might, and it's better to use the canonicalized form anyway.



          I was also able to reproduce this in a container:



          network:
          version: 2
          ethernets:
          eth0:
          dhcp4: true
          dhcp6: no
          addresses:
          - "2a01:1234::1111:1111:1111:0f9c/64"
          routes:
          - to: "2a01:1234:e000:01e6:1111:1111:1111:1111/64"
          via: "2a01:1234:e000:01e5:1111:1111:1111:1111/64"
          on-link: true


          netplan apply succeeds. journalctl --no-pager -lu systemd-networkd shows the following error:



          Feb 25 20:19:20 gnss-sdr systemd-networkd[694]: /run/systemd/network/10-netplan-eth0.network:9: Route is invalid, ignoring assignment: 2a01:1234:e000:01e5:1111:1111:1111:1111/64
          Feb 25 20:19:20 gnss-sdr systemd-networkd[694]: Route section without Gateway field configured in /run/systemd/network/10-netplan-eth0.network. Ignoring


          Clearly you're aware that this route doesn't match the netmask of the host address, which is why you've added the on-link: true to your config; but even with this set, which generates GatewayOnlink=true in the config output to networkd at /run/systemd/network/10-netplan-eth0.network, networkd is refusing to apply this route. I don't know if we should expect this to work with networkd, but either it should work, or the systemd.network(5) manpage should document that it doesn't and netplan should refuse to accept this yaml. I would recommend filing a bug report against netplan.



          To work around this behavior (and give results that are generally speaking more understandable in terms of routing rules), you should either add an additional address to your local machine on the 2a01:XXXX:e000:01e5::/64 network so that the 2a01:XXXX:e000:01e5:1111:1111:1111:1111 gateway is reachable, or else give your 2a01:XXXX:e000:01e5:1111:1111:1111:1111 gateway an additional address on the 2a01:XXXX::/64 network and use that as your via address instead.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 6 hours ago

























          answered 2 days ago









          slangasekslangasek

          2,55311419




          2,55311419













          • So I've tried changing it to routes: - to: "2a01:XXXX:e000:01e6::/64" via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111" and that still isn't working. It's just not showing the route when I do ip -6 route show

            – matty0501
            2 days ago





















          • So I've tried changing it to routes: - to: "2a01:XXXX:e000:01e6::/64" via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111" and that still isn't working. It's just not showing the route when I do ip -6 route show

            – matty0501
            2 days ago



















          So I've tried changing it to routes: - to: "2a01:XXXX:e000:01e6::/64" via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111" and that still isn't working. It's just not showing the route when I do ip -6 route show

          – matty0501
          2 days ago







          So I've tried changing it to routes: - to: "2a01:XXXX:e000:01e6::/64" via: "2a01:XXXX:e000:01e5:1111:1111:1111:1111" and that still isn't working. It's just not showing the route when I do ip -6 route show

          – matty0501
          2 days ago




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1120668%2frouting-ip-addresses-in-ubuntu-18-04%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

          Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

          Should I use Docker or LXD?How to cache (more) data on SSD/RAM to avoid spin up?Unable to get Windows File...