Netplan Config with Gateway Outside Subnet

I'm having trouble with some routing. I cannot get to 192.168.1.1 Below is the config. I have tried with onlink and without. Not sure what onlink does really. There are a few switches this machine goes through before it would hit the router. is there something i'm missing? ip route show shows that it has added the routes correctly.

Thanks!

Netplan config

network:
  renderer: networkd
  ethernets:
    enp7s0:
       addresses:
            - 192.168.0.172/24
       routes:
          - to: 0.0.0.0/0
            via: 192.168.1.1
      nameservers:
           addresses:
               - 192.168.1.1
version: 2
1

1 Answer

You have listed as your default gateway an address, 192.168.1.1, which is not part of the configured local network, 192.168.0.172/24. Either the gateway for your default route should be on the 192.168.0.0 network, or you need to provide information about what the intermediate router is that lets you get to 192.168.1.1.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest