Skip to content

network module does not work with tun device #1986

@g3n35i5

Description

@g3n35i5

Describe the issue

I use the network module for my ethernet, my wifi and my vpn. Both ethernet and wifi work fine. However, the tun interface is not displayed and there is no information about errors in the log. The configurations (below) are identical except for the name of the interface.

Expected behavior:

The network module should work with my tun device.

Actual behavior:

It doesn't appear in my bar.

Was it working before?

I just started using polybar.

To Reproduce

A minimal but complete config with which the problem occurs:

[colors]
background = #222
background-alt = #444
foreground = #dfdfdf
foreground-alt = #555
primary = #ffb52a
secondary = #e60053
alert = #bd2c40

[bar/main]
width = 100%
height = 27
radius = 6.0
fixed-center = false

background = ${colors.background}
foreground = ${colors.foreground}

line-size = 3
line-color = #f00

border-size = 4
border-color = #00000000

padding-left = 0
padding-right = 2

module-margin-left = 1
module-margin-right = 2

font-0 = Roboto Mono:pixelsize=12;1

modules-left =
modules-center = wlan eth vpn
modules-right =

cursor-click = pointer
cursor-scroll = ns-resize

[module/vpn]
type = internal/network
interface = tun0
interval = 3.0

label-connected = %local_ip%
label-disconnected = N/A
format-connected-prefix = "vpn: "
format-disconnected-prefix = "vpn: "

[module/wlan]
type = internal/network
interface = wlp4s0
interval = 3.0

label-connected = %local_ip%
label-disconnected = N/A
format-connected-prefix = "wlan: "
format-disconnected-prefix = "wlan: "


[module/eth]
type = internal/network
interface = enp0s31f6
interval = 3.0

label-connected = %local_ip%
label-disconnected = N/A
format-connected-prefix = "eth: "
format-disconnected-prefix = "eth: "


[settings]
screenchange-reload = true

[global/wm]
margin-top = 5
margin-bottom = 5

List any other steps needed to reproduce the issue besides starting polybar with the config you posted above.
Output of ip route:

$ ip route
10.56.0.0/16 dev tun0 proto kernel scope link src 10.56.0.3 
10.172.64.0/18 dev wlp4s0 proto kernel scope link src 10.172.115.163 metric 600 
172.24.0.0/16 dev enp0s31f6 proto kernel scope link src 172.24.179.221 metric 100 

Polybar Log

Post everything polybar outputs to the terminal when you run it and the issue occurs below

* Parsing config file: /home/g3n35i5/.config/polybar/config.ini
* Loaded monitor eDP-1 (1920x1080+1433+1080)
* Bar geometry: 1920x35+1433+1080; Borders: 4,4,4,4
* Starting application
* Starting module/eth
* Starting module/vpn
* Starting module/wlan
* Entering event loop (thread-id=1)
* Eventqueue worker (thread-id=5)
* Configured DPI = 96x96
* Loaded font "Roboto Mono:pixelsize=12" (name=DejaVu Sans, offset=1, file=/usr/share/fonts/TTF/DejaVuSans.ttf)
* Bar window: 0x0800002
* Disabling tray manager (reason: missing `tray-position`)
* module/wlan: Rebuilding cache
* module/eth: Rebuilding cache
* module/vpn: Rebuilding cache
* Redrawing bar window
* module/wlan: Rebuilding cache
* module/eth: Rebuilding cache
* module/vpn: Rebuilding cache
* module/wlan: Rebuilding cache
* module/eth: Rebuilding cache
* module/vpn: Rebuilding cache

Screenshots

vpn_not_appearing

Environment:

  • WM: i3wm
  • Distro: ArchLinux (Linux 5.4.8-arch1-1 x86_64)
  • Output of polybar -vvv:
polybar 3.4.2

Features: +alsa +curl +i3 +mpd +network(libnl) +pulseaudio +xkeyboard

X extensions: +randr (+monitors) +composite +xkb +xrm +xcursor

Build type: Release
Compiler: /usr/bin/c++
Compiler flags: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -Wall -Wextra -Wpedantic -O3 -DNDEBUG
Linker flags: -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now 

Additional context

Maybe this is a similar issue, but at least the label is displayed there: #1877

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions