Networking is where most home labs go wrong. Pick the wrong mode and your deliberately vulnerable VM is suddenly visible to everyone on your Wi-Fi, or your scans hit real devices in your house. In this lesson you'll learn what each VirtualBox mode does and build LabNet, the private network every machine in this path will use.
The five modes in plain English
NAT (the default). Each VM gets its own private virtual router, with the IP 10.0.2.15. The VM can reach the internet, but nothing can reach it, not even other VMs. Perfect for downloading updates.
NAT Network. One shared virtual router for several VMs. They can reach the internet and each other. Useful, but your vulnerable machines would then have internet access.
Bridged. The VM plugs straight into your real network, like another laptop on your Wi-Fi. It gets an IP from your home router, and every device on that network can reach it. Never use it for vulnerable VMs.
Host-only. A private network between your PC and your VMs, with no internet. VirtualBox's default host-only network is 192.168.56.0/24, and your PC is 192.168.56.1 on it. This is our LabNet.
Internal network. VMs only. Even your PC can't see it. Use it later for malware analysis, when you want a fully air-gapped network.
Our design: two adapters per VM
Every VM gets up to eight network adapters. We use two:
- Adapter 1: NAT, for internet and updates. Turn it off when you don't need it.
- Adapter 2: Host-only (LabNet), where all the attacking and defending happens.
| VM | Adapter 1 | Adapter 2 | LabNet IP |
|---|---|---|---|
| Kali / Parrot (attackers) | NAT | Host-only | DHCP |
| Ubuntu Server | NAT | Host-only | 192.168.56.20 (static) |
| Windows 11 (WS01) | NAT | Host-only | 192.168.56.30 (static) |
| Windows Server (DC01) | NAT, only until activated | Host-only | 192.168.56.10 (static) |
| Metasploitable 2 | Host-only only | none | DHCP |
Build LabNet
- In VirtualBox, open File → Tools → Network Manager.
- On the Host-only Networks tab, check whether one already exists. On Windows it's called VirtualBox Host-Only Ethernet Adapter; on Linux and macOS it's vboxnet0. If not, click Create.
- Adapter tab: choose Configure Adapter Manually, set IPv4 Address 192.168.56.1 and Network Mask 255.255.255.0.
- DHCP Server tab: tick Enable Server. Set Server Address 192.168.56.100, Lower Bound 192.168.56.101, Upper Bound 192.168.56.254.
- Click Apply.
On a Linux or macOS host you can do the same from the terminal:
VBoxManage hostonlyif create
VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.56.1 --netmask 255.255.255.0
VBoxManage dhcpserver add --network=HostInterfaceNetworking-vboxnet0 \
--server-ip=192.168.56.100 --netmask=255.255.255.0 \
--lower-ip=192.168.56.101 --upper-ip=192.168.56.254 --enable
On Linux hosts, VirtualBox only allows host-only addresses inside 192.168.56.0/21 unless you list other ranges in
/etc/vbox/networks.conf. Stick with 192.168.56.x and you'll never hit this.
The LabNet address plan
Static IPs below .100 and DHCP above it means addresses never clash:
| Address | Who |
|---|---|
| 192.168.56.1 | Your PC (the host) |
| 192.168.56.10 | DC01, Windows Server domain controller |
| 192.168.56.20 | Ubuntu Server |
| 192.168.56.30 | WS01, Windows 11 client |
| 192.168.56.100 | VirtualBox DHCP server |
| 192.168.56.101–254 | DHCP pool: Kali, Parrot, Metasploitable |
Copy this table into your lab notebook. You'll use it in every lesson that follows.
Attaching a VM to LabNet
For any VM: Settings → Network.
- Adapter 1: Enable Network Adapter ✔, Attached to NAT.
- Adapter 2: Enable Network Adapter ✔, Attached to Host-only Adapter, Name: your LabNet adapter.
- Under Advanced on Adapter 2, set Promiscuous Mode to Allow VMs on your attacker. This lets Wireshark on Kali see traffic between other VMs, which you'll want for sniffing and ARP-spoofing labs.
Tip: the Cable Connected checkbox under Advanced works like unplugging a real cable. It's the quickest way to cut a VM off the internet without changing anything else.
Check it works
On your PC, run ipconfig (Windows) or ip a (Linux/macOS) and look for 192.168.56.1. Once Kali is installed in the next lesson:
ip -br a # eth0 = 10.0.2.15 (NAT), eth1 = 192.168.56.1xx (LabNet)
ping -c 3 192.168.56.1
If pings from a VM to a Windows host get no reply, that's the Windows Firewall blocking incoming ping. The network is fine.
Safety check
Before powering on any VM, ask: does this machine have a Bridged adapter? For anything vulnerable, the answer must always be no.