DDoS attacks OpenVPN on Pfsense

  • I get DDoS attacks OpenVPN server on Pfsense. How can I stop it?
    I have Snort installed but it doesn't look it will block DDoS on OpenVPN connection
    Now, I created an Aliases to allow IPs to access OpenVPN for temp block the DDoS.

    I don't like this idea because it limits people to use OpenVPN on different devices and a lot of administration.

    Any suggestion?

  • Denial of service attacks can only be blocked/mitigated upstream, so talk to your ISP.

  • Talk to my ISP and they said don't use OpenVPN and it will solve the problem. FUNNY!!

  • When you say DDoS attacks, do you mean sustained, targeted, high-volume connection attempts that are causing tangible problems? Because it's normal to get unsolicited connection attempts any time you run a server on the open Internet, certainly on the order of hundreds or possibly thousands per day. As long as you have your OpenVPN server configured correctly, that's nothing to worry about really. But if these are true DDoS attacks targeting you specifically, of course that's another matter.

  • Yes, high-volume connection attempts that are causing tangible problems. We limited 10 OpenVPN connections for OpenVPN and all connections are used by "UNDEF" and I disconnected them and then reconnect again. After all 10 connections are been used. Our users cannot sign in at all. I can see the IP but I have no idea how to block it.

    I have two sites get the same problem.

  • Are your users working from known addresses? If so, perhaps you could set up rules that would allow them, but not from other addresses. Is there any pattern to where the attacks are coming from? That might also give you something to filter on. Is IPv6 available for the users and server? If so, that might be another way to filter, assuming the attacks are coming in on IPv4. It's much harder to find a target on IPv6, due to the huge number of addresses available.

  • Rebel Alliance Global Moderator

    @leungda said in DDoS attacks OpenVPN on Pfsense:

    I can see the IP but I have no idea how to block it.

    So its just 1 IP? 10, 100, 10,000 different IPs? If you don't want specific IPs to be able to attempt a connection to your openvpn server port. This can be blocked by a simple rule above the wan rule that allows access to your openvpn port.

    You can use whole network blocks if coming from large number of IPs in a whole block.. You could use pfblocker to easy assign blocks to whole ranges of IPs used from a specific country, etc.

    Can you post some example of IPs that you would like to block.. Them filling up your number of openvpn connections you allow for is a quite different than a volumetric attack filling up your pipe..

    You sure its not just a configured client of yours trying to connect and failing, so it just continues to try and try and try?

  • It is an IPv4 address and yes, it is what I am doing is limited all known IPs to access OpenVPN.

    I will try to unblock the IP. After I see the IP address, I will post a screenshot.

  • Are you using a static tls key?
    Quoting from pfsense configuration screen

    A TLS key enhances security of an OpenVPN connection by requiring both parties >to have a common key before a peer can perform a TLS handshake. This layer of HMAC authentication allows control channel packets without the proper key to be dropped, protecting the peers from attack or unauthorized connections.The TLS Key does not have any effect on tunnel data.

    Puts much less strain on the box and you don't have to administer ip's anymore
    Just an idea.

  • I don't understand. I've been running OpenVPN for years now, and I've never had any ghost connections tying everything up. I'm being scanned and probed just as much as everyone else. Nothing ever connects to it except for valid users. Does this happen to anyone else? In all my years here, I've never heard of a similar complaint. Is this actually a real problem?

  • Rebel Alliance Global Moderator

    I have never see bogus hits on openvpn tie up a connection no..

  • @kom

    I can say you are lucky

  • Netgate

    @netblues said in DDoS attacks OpenVPN on Pfsense:

    Are you using a static tls key?

    Are you using a static TLS key? How is your server configured?

  • @kom said in DDoS attacks OpenVPN on Pfsense:

    Does this happen to anyone else?

    Having a static IPv4 your years now, but never saw something like that.
    TLS Keys : of course, I use these.

  • two different sites got attacked. They are different client and network. They got attacked with the same IP address.

    How can i extract OpenVPN log from pfsense

  • Galactic Empire


    Whats the IP address, it's not comming from shodan or shadowserver is it ?

    I get these almost every day poking my IPsec VPN, create a blacklist in snort if it is.

    shodan:-		# census1.shodan.io		# census2.shodan.io	# census3.shodan.io	# census4.shodan.io		# census5.shodan.io		# census6.shodan.io		# census7.shodan.io		# census8.shodan.io		# census9.shodan.io		# census10.shodan.io		# census11.shodan.io		# census12.shodan.io		# atlantic.census.shodan.io		# pacific.census.shodan.io			# rim.census.shodan.io		# pirate.census.shodan.io		# inspire.census.shodan.io		# ninja.census.shodan.io		# border.census.shodan.io		# burger.census.shodan.io		# atlantic.dns.shodan.io		# blog.shodan.io		# hello.data.shodan.io		# www.shodan.io		# ny.private.shodan.io		# atlantic249.serverprofi24.com		# sky.census.shodan.io		# dojo.census.shodan.io		# ubtuntu16146130.aspadmin.com		# shodan.io		# malware-hunter.census.shodan.io		# battery.census.shodan.io		# house.census.shodan.io		# goldfish.census.shodan.io		# battery.census.shodan.io		# mason.census.shodan.io		# flower.census.shodan.io		# cloud.census.shodan.io		# turtle.census.shodan.io

  • Could you tell me how to create a blacklist in snort?

  • Galactic Empire

    Create the blacklist file:-


    Apply it to the interface:-

    0_1536609743860_Untitled 2.jpeg

    You then should see (spp_reputation) packets blacklisted in the blocked list:-

    0_1536609872518_Untitled 3.jpeg

  • Love it. Thanks for your help

  • @netblues said in DDoS attacks OpenVPN on Pfsense:

    Are you using a static tls key?

    You have been asked this twice now. It's hard to help you when you don't answer questions.

  • Rebel Alliance Global Moderator

    You have ZERO need of snort to stop traffic from hitting your wan IP on your openvpn port - ZERO!!!

    Im with kom - you going to answer the simple TLS key question??

  • I checked. I didn't use TLS key on OpenVPN setting. Might be you can help me to set this up for extra layer.

    My OpenVPN set up look like this

    SSL/TLS + user auth -> DUO -> AD for people to sign in. I am not using local database for user auth

    Do you sugguest any online guide that I can read of TLS?

  • I think you just have to check the Use a TLS key box and then generate new user config that has the TLS key embedded in the .ovpn file, for instance.

  • The guide on openvpn hardening has lots of info
    tls key is described in section Use of --tls-auth
    As for pfsense, its rather straight forward to implement what it suggests.
    It also means that you need to send the tls.key to all your clients somehow.
    Now if you are running clients by the thousands, this is definitely an issue on its own.
    Imagine this as an initial passphrase. If the client connecting knows it, thserver will deal with him further, spending computing resources to do all the needed security handshakes
    Obviously it won;t help if you are experiencing a network level attack, ie ping flood saturating your line.

  • I got the TLS in place at one site. I will keep my eyes on it for the next few days. Also, set up a blocklist on Snort is also a good idea.

    This guide is quite useful too. Thanks