Whitelist IP's from cms to iptables or any firewall

May 17, 2016 491 views
Firewall CMS Ubuntu

I have members that only should have access to a server and i want to auth by IP.
So i need to write from a webinterface to my firewall /iptables.

Is there an easy way to write to the firewall?
(Running ubuntu)

  • Thanks
1 Answer

Hi @gr44bli,

There are a few options for you to be able to do what you're asking. The first option is of course as you've listed, to use an iptables configuration to limit who can connect to your server on port 80. Here're two tutorials we have on the subject:

An alternative would be to setup permissions within your apache configuration using a .htaccess file. You can see how to do this in one of our other tutorials:

Let us know how it goes, and if you have any further questions!

by Etel Sverdlov
This tutorial covers five common uses for the .htaccess file. These include: Mod_Rewrite, Authentication, Custom Error Pages, Mime Types, and Server Side Includes.
Have another answer? Share your knowledge.