Re: nmcli and gateway question

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

 



On 2020-08-02 10:42, Samuel Sieb wrote:
> On 8/1/20 7:20 PM, ToddAndMargo via users wrote:
>> Is there a way to get nmcli to tell you if an interface
>> is a gateway like you can with `netstat -rn`?
>
> Very related to the previous question.
>
> # nmcli --fields IP4.GATEWAY d show wlo1
> IP4.GATEWAY:                            10.0.1.1
>
> # nmcli --fields IP4.GATEWAY d show lo
> IP4.GATEWAY:                            --

Well, that does tell you if it is a gateway.  But, one may also be interested in

[egreshko@meimei ~]$ nmcli --fields IP4.ROUTE d show enp2s0
IP4.ROUTE[1]:                           dst = 192.168.1.0/24, nh = 0.0.0.0, mt = 100
IP4.ROUTE[2]:                           dst = 0.0.0.0/0, nh = 192.168.1.1, mt = 100

To determine if it is a default gateway.  As well as its metric.

[egreshko@meimei ~]$ nmcli --fields IP4.ROUTE d show wlp4s0
IP4.ROUTE[1]:                           dst = 0.0.0.0/0, nh = 192.168.2.5, mt = 600
IP4.ROUTE[2]:                           dst = 192.168.2.0/24, nh = 0.0.0.0, mt = 600

Which indicates if enp2s0 is down then wlp4s0 becomes the default route.


-- 
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