INTLab 4 - 072221
INTLab 4 - 072221
Objective:
In this lab, students will simulate network routing and VLAN configuration using Linux-based
tools. They will use the OWASP Broken Web Application VM's IP address to test connectivity and
routing principles.
Learning Outcomes:
By the end of this lab, students will:
• Understand how to set up routing and VLANs on Linux.
• Be able to simulate network device behavior using Linux tools.
• Gain hands-on experience in network troubleshooting.
• Learn how to configure iptables, ip route, and network namespaces to manage
traffic.
Materials Needed:
• Linux machine or VM (e.g., Ubuntu, Kali).
• OWASP Broken Web Application VM (reachable on the network).
• IP address of the OWASP Broken Web Application VM (e.g., 192.168.X.X).
• Terminal access.
Lab Exercises:
Submission Requirements:
• Submit a report including:
• Screenshots of the static routing, namespace creation, and iptables
configurations.
• A brief explanation of each step and the results from ping, traceroute, and
tcpdump commands.
• Troubleshooting steps for any encountered issues.
Reflection:
This lab demonstrates how Linux-based tools can effectively simulate routing and VLAN behavior.
Students gain critical insights into routing, network segmentation, and traffic control without
needing physical network hardware.
Exercise 1: Setting Up Static Routing in Linux
What is Static Routing?
• Routing is the process of directing network traffic from one device to another. Static routing
is when a network administrator manually configures the paths (routes) that data should take
across the network.
• By setting up static routes, you are telling the Linux machine where to send traffic destined
for specific networks. For example, if a machine wants to reach an IP address that is outside
its local network, static routing tells it where to send the data so it can reach the destination.
Verification:
• Use ip route show to see the routing table and confirm that your route is added.
• Ping: You then ping the OWASP VM to check if your traffic can successfully reach the
destination.
Challenges:
• If you incorrectly set the destination network or gateway, the data will not reach its
destination.
• If you forget to add a route to a new network, the system might not know how to reach it.
Challenges:
• Subnetting can be confusing if you're not familiar with how the bits in the subnet mask
work.
• If you misconfigure IP addresses or routes, devices might not be able to communicate across
subnets.
Exercise 4: Testing Connectivity Using Ping and Traceroute
What is Ping?
• ping is a simple command used to check if a device on the network is reachable. It sends a
small packet of data and waits for a response. If the response comes back, the destination is
reachable.
What is Traceroute?
• traceroute is a tool that shows you the path that data takes from your machine to the
destination. It reveals each "hop" (router or network device) the data goes through to reach
its destination, helping you understand where delays or failures may occur.
Common Mistakes:
• Misconfigured rules might block essential traffic, causing communication failures.
• Overly broad or vague rules can accidentally open up security vulnerabilities by allowing
unwanted traffic.
Exercise 6: Monitoring Traffic Using tcpdump
What is tcpdump?
• tcpdump is a command-line tool that allows you to capture and analyze network traffic. It
lets you "see" what's happening on the network by showing you packets of data that are
being sent and received.
---
#### **Objective:** Set up static routing on a Linux machine to simulate routing behavior
and ensure the machine can reach the OWASP Broken Web Application VM.
---
#### **Steps:**
#### **Challenges:**
- Misconfigured routes or gateways can cause the Linux machine to fail to reach the
destination network.
- If there are multiple paths to the destination, it could cause routing issues.
---
#### **Objective:** Create network namespaces to simulate VLANs (Virtual Local Area
Networks), assign the OWASP VM to a separate namespace, and test connectivity.
---
#### **Steps:**
---
---
---
#### **Steps:**
- **What it means:** Subnetting divides a large network into smaller chunks, helping
manage IP addresses more efficiently.
---
#### **Objective:** Test connectivity between the Linux machine, namespaces, and the
OWASP VM using `ping` and `traceroute`.
---
#### **Steps:**
2. **Run Traceroute:**
- Command:
```bash
traceroute <OWASP_IP>
```
- **What it means:** This will show you the path that packets take from your machine to
the OWASP VM, including each router or network device the data passes through.
---
---
#### **Objective:** Use `iptables` to simulate routing and control the flow of traffic between
networks.
---
#### **Steps:**
1. **Enable IP Forwarding:**
- Command:
```bash
echo 1 > /proc/sys/net/ipv4/ip_forward
```
- **What it means:** This enables IP forwarding, allowing the Linux machine to route
traffic between networks.
means:**
- The first rule allows traffic from `vlan1` (`192.168.10.0/24`) to `vlan2` (`192.168.20.0/24`).
- The second rule blocks traffic from `vlan1` to the OWASP VM's IP.
---
---
---
#### **Steps:**
1. **Capture Traffic:**
- Command:
```bash
sudo tcpdump -i eth0
```
- **What it means:** This command captures all traffic on interface `eth0` and displays it.
You can use filters to narrow down the captured traffic (e.g., for a specific IP address or port).
---
---
### **Summary:**
- Each step introduces key concepts of networking in Linux, from routing to VLANs,
subnetting, and security using firewalls. By following these exercises, you will gain practical
experience with real-world networking scenarios.