Sample Header Ad - 728x90

UFW: Allow traffic only from a domain with dynamic IP address

59 votes
9 answers
105018 views
I run a VPS which I would like to secure using UFW, allowing connections only to port 80. However, in order to be able to administer it remotely, I need to keep port 22 open and make it reachable from home. I know that UFW can be configured to allow connections to a port only from specific IP address: ufw allow proto tcp from 123.123.123.123 to any port 22 But my IP address is dynamic, so this is not yet the solution. The question is: I have dynamic DNS resolution with DynDNS, so is it possible to create a Rule using the domain instead of the IP? I already tried this: ufw allow proto tcp from mydomain.dyndns.org to any port 22 but I got ERROR: Bad source address
Asked by Carles Sala (1015 rep)
Sep 20, 2013, 09:20 PM
Last activity: Jun 8, 2022, 10:17 PM