0

I am using Ubuntu 20.04.1 LTS. I have very limited knowledge on how to set the network configuration after the installation of the server.

I run a small subnet with one static IP server on it next to my dhcp home subnet. I have pihole running wich then Points to unbound for dnsquery.

I then set nameserver in netplan to 127.0.0.1 for local dnsquery. Static IP server is now without Connection to homesubnet/internet, i can ping the server but hte server can't ping back.

IP route show gives me no info at all. I get the feeling that the server can't find the router? Gateway is set.

1
  • I am a little confused. You've applied a Netplan to your server, and now other devices have DNS access, but you don't think this server can route - is that correct, or am I drunk? If you post output of ip a and ip route we can have a look.
    – DankyNanky
    Nov 28, 2020 at 12:15

2 Answers 2

0

I am not sure if I am interpreting your question correctly, but a few things to help test if you can in fact see your router from your server.

Because NetPlan now is the default manager, we can ignore /etc/resolv.conf, however to view or modify on Ubuntu you can set your DNS settings via /etc/resolv.conf as follows:

nameserver 127.0.0.53
options edns0
search internal-network.local

If you are using resolv and not Netplan, point this at your DNS provider (in this question, PiHole I surmise), and restart the service:

sudo systemctl status resolvconf.service

From here, you can then test to see if you can reach your router or DNS provider. If you simply ping the IP address of your destination (removing DNS from the equation) you should see if you can hit your L2 next-hop. You can find this out quite easily:

ip a | grep default

default via 192.168.0.1 dev eno2 
default via 192.168.0.1 dev eno2 proto dhcp metric 100 

(Noting your ranges will vary)

From there perform a basic ping -c 1 192.168.0.1 to ensure you have connectivity. From here you can start to validate that you have L2 network access.

Your Question

I get the feeling that the server cannot find the router

This is pretty open. If you've configured your DHCP leases (or your static routes correctly) then that should be fine. On your server, have a look at the netplan configuration and ensure you've set it correctly.

Run cat /var/lib/NetworkManager/internal... (noting the file is unique, use tab to auto-complete) to see your DHCP data:

# This is private data. Do not parse.
ADDRESS=192.168.0.9
NETMASK=255.255.255.0
ROUTER=192.168.0.1
SERVER_ADDRESS=192.168.0.1
T1=42600
T2=74550
LIFETIME=85200
DNS=8.8.8.8 8.8.4.4
DOMAINNAME=internal-network.local
CLIENTID=01b42e9933fa61

If you've got the correct information here (ROUTER, NETMASK and SERVER_ADDRESS) then your problem is something else. A simple ICMP ping will denote whether you've got access to your router. If you're in the same logical network (I'm going to guess you're on a convention /24 range (255.255.255.0/24)) then you should also be see your DNS setup without the requirement to route.

IP route show gives me no info at all. I get the feeling that the server can't find the router?

This will give you all the information you require. If your DNS server is not within the same broadcast domain, you'll need to route to it. If this is in the same logical subnet then you should be able to abide by the default route on your box (an assumption is being made you have 1 logical NIC) - and even if not, as long as default knows how to route to $x you're fine.

The question here is does your server have the capacity to route via your router to the internet. Start by identifying your routers internal IP address and see if you can get to it - then, try an internet address:

m-(~)-(15 files, 1.5Mb)--> traceroute 1.1.1.1
traceroute to 1.1.1.1 (1.1.1.1), 64 hops max
  1   192.168.0.1  0.505ms  0.395ms  0.301ms 
  2   58.162.26.2  1.810ms  1.904ms  1.923ms 

The first hop is my router, and then out to the internet. If you've got dual NICs, you might want to add a route:

ip route add 1.1.1.1/32 via 192.168.0.1

Retest this single host and see if your route changes.

1
  • Resolvconf is not a substitute for netplan. I don't think you should mention it at all here.
    – slangasek
    Nov 29, 2020 at 3:31
0

Gave up on static IP. After a lot of google and trial / error:

1 - Start dhcp server on router for subnet, bind server mac.

2 - Wiped /etc/netplan/01-netcfg..

3 - find out dhcp renderer.

4 - fix netplan to start dhcp.
network:
version: 2
renderer: networkd
ethernets:
en01:
dhcp4: true

5 - netplan try -> netplan apply

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .