You are not logged in.

#1 2020-12-08 09:04:57

hasardeur
Member
Registered: 2011-09-29
Posts: 17

routing and upnp (gerbera/minidlna) server

Hello everybody,

I am running a small private Arch server, that is using openVPN to connect to my company at all times. I have setup gerbera and tried minidlna to provide media streaming for my LAN via UPNP.

The problem is, that as soon as the VPN goes up no client on the LAN can see the UPNP server. If I disable the VPN connection then everything is working.
I don't quite know what to do about it. The general idea is to route all traffic through the tun interface, except for the streaming server. Is it possible to create
a route that sort of singles out the UPNP server and directs that traffic to enp4s0 (ethernet)? Is that even possible? Are there alternatives?

This is my interface setup when the VPN is active:

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether d0:50:99:9f:3c:f4 brd ff:ff:ff:ff:ff:ff
    inet 192.168.11.6/24 brd 192.168.11.255 scope global dynamic enp4s0
       valid_lft 860499sec preferred_lft 860499sec
    inet6 fe80::d250:99ff:fe9f:3cf4/64 scope link
       valid_lft forever preferred_lft forever
3: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 500
    link/none
    inet 10.8.1.3/24 scope global tun0
       valid_lft forever preferred_lft forever
    inet6 fe80::4b47:896c:e72f:43ea/64 scope link stable-privacy
       valid_lft forever preferred_lft forever

This is my routing table without the VPN:

$ ip r
0.0.0.0/1 via 10.8.2.1 dev tun0
default via 192.168.11.1 dev enp4s0 proto static onlink
default via 192.168.11.1 dev enp4s0 proto dhcp src 192.168.11.6 metric 1024
192.168.11.0/24 dev enp4s0 proto kernel scope link src 192.168.11.6
192.168.11.1 dev enp4s0 proto dhcp scope link src 192.168.11.6 metric 1024

This is the table with the VPN active:

$ ip r
0.0.0.0/1 via 10.8.2.1 dev tun0
default via 192.168.11.1 dev enp4s0 proto static onlink
default via 192.168.11.1 dev enp4s0 proto dhcp src 192.168.11.6 metric 1024
10.8.2.0/24 dev tun0 proto kernel scope link src 10.8.2.7
83.97.23.11 via 192.168.11.1 dev enp4s0
128.0.0.0/1 via 10.8.2.1 dev tun0
192.168.11.0/24 dev enp4s0 proto kernel scope link src 192.168.11.6
192.168.11.1 dev enp4s0 proto dhcp scope link src 192.168.11.6 metric 1024

Any help would be appreciated, as I don't know where to start.

Thank you for your time!

Last edited by hasardeur (2020-12-08 15:42:18)

Offline

#2 2020-12-08 13:37:50

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,281

Re: routing and upnp (gerbera/minidlna) server

What is the ip-address of the device that runs gerbera ?
Does that device provide other services also (like the vpn)  ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2020-12-08 13:42:37

progandy
Member
Registered: 2012-05-17
Posts: 5,279

Re: routing and upnp (gerbera/minidlna) server

In addition, have you set gerbera to listen on the correct IP / interface? Maybe the automatic selection chooses the wrong one.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2020-12-08 15:41:45

hasardeur
Member
Registered: 2011-09-29
Posts: 17

Re: routing and upnp (gerbera/minidlna) server

Hello and thank you!

Lone_Wolf wrote:

What is the ip-address of the device that runs gerbera ?

192.168.11.6

Does that device provide other services also (like the vpn)  ?

Yes, namely deluged, deluge-web, openvpn-client and sshd.

systemctl --type=service
  UNIT                                     LOAD   ACTIVE SUB     DESCRIPTION
  dbus.service                             loaded active running D-Bus System Message Bus
  deluge-web.service                       loaded active running Deluge WebUI
  deluged.service                          loaded active running Deluge Daemon
  gerbera.service                          loaded active running Gerbera Media Server
  getty@tty1.service                       loaded active running Getty on tty1
  kmod-static-nodes.service                loaded active exited  Create list of static device nodes for the current kernel
  lvm2-lvmetad.service                     loaded active running LVM2 metadata daemon
  lvm2-monitor.service                     loaded active exited  Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling
  openvpn-client@x                         loaded active running OpenVPN tunnel for x
  sshd.service                             loaded active running OpenSSH Daemon
  systemd-journal-flush.service            loaded active exited  Flush Journal to Persistent Storage
  systemd-journald.service                 loaded active running Journal Service
  systemd-logind.service                   loaded active running User Login Management
  systemd-networkd-wait-online.service     loaded active exited  Wait for Network to be Configured
  systemd-networkd.service                 loaded active running Network Service
  systemd-random-seed.service              loaded active exited  Load/Save Random Seed
  systemd-remount-fs.service               loaded active exited  Remount Root and Kernel File Systems
  systemd-resolved.service                 loaded active running Network Name Resolution
  systemd-sysctl.service                   loaded active exited  Apply Kernel Variables
  systemd-timesyncd.service                loaded active running Network Time Synchronization
  systemd-tmpfiles-setup-dev.service       loaded active exited  Create Static Device Nodes in /dev
  systemd-tmpfiles-setup.service           loaded active exited  Create Volatile Files and Directories
  systemd-udev-trigger.service             loaded active exited  Coldplug All udev Devices
  systemd-udevd.service                    loaded active running Rule-based Manager for Device Events and Files
  systemd-update-utmp.service              loaded active exited  Update UTMP about System Boot/Shutdown
  systemd-user-sessions.service            loaded active exited  Permit User Sessions
  user-runtime-dir@1000.service            loaded active exited  User Runtime Directory /run/user/1000
  user@1000.service                        loaded active running User Manager for UID 1000
progandy wrote:

In addition, have you set gerbera to listen on the correct IP / interface?

Yes, I have bound gerbera to enp4s0 and I can access the web-interface without issue.

2020-12-08 16:31:24   info: Gerbera UPnP Server version 1.7.0_git - http://gerbera.io/
2020-12-08 16:31:24   info: ===============================================================================
2020-12-08 16:31:24   info: Gerbera is free software, covered by the GNU General Public License version 2
2020-12-08 16:31:24   info: Copyright 2016-2020 Gerbera Contributors.
2020-12-08 16:31:24   info: Gerbera is based on MediaTomb: Copyright 2005-2010 Gena Batsyan, Sergey Bostandzhyan, Leonhard Wimmer.
2020-12-08 16:31:24   info: ===============================================================================
2020-12-08 16:31:24   info: Loading configuration from: /etc/gerbera/config.xml
2020-12-08 16:31:24   info: Checking configuration...
2020-12-08 16:31:24   info: Configuration check succeeded.
2020-12-08 16:31:24   info: About to migrate metadata from mt_cds_object to mt_metadata
2020-12-08 16:31:24   info: No data will be removed from mt_cds_object
2020-12-08 16:31:24   info: Migrated metadata - object count: 0
2020-12-08 16:31:24   info: Loading 10 configuration items from database
2020-12-08 16:31:24   info: Initialising libupnp with interface: 'enp4s0', port: 50505
2020-12-08 16:31:24   info: Initialized port: 50505
2020-12-08 16:31:24   info: Server bound to: 192.168.11.6
2020-12-08 16:31:24   info: The Web UI can be reached by following this link: http://192.168.11.6:50505/

Offline

#5 2020-12-11 15:49:51

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,281

Re: routing and upnp (gerbera/minidlna) server

Is 50505 also the port were the stream is sent over ?

There may be  a way to achieve what you want using nftables rules to separate stream traffic from all other traffic, but that's beyond my nftables skillevel.
I'd probably separate the vpn to a dedicated device.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB