nmcli
Tom H
tomh0665 at gmail.com
Fri Feb 19 14:35:19 UTC 2021
On Fri, Feb 19, 2021 at 3:19 PM Jerry Geis <jerry.geis at gmail.com> wrote:
> On Fri, Feb 19, 2021 at 9:11 AM Tom H <tomh0665 at gmail.com> wrote:
>> On Fri, Feb 19, 2021 at 3:05 PM Jerry Geis <jerry.geis at gmail.com>
>> wrote:
>>> On Fri, Feb 19, 2021 at 8:56 AM Tom H <tomh0665 at gmail.com> wrote:
>>>>
>>>> Two ways.
>>>>
>>>> 1) Change "/etc/netplan/00-installer-config.yaml" to
>>>>
>>>> network:
>>>> ethernets:
>>>> <your_nic>:
>>>> addresses:
>>>> - 192.168.1.2/23 ## is "23" a typo?
>>>> dhcp4: false
>>>> gateway4: 192.168.1.1
>>>> nameservers:
>>>> addresses:
>>>> - 8.8.8.8
>>>> renderer: NetworkManager
>>>> version: 2
>>>>
>>>> 2) Delete "/etc/netplan/00-installer-config.yaml" and let your
>>>> config under "/etc/NetworkManager/system-connections" set up NM.
>>>> (I'm assuming that NM's enabled systemd-wise, which it should be
>>>> by default.]
>>>
>>> I tried removing /etc/netplan/00-installer-config.yaml - and
>>> rebooting and everythign was messed up then.
>>> Not DHCP address no X no nothing.
>>> So I put the file back - and rebooted - back to normal.
>>> Not the behaviour I expected.
>>
>> Very strange. I'm sure that if I set up a 20.04 VM it would work
>> for me, LOL.
>>
>> Then use the first method. I used the settings that you'd passed
>> to nmcli.
>>
>> But before you do anything, (1) does "dig" work? (2) check the
>> output of "resolvectl" to find out which nameserver you're
>> querying.
>
> Dig shows:
> ; SERVER: 127.0.0.53#53(127.0.0.53)
>
> I was hoping "not" to edit netplan files - that is why I was
> trying to use nmcli to set the IP/ DNS etc... Everything works
> except setting DNS.
dig's simply going to show you what's in "/etc/resolv.conf". Does
"dig" suceed or fail?
The way that resolved works is that it sets up a dns forwarder at
"127.0.0.53" and forwards your queries to the nameserver(s) with which
it's been set up.
Given that NM's using DHCP, you must be receiving nameserver addresses
from your dhcp server and they're being stored in
"/run/systemd/resolve/resolv.conf". If the dhcp-supplied dns settings
are failing, ...
If you'd prefer not to edit "/etc/netplan/<name>.yaml", you can
configure resolved directly.
You can either edit "/etc/systemd/resolved.conf" or create an
"/etc/systemd/resolved.conf.d" directory and an
"/etc/systemd/resolved.conf.d/<name>.conf" file and set
[Resolve]
DNS=8.8.8.8
I'm unsure how that'll interact with dhcp.
More information about the ubuntu-users
mailing list