1

I have been trying to set up my own cloud via nextcloud on an old laptop. So far it all works fine but the only problem is that I can not make it work with a static ip-adress. It works just fine with dhcp though.

Thing I have tried so far is changing to static by editing the 01-netcfg.yaml to:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp4s0:
      dhcp4: false
     addresses:
      - 192.168.10.10/24
     routes:
      - to: default
        via: 192.168.10.1
     nameservers:
       addresses: [8.8.8.8]

after changing I do $ sudo netplan apply and reboot the system.

Now when I try to ping google.com it gives me the error Temporary failure in name resolution

after that I check the resolv.conf which is set to nameserver 8.8.8.8

I also can not ssh to my server through my windows pc. However if I change the netplan to:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp4s0:
      dhcp4: yes

it works just fine. I also tried a fresh install of ubuntu servers on my system but no luck.

I am also pretty new to linux I have to say. Am I missing something? Would be really glad if someone could help :)

memoki
  • 11
  • 1
  • Your settings look correct to me. Can you ping an IP address instead of a hostname? That will tell you whether it's a DNS problem or an IP problem. – Grant Jul 11 '22 at 14:22
  • Try some `traceroute`s or `mtr`s as well – Barry Carter Jul 11 '22 at 15:38
  • check the indentation; dhcp4: false should be aligned with other lines or remove this line completely – 4snok Jul 11 '22 at 23:49
  • @Grant @barrycarter I tried `ping 8.8.8.8` this time it gives me the error `From XXX.XXX.XXX.XXX icmp_seq=1 Destination Host Unreachable` (XXX.XXX.XXX.XXX is my ip address). When I use `tracroute 8.8.8.8` it gives me `1 XXX.XXX.XXX.XXX (XXX.XXX.XXX.XXX) 3059.901 ms !H 3059.809 ms !H 3059.787 ms !H`. Again if I swithc ti `dhcp: yes` on netplan both command work just fine. – memoki Jul 12 '22 at 09:59
  • The problem is the default route I read somewhere. Everyone is giving wrong advice on this issue because they're using outdated Ubuntu and netplan settings. I don't think most people even tried their "solutions". – Sam Jan 09 '23 at 22:11

0 Answers0