You are not logged in.

#1 2020-09-02 17:23:58

mjd119
Member
Registered: 2020-05-07
Posts: 119

Open Ports to Machines on Local Network With VPN?

I use UFW as a firewall with rules that open certain ports to other devices on the network. For example, I have ports 8000 and 6600 open so I can control music on the MPD instance running on my desktop and access an HTTP stream through my android phone to play music through it. When I connect to a nordvpn server, I can no longer control or listen to MPD music on any other devices other than the host machine (desktop) even though when I connect to nordvpn I get a message that says the UFW rules were imported to nordvpn's firewall. Is there a way to only give access to certain ports to other devices that are connected to my local network (no remote connections)? Do I need to do any port forwarding? Switching off the VPN on my host machine every time I want to stream music to my phone is frustrating. Solutions for streaming that do not use HTTP streaming are fine.

Offline

#2 2020-09-02 23:42:41

loqs
Member
Registered: 2014-03-06
Posts: 18,964

Re: Open Ports to Machines on Local Network With VPN?

The issue is not present with the firewall disabled and the VPN connection active?

Offline

#3 2020-09-03 12:23:59

mjd119
Member
Registered: 2020-05-07
Posts: 119

Re: Open Ports to Machines on Local Network With VPN?

loqs wrote:

The issue is not present with the firewall disabled and the VPN connection active?

I'll have to check but since nordvpn disables ufw, I'm not sure how that would make a difference. If UFW is on and I'm disconnected from nordvpn, I don't have issues.

Offline

#4 2020-09-03 15:51:11

loqs
Member
Registered: 2014-03-06
Posts: 18,964

Re: Open Ports to Machines on Local Network With VPN?

When you connect to the VPN I was assuming the routing table was modified as well as the firewall rules.  I was trying to determine which was preventing the connection by eliminating firewall usage.
Can you connect to the VPN just using a config without the custom software that provides its firewall and still reproduce the issue?

Offline

#5 2020-09-03 19:24:43

mjd119
Member
Registered: 2020-05-07
Posts: 119

Re: Open Ports to Machines on Local Network With VPN?

loqs wrote:

When you connect to the VPN I was assuming the routing table was modified as well as the firewall rules.  I was trying to determine which was preventing the connection by eliminating firewall usage.
Can you connect to the VPN just using a config without the custom software that provides its firewall and still reproduce the issue?

I can connect to MPD through port 6600 when ufw is enabled (with port 6600 tcp/udp opened) and the VPN is off.  I can also connect if the firewall is off and the VPN is off. When I connect to the VPN, I can no longer access MPD through my phone using M.A.L.P. regardless of whether or not the firewall is on.

Offline

#6 2020-09-03 19:50:29

loqs
Member
Registered: 2014-03-06
Posts: 18,964

Re: Open Ports to Machines on Local Network With VPN?

How is the phone connected to the system running MPD?  Does it have to pass through the internet or is it connected to the LAN side of the same router as the MPD running system?

Offline

#7 2020-09-03 23:45:39

mjd119
Member
Registered: 2020-05-07
Posts: 119

Re: Open Ports to Machines on Local Network With VPN?

loqs wrote:

How is the phone connected to the system running MPD?  Does it have to pass through the internet or is it connected to the LAN side of the same router as the MPD running system?

The phone connects through the WiFi. The desktop is connected with Ethernet.

Offline

#8 2020-09-03 23:59:15

Zod
Member
From: Hoosiertucky
Registered: 2019-03-10
Posts: 636

Re: Open Ports to Machines on Local Network With VPN?

$ ip r

before starting the vpn and again after the vpn is started.

Offline

#9 2020-09-05 15:38:24

mjd119
Member
Registered: 2020-05-07
Posts: 119

Re: Open Ports to Machines on Local Network With VPN?

Zod wrote:
$ ip r

before starting the vpn and again after the vpn is started.

This is the result of running ip r and outputting to file.

#Without vpn and with ufw
default via 192.168.1.1 dev enp3s0 proto dhcp src 192.168.1.19 metric 202 
192.168.1.0/24 dev enp3s0 proto dhcp scope link src 192.168.1.19 metric 202 
#With vpn and with ufw
0.0.0.0/1 via 10.8.3.1 dev tun0 
default via 192.168.1.1 dev enp3s0 proto dhcp src 192.168.1.19 metric 202 
10.8.3.0/24 dev tun0 proto kernel scope link src 10.8.3.8 
64.94.215.171 via 192.168.1.1 dev enp3s0 
128.0.0.0/1 via 10.8.3.1 dev tun0 
192.168.1.0/24 dev enp3s0 proto dhcp scope link src 192.168.1.19 metric 202 

Offline

#10 2025-08-04 13:20:07

Azrael85
Member
Registered: 2012-05-30
Posts: 26

Re: Open Ports to Machines on Local Network With VPN?

Hi!
It's been a while since your post, but I'm having the exact same problem. Did you find the way to solve this?

Offline

#11 2025-08-04 15:29:40

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,570
Website

Re: Open Ports to Machines on Local Network With VPN?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB