Ubuntu Server
Net related issues/commands
When our ethernet is present/detected by the kernel, and also physically connected to a good ethernet/Rj45 cable to your working/ok router, then you may need to force your Ubuntu server to warm up the ethernet and make it request an ip from your router manually. Its because that Linux, unlike windows, Ubuntu Server doesn’t enable or configure all interfaces automatically unless explicitly told (via netplan, ifupdown, etc.).
- When pinging failed, I used these 2 commands:
sudo ip link set enp12s0 up
sudo dhclient enp12s0
- Command to check any one adapter up/down/unknown:
ip a show enp12s0
- To check all adapters:
ip a
ping 192.168.1.1
- ping -c google.com (anywebsitename)
- To Restart the service:
SystemCtl restart systemd-resolved
- Then check your DNS:
resolvectl
(try switch for shorter output:status
or for shortestdns
wo hyphens). In earlier versions, it wassystemd-resolve --status
|or|resolvectl --status
. - Check network service status:
systemctl status systemd-networkd
(if you use network manager, then use:systemctl status NetworkManager
) - If you edited
nano /etc/systemd/resovled.conf
, (restarted with:SystemCtl restart systemd-resolved
) then verify your edits with:systemd-analyze verify /etc/systemd/resolved.conf
- Check that now you can reach:
nslookup google.com
(or archive.ubuntu.com). - Or:
dig archive.ubuntu.com
But still when I found that when ping was working, but couldn’t reach any website like google or ubuntu archives to update it, one step was still needed:
- Edit this file: sudo nano /etc/resolv.conf
- By adding/replacing the nameserver line to: 8.8.8.8 like this:
- nameserver 8.8.8.8
- But this resolve.conf file path is actually a symblink and could be rewritten back to same upon server reboot. For this to avoid, create a file: /etc/systemd/resolved.conf .
- And in it, simply write these 3 lines:
[Resolve]
DNS=8.8.8.8 8.8.4.4
FallbackDNS=1.1.1.1 1.0.0.1
- Then restart the service: sudo systemctl restart systemd-resolved
- As a precaution/Perhaps you could check/recreate the symblink: sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
To start Wifi:
- we needed net connection and then: sudo apt install bcmwl-kernel-source, which updated my wifi drivers in a moment.
- Then I found that though ‘networkd’ was very much ok for ethernet and mobile tethering. But wifi only succeeded in getting ip address after I opted for ‘NetworkManager’ in the ‘30-wifi.yaml’ file. So now for mobile tethering and ethernet, I’m using ‘netword’ program and for wifi I’m using ‘NetworkManager’ (case sensitive in yaml).
Ok. Everyting done as you told, and also successfully updated, upgraded, now lets fix wifi not working first and then fix mobile tethering, it might come to my rescue some day.