UFW KillSwitch with exception traffic for ports and Plex

This forum is for general conversation and user-user networking.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
banana
OpenVpn Newbie
Posts: 1
Joined: Fri Apr 24, 2020 12:37 pm

UFW KillSwitch with exception traffic for ports and Plex

Post by banana » Fri Apr 24, 2020 12:42 pm

Hello guys!

So, I have a Ubuntu Server 18.04 that is connected to my home network, but uses a VPN. In order to block internet access, I blocked all connections of UFW like this:
- First all IPv6 connections were disabled on ubuntu and /etc/defaults/ufw -> IPV6=No
- Then I set UFW like this:

Code: Select all

#Whitelist Local Area Network
sudo ufw allow in to 192.168.1.0/24
sudo ufw allow out to 192.168.1.0/24

#Block All Incoming and Outgoing Traffic by Default
sudo ufw default deny outgoing
sudo ufw default deny incoming

#Whitelist VPN Port for VPN Establishment
sudo ufw allow out to any port 1194 proto udp

#Whitelist VPN Tunnel
sudo ufw allow out on tun0 from any to any
sudo ufw allow in on tun0 from any to any
So the kill switch is enabled. Now I want to open ports that are forwarded from the router. For instance, ssh i open 22 on router to server 22. And wrote the rule "sudo ufw allow 22/tcp". Still it didnt work and tried "sudo allow in on enp0s25" among others.
Also, plex ports are not working. Take a look at my UFW screen shot:

Code: Select all

Status: active
Logging: on (low)
Default: deny (incoming), deny (outgoing), deny (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
Anywhere on enp0s25        ALLOW IN    Anywhere                  
22/tcp on enp0s25          ALLOW IN    Anywhere                  
22/tcp                     ALLOW IN    Anywhere                  
192.168.1.0/24             ALLOW IN    Anywhere                  
Anywhere on tun0           ALLOW IN    Anywhere                  
181/tcp                    ALLOW IN    Anywhere                  
32400/tcp (plexmediaserver-all) ALLOW IN    Anywhere                  
3005/tcp (plexmediaserver-all) ALLOW IN    Anywhere                  
5353/udp (plexmediaserver-all) ALLOW IN    Anywhere                  
8324/tcp (plexmediaserver-all) ALLOW IN    Anywhere                  
32410:32414/udp (plexmediaserver-all) ALLOW IN    Anywhere                  
1900/udp (plexmediaserver-all) ALLOW IN    Anywhere                  
32469/tcp (plexmediaserver-all) ALLOW IN    Anywhere                  

192.168.1.0/24             ALLOW OUT   Anywhere                  
1194/udp                   ALLOW OUT   Anywhere                  
Anywhere                   ALLOW OUT   Anywhere on tun0          
181/tcp                    ALLOW OUT   Anywhere   
Any suggestions? Thank you!

Post Reply