Score:0

ufw not blocking openvpn connection

cr flag

I have a private server that runs Ubuntu 20.04. I have installed ufw and I suppose I get the basics.

Last week I have installed a wireguard server. I was able to block the connections to wireguard port from ufw. Now I have installed OpenVPN with this installer https://github.com/angristan/openvpn-install.

The script is pretty basic, I was able to create clients and connect to VPN from my mobile phone. But the weird thing is I can't deny or reject on the OpenVPN port.

Previously on other services (e.g. mongo, MySQL...) I needed to add specific rules to access the ports. But this one I was able to connect directly and there is no new rules on ufw. Also even though I added new rules to deny/reject on default port and my custom port, I still can access it.

I feel like I am missing something that can cause a vulnerability on the system.

ar flag
Maybe you added rules for TCP, but you use UDP for the VPN? (`proto udp` in your .ovpn file). Or give more info about your setup (`iptables-save`, `ip a`, ...)
mchid avatar
bo flag
What port are you using for openvpn? Openvpn can use basically any port you set it to. A common method of circumventing the firewall is to use port 443 or port 80 as these are already open.
Anıl avatar
cr flag
I am using port 62000 for my OpenVPN setup. I have added deny rules for both 1194 and 62000 ports on both protocols; tcp and udp. I am currently back to wireguard since it became too complicated for me to solve it in the short term. I am guessing it won't be as simple as adding a new rule to ufw, I started checking iptables but I am a novice on these topics so it is on hold for me. As a first step; I want to be able to block (also know which port so I can monitor the traffic too) the openvpn
ofirule avatar
th flag
please provide output of `netstat -nlput`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.