yellowman / nsh

OpenBSD networking configuration shell
http://www.nmedia.net/nsh/
Other
174 stars 27 forks source link

add command 'show ip' which provides an overview of IP addresses #106

Closed stspdotname closed 1 year ago

stspdotname commented 1 year ago

Display all IP addresses in sorted order, first IPv4, then IPv6. For each address, indicate the interface it is assigned on and show type information: dhcp, static, autoconf, temporary, link-local

There are aliases 'show inet' and 'show inet6' which only display IPv4 or IPv6 addresses, respectively.

Unfortunately we have to run dhcpleasectl to figure out if a given IPv4 address is managed via DHCP. I did not find another way...

The idea of having a "show ip" command came via Tom Smyth

smytht commented 1 year ago

Works as advertised...
would suggest that rdomain of an an ip /interface pair
the ability to show active ips on the system and the nonstatic origin of the active address means I would be inclined to merge this for now and put the rdomain display on the todo list nsh(config-p)/show ip Address Interface Type 10.0.2.15 em0 dhcp 10.10.10.2 vlan4093 static 127.0.0.1 lo0 static ::1 lo0 static fe80:4::1 lo0 link-local nsh(config-p)/show inet Address Interface Type 10.0.2.15 em0 dhcp 10.10.10.2 vlan4093 static 127.0.0.1 lo0 static nsh(config-p)/show inet6 Address Interface Type ::1 lo0 static fe80:4::1 lo0 link-local nsh(config-p)/show inet inet inet6 nsh(config-p)/show inet inet inet6 nsh(config-p)/show inet inet inet6 nsh(config-p)/show inet ? % Wrong number of arguments to 'show inet' command (min 0, max 0) nsh(config-p)/show inet Address Interface Type 10.0.2.15 em0 dhcp 10.10.10.2 vlan4093 static 127.0.0.1 lo0 static nsh(config-p)/show interface status % Name Status Link Routing-Domain Media lo0 up - 0
em0 up active 0 Ethernet 1000baseT full-duplex em1 down active 0 Ethernet 1000baseT full-duplex enc0 down active 0
pflog0 up - 0
vlan100 up no carrier 0 Ethernet 1000baseT full-duplex vlan1004093 down no carrier 0
vlan4093 up active 0 Ethernet 1000baseT full-duplex vlan200 up active 200 Ethernet 1000baseT full-duplex lo200 down - 200

smytht commented 1 year ago

Im ok with this but due to the Stefans Comments about having to use dhcpleased I would like other eyes on it