Page MenuHomeVyOS Platform

Show command for interface messages
In progress, WishlistPublicFEATURE REQUEST

Description

It would be nice to have a simple command to show the up/down status of an interface, afaik you have to go do sudo dmesg -T | grep <interface> to see it.

It could be something as simple as show interface ethernet eth0 messages or show interface ethernet eth0 log

user@router:~$ show interfaces ethernet eth0 log
[Tue Aug  6 23:29:24 2024] igb 0000:02:00.2 eth2: igb: eth2 NIC Link is Down
[Tue Aug  6 23:29:32 2024] igb 0000:02:00.2 eth2: igb: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
[Tue Aug  6 23:29:35 2024] igb 0000:02:00.2 eth2: igb: eth2 NIC Link is Down
[Tue Aug  6 23:29:48 2024] igb 0000:02:00.2 eth2: igb: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX

Details

Version
1.5-rolling-202409160007
Is it a breaking change?
Perfectly compatible
Issue type
Feature (new functionality)

Event Timeline

yzguy edited a custom field.
yzguy changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.
yzguy changed Issue type from Unspecified (please specify) to Feature (new functionality).
Viacheslav triaged this task as Normal priority.Aug 7 2024, 5:20 PM
Viacheslav lowered the priority of this task from Normal to Wishlist.

Showing all logs for interface might print more information than it's needed. Maybe a different approach:

show interfaces ethernet eth0 log link-status

Or since it's about printing logs, similar command under show log, although currently there is no node for show log interfaces.

I can implement it but we need to agree about the command

@n.fort I like the interface log sub command, gives us a nice way to take on additional logging things later, but for now log link-status seems good to me.

n.fort changed the task status from Open to In progress.Sep 18 2024, 3:18 PM
n.fort claimed this task.
n.fort changed Version from - to 1.5-rolling-202409160007.

https://github.com/vyos/vyos-1x/pull/4216

I prepared a service to log some network events including changing link status.
to configure service:

conf
set service monitoring network-event event addr
set service monitoring network-event event link
set service monitoring network-event event neigh
set service monitoring network-event event route
set service monitoring network-event event rule
commit

to check change status:

vyos@vyos:~$ sudo ip link set down dev eth1
vyos@vyos:~$ sudo ip link set up dev eth1
vyos@vyos:~$ show interfaces ethernet eth1 event-log link 
Dec 03 09:30:09 vyos-network-event-logger[21158]: [LINK]   3: eth1:  <BROADCAST,MULTICAST>  mtu 1500  qdisc fq_codel  state DOWN  group 0  link/ether 0c:89:0a:2e:00:01  brd ff:ff:ff:ff:ff:ff  [altname enp0s4] [altname ens4]
Dec 03 09:30:14 vyos-network-event-logger[21158]: [LINK]   3: eth1:  <BROADCAST,MULTICAST,UP,LOWER_UP>  mtu 1500  qdisc fq_codel  state UP  group 0  link/ether 0c:89:0a:2e:00:01  brd ff:ff:ff:ff:ff:ff  [altname enp0s4] [altname ens4]
c-po subscribed.

@HollyGurza the vyos-network-event logger service could be used to superseede netplugd which we wanted to remove for a long time.