IP report in motd should ignore virtual interfaces

Bug #1944204 reported by Christian Ehrhardt 
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
landscape-client (Ubuntu)
Fix Committed
Undecided
Kevin Nasto

Bug Description

In the spirit of bug 1038422 I think we also need to exclude virtual interfaces.
At least in the usage for the motd headers.

In a common server you often find LXD, Libvirt and maybe some further bridges. So today when logging in I saw:

```
$ ssh -XY horsea
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-84-generic x86_64)

 * Documentation: https://help.ubuntu.com
 * Management: https://landscape.canonical.com
 * Support: https://ubuntu.com/advantage

  System information as of Mon Sep 20 14:17:06 UTC 2021

  System load: 1.19
  Usage of /: 18.5% of 228.17GB
  Memory usage: 75%
  Swap usage: 1%
  Temperature: 36.0 C
  Processes: 764
  Users logged in: 1
  IPv4 address for eno1: 10.245.168.39
  IPv4 address for eno50: 10.245.170.222
  IPv4 address for localbridge0: 10.0.21.1
  IPv4 address for localbridge2: 10.0.22.1
  IPv4 address for lxdbr0: 10.128.57.1
  IPv6 address for lxdbr0: fd42:97e3:9a49:c9a1::1
  IPv4 address for virbr0: 192.168.122.1

 * Super-optimized for small spaces - read how we shrank the memory
   footprint of MicroK8s to make it the smallest full K8s around.

   https://ubuntu.com/blog/microk8s-memory-optimisation

13 updates can be applied immediately.
To see these additional updates run: apt list --upgradable
```

IMHO this whole section:
```
  IPv4 address for localbridge0: 10.0.21.1
  IPv4 address for localbridge2: 10.0.22.1
  IPv4 address for lxdbr0: 10.128.57.1
  IPv6 address for lxdbr0: fd42:97e3:9a49:c9a1::1
  IPv4 address for virbr0: 192.168.122.1
```
isn't very useful.

I'd ask to (up to you) either remove it from landscape-sysinfo in general OR if you think that is more useful maybe call it only with --exclude-sysinfo-plugins=Network when using it for MOTD.

The latter would also help to keep this in-line in servers that just
happen to have plenty of real interfaces. Another alternative would be to
just report the IP address and device that is associated with the default
gateway as that most likely is the one you might want to know about in a sysinfo.

description: updated
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I would suggest to experiment with the idea of only including the interfaces that have default routes.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in landscape-client (Ubuntu):
status: New → Confirmed
Revision history for this message
Marcus Furlong (furlongm) wrote :

This could possibly be achieved by using a regex and exposing `skipped_interfaces` via a config option?

i.e. instead of just having "lo", allow the user to specify other interfaces to skip in the client config file: e.g. skipped_interfaces=["docker0", "cacl.*"]

This could then be passed to the following function in `landscape/lib/network.py`

def get_active_device_info(skipped_interfaces=("lo",),
                           skip_vlan=True, skip_alias=True, extended=False):

Changed in landscape-client (Ubuntu):
assignee: nobody → Kevin Nasto (silverdrake11)
status: Confirmed → In Progress
Revision history for this message
Kevin Nasto (silverdrake11) wrote :
Changed in landscape-client (Ubuntu):
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.