Champlain College Classes
HomeTech JournalsPersonal ProjectsSysadmin Wiki
SEC-440: Systems Security
SEC-440: Systems Security
  • SEC-440: Systems Security
  • Breakdown
    • Course Overview
  • Labs
    • Project 1 - Network Redundancy
    • Project 2 - Web and Proxy Redundancy
    • Project 3 - Web Application and Database Redundancy
    • Project 4 - AWS
    • Project 5 - Wireguard with AWS
    • Project 6 - Federated Identity
    • Project 7 - Windows Admin Center
    • Project 8 - Kerberos - Deep Dive
  • Notes
    • Page 2
Powered by GitBook
On this page
  • Plan of Attack
  • OPT Setup
  • HA01 & HA02
  • Set Hostname and Add Paul user
  • VYOS01 and 02 OPT Setup
  • WEB02 Setup
  • Setup httpd
  • Change Firewall Rules
  • Setup HAproxy
  • Setup Keepalived
  • Change VYOS Rules:
  1. Labs

Project 2 - Web and Proxy Redundancy

PreviousProject 1 - Network RedundancyNextProject 3 - Web Application and Database Redundancy

Last updated 1 year ago

Plan of Attack

  1. OPT Network set

    • 10.0.6 Going

    • NAT, DNS

    • VRRP

  2. Web02 Setup

    • Httpd

    • All other config stuff

    • Create web pages for web01 and web02

  3. HAproxy

    • To load balance web01 and web02

    • Use curl

  4. Keepalived for HAproxy

  5. Update nat for web server

OPT Setup

HA01 & HA02

Setup Networking HA01: 6.11 and HA02: 6.12

sudo nano /etc/netplan/00-installer-config.yaml

To apply netplan:

sudo netplan try

Set Hostname and Add Paul user

sudo hostnamectl set-hostname ha0X-paul
sudo passwd champuser
sudo adduser paul
sudo usermod -aG sudo paul

VYOS01 and 02 OPT Setup

Setup NAT for OPT to WAN

set nat source rule 20 description 'NAT FROM OPT to WAN'
set nat source rule 20 outband-interface eth0
set nat source rule 20 source address 10.0.6.0/24
set nat source rule 20 translation address masquerade

Setup DNS for OPT to WAN

set service dns forwarding allow-from 10.0.6.0/24
set service dns forwarding listen-address 10.0.6.1

WEB02 Setup

change root passwd and make paul user

Set ip using nmtui

Setup httpd

sudo yum install httpd
nano /var/www/html/index.html

Change Firewall Rules

Setup HAproxy

Install HAproxy

sudo apt install haproxy

Changed environment variable

nano /etc/default/haproxy

Add the following line

ENABLED=1

Edit the /etc/haproxy/haproxy.cfg

Now do

sudo systemctl restart haproxy

Setup Keepalived

HA01 Config

HA02 Config

Change VYOS Rules:

Delete old nat rule

delete nat destination rule 20

Add new nat rule

set nat destination rule 20 destination address 10.0.17.106
set nat destination rule 20 destination port 80
set nat destination rule 20 inbound-interface eth0
set nat destination rule 20 protocol tcp
set nat destination rule 20 translation address 10.0.6.10
set nat destination rule 20 translation port 80
set nat destination rule 20 description HTTP->HAVRRP

Guide:

https://www.digitalocean.com/community/tutorials/how-to-use-haproxy-to-set-up-http-load-balancing-on-an-ubuntu-vps
https://www.haproxy.com/blog/haproxy-configuration-basics-load-balance-your-servers
https://tecadmin.net/setup-ip-failover-on-ubuntu-with-keepalived/
https://www.questioncomputer.com/how-to-install-and-lab-keepalived-on-ubuntu-20-04-and-rocky-linux-8-5/