Routing Challenge & Resolution

Overview

During the deployment phase of my project Distributed Pentesting Lab Setup, I encountered a critical networking issue while attempting to establish communication between the attacker machine (Kali Linux) and the target machine (Metasploitable2).

The lab architecture required traffic to traverse multiple layers:

Kali (192.168.1.0/24) → Target Host Machine → VMnet1 (192.168.56.0/24) → Target (Metasploitable2 Juice Shop)

Network Flow

Kali (Attacker)
│ 192.168.1.10
│
▼
Target Host Machine (Pivot)
│ 192.168.1.20 (LAN)
│ 192.168.56.1 (VMnet1)
▼
Internal Lab Network (192.168.56.0/24)
│
├── Metasploitable2 (192.168.56.10)
├── OWASP Juice Shop (192.168.56.20)
└── Windows Target (Optional)

Important Notes:

  1. The attacker machine and the target host machine are two separate computers connected to the same LAN.
  2. The target host machine has a Type 2 hypervisor installed which is hosting the target machine (Metasploitable2) on a host-only network (VMnet1)

Issue Encountered

Despite correctly configuring static IP addressing on the target machine and verifying connectivity between the VMware host and Metasploitable2, Kali was unable to reach the target.

Configuring static IP

assigning-static-ip.png

Successful ping between the VMware host and Metasploitable2

metasploitable2-reachable-from-host.png

Attempts to add a route using the VMnet1 gateway (192.168.56.1) failed with:

“Error: Nexthop has invalid gateway”

Switching the route to use the target host machine LAN IP (192.168.1.20) succeeded syntactically (because I could ping the target host machine at 192.168.1.20), but connectivity to the machines hosted in VMware on the VMnet1 host-only network still failed.