- Enhanced security by isolating internal hosts from malicious internet scripts and programs.
- Centralized monitoring and protection since only the proxy server needs to be secured.
- Improved performance through caching of frequently accessed content, thereby reducing overall traffic.
• The other serves as the internal web server.
Step 1: Restrict Access to the Web Server Using iptables
Start by SSH-ing into the web server to configure iptables as your primary firewall.-
Verify iptables Installation
Connect to the web server and check if iptables is installed:
-
Install iptables if Missing
If the command shows that iptables is not installed, update your package list and install it:
-
Restrict Traffic from Node 2
Determine Node 2’s IP address using nslookup:
Assume the output indicates Node 2’s IP is 192.147.220.6. Add a rule to drop all incoming traffic from this node:
This rule prevents Node 2 from accessing the web server directly, ensuring that all traffic must route through the proxy server.
Step 2: Install and Configure the Squid Proxy Server
To regulate access further, we will install the Squid proxy server. This section explains how to install and configure Squid on the proxy server.-
SSH into the Proxy Server
Open another terminal window and connect to the proxy server:
- Install Squid Proxy Install Squid. The installation process may vary by distribution; in our lab, the installation output confirms that Squid and its dependencies were successfully installed. Verify by checking the service status during installation.
-
Configure Squid
Open the Squid configuration file using your preferred text editor:
Within this file, locate the sections for Access Control Lists (ACLs) and access rules. Below is an example excerpt illustrating the recommended settings:
-
Insert Custom Rules
Scroll down to where you can add your own rules. To manage access from your clients, add the following ACLs and access rules. Assume Node 2’s IP is 192.147.220.6 and the internal web server’s IP is 192.147.220.3:
These configuration rules ensure that general internal traffic is permitted while access from Node 2 to the web server is only allowed through the proxy server.
-
Restart Squid Service
After saving your changes, restart the Squid service to apply the new configuration:
Confirm that the Squid service has restarted successfully.
Now it’s your turn to practice configuring a web proxy through hands-on labs. This lesson demonstrated how to secure an internal web server using iptables and how to manage client access via a Squid proxy server, enhancing both your security and network performance. For more detailed information, explore these useful resources: