Lab 1
Lab 1
Lab 1
Prerequisites
Uncomment the line net.ipv4.ip_forward=1 , then save and close the file. Activate it immediately by running:
sudo sysctl -p
Configure NAT: Use iptables to enable NAT for forwarding traffic from the inet2 (host-only) network to
the internet:
Replace enp0s3 with the NAT interface and enp0s8 with the host-only interface. Save the rules: sudo sh -c
"iptables-save > /etc/iptables/rules.v4"
1. Create a second VM for VM1 (Ubuntu Desktop) by selecting Create New Virtual Machine in VMware.
2. Network Adapter: Ensure VM1 has only one network adapter, set to Host-only (VMNet1) .
3. Install Ubuntu using the provided ISO image.
4. Assign Static IP to VM1:
Edit the network configuration file: sudo nano /etc/netplan/00-installer-config.yaml
Configure it to have a static IP:
network:
ethernets:
ens33:
addresses: [10.1.1.10/24]
gateway4: 10.1.1.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
version: 2
Save the file and apply the changes: sudo netplan apply
1. Ping from VM1 to the Gateway: On VM1, test the connection to the gateway with the following
command:
2. Test Internet Access from VM1: On VM1, ping a public IP like Google's DNS:
Exercise
Objective: Ensure that the VM1 Apache server is accessible from the public internet via the Gateway VM.
1. Configure all components as described.
2. Install apache2 web server
3. Test and document the following:
Connectivity between VM1 and Gateway.
Internet access from VM1.
Apache server running on VM1 and accessible locally.
Public access to the Apache server via the Gateway's IP.
4. Extra Task: Secure the Apache server using basic firewall rules (use ufw to allow port 80 and deny
other ports).