Active Directory Lab: Install the Linux Router

Overview

This is the sixth post in a multi-part series that illustrates how to customize the Windows installer media to automate the process of installing a Windows AD domain controller, a Windows file server, and a Windows desktop environment. This article details the process for installing the Linux router that provides simple Network Address Translation (“NAT”) and firewall capabilities.

Install the Linux Router

  1. In Hyper-V Manager, select AD Lab 01 router.contoso.com and edit settings.
  2. Click Add Hardware, select Network Adapter, click Add, and set Virtual switch to AD Lab Private.
  3. Start the virtual machine and perform a minimal installation of AlmaLinux 9.5:
    1. Set the time zone to GMT.
    2. Set the root user password to ADL@b$ecurePassw0rd
  4. Wait for the installation to complete, then log in as root.
  5. Run nmtui to configure and activate the eth1 network adapter:
    IP Address: 172.16.1.1
    Subnet Mask: 255.255.255.0
  6. Run the following commands to configure NAT:

    echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
    rm -rf /etc/firewalld/zones
    firewall-cmd --zone=public --set-target=ACCEPT --permanent
    firewall-cmd --complete-reload firewall-cmd --zone=public --add-forward
    firewall-cmd --zone=public --add-rich-rule='rule family=ipv4 source address=172.16.1.0/24 masquerade'
    firewall-cmd --runtime-to-permanent
  7. Run the following commands to apply all updates and enable automagic updates:

    dnf -y update
    dnf -y install dnf-automatic
    systemctl enable --now dnf-automatic.timer
  8. Shut down.

Export the VM

Export the VM to your Downloads directory.

Relevant Links


Install the Linux Router