On 2020-08-03 07:10, ToddAndMargo via users wrote:
> On 2020-08-01 19: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:                            --
>
> Uh Oh!
>
> This tells me "what" the gateway is, but not
> "if" the device is a gateway:
>
> $ netstat -rn | grep eno2
> 0.0.0.0         192.168.250.1   0.0.0.0         UG        0 0          0 eno2
> 192.168.250.0   0.0.0.0         255.255.255.0   U         0 0          0 eno2
>
>
>
> $ nmcli device show eno2
> GENERAL.DEVICE:                         eno2
> GENERAL.TYPE:                           ethernet
> GENERAL.HWADDR:                         AC:1F:6B:62:10:07
> GENERAL.MTU:                            1500
> GENERAL.STATE:                          100 (connected)
> GENERAL.CONNECTION:                     eno2
> GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveCo
> nnection/5
> WIRED-PROPERTIES.CARRIER:               on
> IP4.ADDRESS[1]:                         192.168.250.135/24
> IP4.GATEWAY:                            192.168.250.1
> IP4.ROUTE[1]:                           dst = 192.168.250.0/24, nh = 0.0.0.0, 
> mt
>  = 0
> IP4.ROUTE[2]:                           dst = 0.0.0.0/0, nh = 192.168.250.1, 
> mt
> = 0
> IP4.DNS[1]:                             127.0.0.1
> IP6.ADDRESS[1]:                         fe80::ae1f:6bff:fe62:1007/64
> IP6.GATEWAY:                            --
> IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 100
> IP6.ROUTE[2]:                           dst = ff0
>
>

I don't know what you're trying to determine.

Are you thinking that the G in the netstat output means the interface is a 
Gateway?  It doesn't.
The U means the "route" is valid and the G means the "route" is to a gateway 
rather than a directly
connected network or host.



-- 
The key to getting good answers is to ask good questions.
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
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@lists.fedoraproject.org

Reply via email to