Re: nmcli and gateway question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-08-07 18:44, Tom H wrote:
> On Wed, Aug 5, 2020 at 3:49 PM Ed Greshko <ed.greshko@xxxxxxxxxxx>
> wrote:
>> On 2020-08-05 21:02, Tom H wrote:
>>> Hopefully Todd, the OP, realized that you were implying that he
>>> might not have "systemd-resolved" running...
>> Hopefully....
>>
>> I may be dense, but it seems to me there is no particular advantage
>> to using resolvectl, or getent over the "ip route" command to learn
>> the IP address of the gateway.  For my $ those give too little info
>> to understand how traffic may be routed. And that is what I am
>> normally also wanting to know when looking at a gateway. But that
>> may just be me.
> The complaint was that the iproute tools spit out too much information.

Oh, I thought the complaint was that nmcli, at least the command I used, gave too much info.
Granted, I was giving a command which returned all the info I though the OP wanted.

FWIW, I only use nmcli to create, edit, control connections/devices under the control of NetworkManager.
I don't use, and wouldn't use, nmcli to search/determine how things are configured on a system I'm
not familiar with.

Each tool has some "drawbacks" unless you are aware of their use cases or have a clear
understanding of what you need/want to know.  For example,

[egreshko@meimei ~]$ resolvectl query _gateway
_gateway: 192.168.1.1                          -- link: enp2s0
          192.168.2.5                          -- link: wlp4s0
          2001:b030:112f::1                    -- link: enp2s0

Returns a list of "default gateways".  But, it doesn't tell you which will actually be used.

[egreshko@meimei ~]$ ip -br -4 route show | grep default
default via 192.168.1.1 dev enp2s0 proto static metric 100
default via 192.168.2.5 dev wlp4s0 proto dhcp metric 600

Tells one the same, but does have the metric so you know which route would be used first.
But you can't, at least I've not found a way, to list both IPv4 and IPv6 routes with the same command.

And even both of those, as written, don't show Host routes which also need a "gateway" but not
one which is "default"

netstat -rn is sorta fine for IPv4, but spits out too much for my taste with IPv6.  I don't normally care
about scope link info.  It also has a Flag of U which can confuse since some docs say "route is up" and other
documentation say "route is valid".  It can lead some to think that it may mean the physical gateway device
is "up" and working.  It also lacks a metric....but I suppose most setups are rather straight-forward.

I still prefer the "ip route" command because you know at a glance all devices being used, their associated
IP address, and the routes along with their metric.

Anyway, at the risk of offending some family members, all of this comes under the heading of "There is more
than one way to skin a cat".

:-)

-- 
The key to getting good answers is to ask good questions.
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux