I recently installed openvpn on my pi so that pihole and a few other processes can run behind a VPN. While it's worked great so far, it obviously broke remote access to my Plex server. So, after a bit of research, it seemed like creating a namespace for Plex was the way to go... but for the LIFE of me I can't get it working. I'm hoping there are some network-savy individuals that can help me out.

Here was my process for setting up the namespace with macvlan (my pi's local address is, and I'm setting the namespace up under All of this used sudo since I'm logged in as pi:

ip netns add plexns

starting the loopback interface

ip netns exec plexns ip addr add dev lo
ip netns exec plexns ip link set lo up

creating a macvlan interface

ip link add int0 link eth0 type macvlan mode bridge
ip link set int0 netns plexns

assigning an address

ip netns exec plexns ip addr add dev int0
ip netns exec plexns ip link set int0 up

setting my gateway (router ip)

ip netns exec plexns ip route add default via

This seemed to work, because when I run

ip netns exec plexns curl icanhazip.com

it returns the external ip assigned by my ISP, not my VPN ip.

Next, i used

service plexmediaserver stop

to stop plex from running. And I edited /etc/init/plexmediaserver.conf so that that start-stop-daemon line read:

sudo ip netns exec plexns start-stop-daemon --start -c \
$PLEX_MEDIA_SERVER_USER --exec /usr/sbin/start_pms


ip netns exec plexns service plexmediaserver start

Of course, it didn't work. When I log into the server on my computer, it's visible locally, but not remotely. It's still working under local IP, with external IP address of my VPN.

Sorry for the novel, but I'm a complete networking novice, and not really a programmer in general, so any help would be very much appreciated!

  • But where is the question specific to Raspberry Pi? Maybe you ask better on our sister site Super User for general home networking?
    – Ingo
    Mar 28, 2018 at 11:40
  • I've checked linux boards, but for some reason some solutions and commands haven't worked for me vs, say, an ubuntu user. I figured maybe my issue was specific to the pi? I will definitely post there, though
    – Piplexed
    Mar 28, 2018 at 20:19


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.