Skip to content

Fixed host↔guest host‑only networking between a Kali host (vboxnet0) and a Metasploitable2 guest (eth1) by either enabling host DHCP or assigning a persistent static IP on the guest. Includes quick commands for snapshotting, enabling DHCP on the host, static guest configuration,

Notifications You must be signed in to change notification settings

blackXmask/Metasploitable2-eth0-eth1-fix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Bold Black Mask Logo Design

Metasploitable2 — eth0 & eth1 host‑only networking fixes

Short summary: Fixed host↔guest host‑only networking between a Kali host (vboxnet0) and a Metasploitable2 guest (eth1) by either enabling host DHCP or assigning a persistent static IP on the guest. Includes quick commands for snapshotting, enabling DHCP on the host, static guest configuration, and safe recon commands.


Problem

Metasploitable2 had a second VirtualBox host‑only NIC present (eth1) but no IPv4 address, so the Kali host could not reach it. Common causes: no host-only DHCP server, guest interface not brought up, or temporary static assignment only.


Quick fixes (one-liners)

Take a snapshot (recommended before changes):

VBoxManage snapshot "Meta2" take "host-only-up" --description "Host-only and static IP 192.168.56.101"

Try DHCP from inside guest:

sudo ip link set eth1 up
sudo dhclient -v eth1
ip addr show eth1

Assign a one-off static IP (guest):

sudo ip addr add 192.168.56.101/24 dev eth1
sudo ip link set eth1 up
ip addr show eth1
# From host:
ip addr show vboxnet0
ping -c 4 192.168.56.101

Enable host-only DHCP on the Kali host (host-side):

sudo VBoxManage dhcpserver add \
  --netname HostInterfaceNetworking-vboxnet0 \
  --ip 192.168.56.2 --netmask 255.255.255.0 \
  --lowerip 192.168.56.100 --upperip 192.168.56.200

Then on the guest:

sudo dhclient -v eth1

Make the static assignment persistent (Debian-style guest)

Create /etc/network/interfaces.d/eth1.cfg on the guest:

auto eth1
iface eth1 inet static
    address 192.168.56.101
    netmask 255.255.255.0

Then:

sudo ifdown eth1 2>/dev/null || true
sudo ifup eth1
# or reboot if ifup/ifdown not available:
sudo reboot

Safe red‑team starter checklist (lab only)

  1. Snapshot before destructive testing.
  2. Service scan from host:
nmap -Pn -sV -oN metasploitable-scan.txt 192.168.56.101
  1. Enumerate common services: ssh, ftp, telnet, rpcbind, mysql, vsftpd, etc.
  2. From the guest, confirm firewall state:
sudo iptables -L -n

Gotchas & notes

  • Run VBoxManage as the same user that owns the VM — using sudo can cause it to look in another user’s registry.
  • If the VM is in Saved state, discard the saved state before changing adapter settings:
VBoxManage discardstate "Meta2"
  • Keep Metasploitable isolated — it’s intentionally vulnerable. Use host‑only + NAT; do not expose to the public internet.

Files in this repo

  • fix.md — this file
  • scripts/enable-host-dhcp.sh — host-side DHCP helper (optional)
  • configs/eth1.cfg — example persistent guest network file for Debian-based guests
  • nmap-examples.txt — useful nmap command collection

Example: create repo & push (local)

mkdir meta2-host-only && cd meta2-host-only
# place fix.md, scripts/enable-host-dhcp.sh, configs/eth1.cfg, nmap-examples.txt into the directory
git init
git add .
git commit -m "Initial: Meta2 host-only networking guide"
# create repo on GitHub, then:
git remote add origin git@github.com:YOURUSER/meta2-host-only.git
git branch -M main
git push -u origin main

License

MIT


Short changelog

  • 2025-10-17 — Initial guide & commands.

About

Fixed host↔guest host‑only networking between a Kali host (vboxnet0) and a Metasploitable2 guest (eth1) by either enabling host DHCP or assigning a persistent static IP on the guest. Includes quick commands for snapshotting, enabling DHCP on the host, static guest configuration,

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published