Question on nmcli on Ubuntu 20.04

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Question on nmcli on Ubuntu 20.04

Jerry Geis
I am using this command:
nmcli connection modify 'Wired connection 1' ipv4.method manual ipv6.method ignore autoconnect yes ipv4.addr 192.168.1.19/22 gw4 192.168.1.1 ipv4.dns 192.168.1.14

to set static address and the DNS. everything seems to work except setting the DNS.
The /etc/resolv.conf file still shows 127.0.0.53 and not the 192.168.1.14

Why is that ? What did I not do correctly ?

Thanks

jerry


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Question on nmcli on Ubuntu 20.04

David Fletcher-5
On Fri, 2020-12-18 at 11:47 -0500, Jerry Geis wrote:
> I am using this command:
> nmcli connection modify 'Wired connection 1' ipv4.method manual
> ipv6.method ignore autoconnect yes ipv4.addr 192.168.1.19/22 gw4
> 192.168.1.1 ipv4.dns 192.168.1.14
>
> to set static address and the DNS.

I assume you're setting up 20.04 server? I just (from my installation
and configuration notes) did this:-

See
https://www.tecmint.com/configure-network-static-ip-address-in-ubuntu/
Set up networking:-
Edit /etc/netplan/???? to look like this:-

# This is the network config written by 'subiquity'
network:
  ethernets:
    enp2s0:
      addresses:
      - 192.168.2.x/24
      gateway4: 192.168.2.1
      nameservers:
        addresses:
        - 208.67.222.222
        - 208.67.220.220
        - 192.168.2.1
        - 8.8.8.8
        - 8.8.4.4
  version: 2


Then do
sudo netplan apply

This is from my personal notes. Your Ethernet port name may be
different. Don't change it.

Hope that gets you going.

Dave


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Question on nmcli on Ubuntu 20.04

Tom H-4
In reply to this post by Jerry Geis
On Fri, Dec 18, 2020 at 5:49 PM Jerry Geis <[hidden email]> wrote:
>
> I am using this command:
>
> nmcli connection modify 'Wired connection 1' ipv4.method manual ipv6.method ignore autoconnect yes ipv4.addr 192.168.1.19/22 gw4 192.168.1.1 ipv4.dns 192.168.1.14
>
> to set static address and the DNS. everything seems to work except
> setting the DNS.
>
< The /etc/resolv.conf file still shows 127.0.0.53 and not the
> 192.168.1.14
>
> Why is that ? What did I not do correctly ?

What's the output of "resolvectl"?

[ or of the following ]
ls -l /etc/resolv.conf
cat /run/systemd/resolve/resolv.conf

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Question on nmcli on Ubuntu 20.04

Jerry Geis

On Fri, Dec 18, 2020 at 2:10 PM Tom H <[hidden email]> wrote:
On Fri, Dec 18, 2020 at 5:49 PM Jerry Geis <[hidden email]> wrote:
>
> I am using this command:
>
> nmcli connection modify 'Wired connection 1' ipv4.method manual ipv6.method ignore autoconnect yes ipv4.addr 192.168.1.19/22 gw4 192.168.1.1 ipv4.dns 192.168.1.14
>
> to set static address and the DNS. everything seems to work except
> setting the DNS.
>
< The /etc/resolv.conf file still shows 127.0.0.53 and not the
> 192.168.1.14
>
> Why is that ? What did I not do correctly ?

What's the output of "resolvectl"?

[ or of the following ]
ls -l /etc/resolv.conf
cat /run/systemd/resolve/resolv.conf

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



Hi Tom,

Here are the items. Everything seems right - but its just my "expectations" when viewing /etc/resolv.conf. I thought the nameserver should be 192.168.1.14
Should it not be based on the above nmcli command ?

Jerry

# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
options edns0 trust-ad
Global
       LLMNR setting: no                  
MulticastDNS setting: no                  
  DNSOverTLS setting: no                  
      DNSSEC setting: no                  
    DNSSEC supported: no                  
          DNSSEC NTA: 10.in-addr.arpa    
                      16.172.in-addr.arpa
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa
                      18.172.in-addr.arpa
                      19.172.in-addr.arpa
                      20.172.in-addr.arpa
                      21.172.in-addr.arpa
                      22.172.in-addr.arpa
                      23.172.in-addr.arpa
                      24.172.in-addr.arpa
                      25.172.in-addr.arpa
                      26.172.in-addr.arpa
                      27.172.in-addr.arpa
                      28.172.in-addr.arpa
                      29.172.in-addr.arpa
                      30.172.in-addr.arpa
                      31.172.in-addr.arpa
                      corp                
                      d.f.ip6.arpa        
                      home                
                      internal            
                      intranet            
                      lan                
                      local              
                      private            
                      test                

Link 3 (wlo2)
      Current Scopes: none
DefaultRoute setting: no  
       LLMNR setting: yes
MulticastDNS setting: no  
  DNSOverTLS setting: no  
      DNSSEC setting: no  
    DNSSEC supported: no  

Link 2 (eno1)
      Current Scopes: DNS        
DefaultRoute setting: yes        
       LLMNR setting: yes        
MulticastDNS setting: no          
  DNSOverTLS setting: no          
      DNSSEC setting: no          
    DNSSEC supported: no          
  Current DNS Server: 192.168.1.14
         DNS Servers: 192.168.1.14
          DNS Domain: ~.          



lrwxrwxrwx 1 root root 39 Dec 18 14:18 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf



# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
options edns0 trust-ad
 



--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Question on nmcli on Ubuntu 20.04

Tom H-4
On Fri, Dec 18, 2020 at 8:55 PM Jerry Geis <[hidden email]> wrote:

>
> Link 2 (eno1)
>       Current Scopes: DNS
> DefaultRoute setting: yes
>        LLMNR setting: yes
> MulticastDNS setting: no
>   DNSOverTLS setting: no
>       DNSSEC setting: no
>     DNSSEC supported: no
>   Current DNS Server: 192.168.1.14
>          DNS Servers: 192.168.1.14
>           DNS Domain: ~.

This shows that your nmcli command worked.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Question on nmcli on Ubuntu 20.04

Jerry Geis


On Fri, Dec 18, 2020 at 3:28 PM Tom H <[hidden email]> wrote:
On Fri, Dec 18, 2020 at 8:55 PM Jerry Geis <[hidden email]> wrote:
>
> Link 2 (eno1)
>       Current Scopes: DNS
> DefaultRoute setting: yes
>        LLMNR setting: yes
> MulticastDNS setting: no
>   DNSOverTLS setting: no
>       DNSSEC setting: no
>     DNSSEC supported: no
>   Current DNS Server: 192.168.1.14
>          DNS Servers: 192.168.1.14
>           DNS Domain: ~.

This shows that your nmcli command worked.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Thanks - I was "expecting" to see it reflected in /etc/resolv.conf  so I thought it wasn't working.

Jerry 

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users