Firewall and Load Balancing
Firewall and Load Balancing
To set up a Debian 10 server as outlined in the image, you will need to follow several steps to
configure iptables for logging, set up HAProxy for load balancing, and create firewall rules on
EDGE1 and EDGE2. Here is a step-by-step guide:
Certainly! Let's change the name of the private key from your_private.key to
ssl_https_private.key and adjust the steps accordingly.
2. Create a CSR:
This command will create a certificate valid for 365 days. You can adjust the number of days as
needed.
cat /etc/ssl/private/ssl_https_private.key
/etc/ssl/private/ssl_https_certificate.crt >
/etc/ssl/private/ssl_https_combined.pem
frontend https_front
bind *:443 ssl crt /etc/ssl/private/ssl_https_combined.pem
default_backend https_back
backend https_back
balance roundrobin
server mon1 MON1_IP:443 check ssl verify none
server mon2 MON2_IP:443 check ssl verify none
Replace MON1_IP and MON2_IP with the actual IP addresses of your MON1 and MON2
servers.
3. Get the required certificate:
ssh user@edge1_ip
ssh user@edge2_ip
2. Block traffic to SERVICE1 and SERVICE2 via HTTP and HTTPS ports:
Replace SERVICE1_IP and SERVICE2_IP with the actual IP addresses of your SERVICE1
and SERVICE2 servers.
3. Save the iptables rules:
sudo iptables-save > /etc/iptables/rules.v4
Conclusion
This guide provides a basic setup for configuring a Debian 10 server with iptables logging,
HAProxy load balancing, and firewall rules. Adjust IP addresses, file paths, and specific
configurations as necessary for your environment.p