doni49 wrote:Also.....
Related question: I'm in the process of adding a web server but it's only for my use. How can I setup an iptables rule to allow port 80 but ONLY from within my internal network (10.2.1.0/24) or my VPN network (10.8.0.0/24).
If you are using Apache2 webserver, you can set allow/deny permissions for your web site in the config files.
I run Apache on an ancient laptop that is connected to the internet. It has several small websites on. One of them is visible to external users, the rest are for internal only.
I enforce the latter with a file called /etc/apache2/conf.d/local.conf which contains
Code: Select all
# Default site permissions
<Files *>
Order deny,allow
Deny from all
Allow from 192.168.42.0/24
</Files>
Then for the site that is visible to external users I have a file in /etc/apache2/sites-available/sitename which includes
Code: Select all
<Files *>
Order Allow,Deny
Allow from all
</Files>
This file is linked /etc/apache/sites-enabled with the "a2ensite sitename" command. It has worked happily like this for years. The log files do show a few attempts a day to access the ip address with random urls, but they all get rejected.