SETUP WITH ETHERNET SWITCH
Step 1: Create Virtual Switches in Hyper-V
-
Open Hyper-V Manager → Virtual Switch Manager.
-
Create an Internal Switch:
- Type: Internal
- Name:
Lab_Internal - Click OK.
-
Create an External Switch:
- Type: External
- Bind to your physical NIC (Ethernet/Wi-Fi)
- Name:
External_Internet - Click OK.
Step 2: Add Network Adapters to VMs
For both Kali Linux and Windows Server:
- Open VM → Settings → Add Network Adapter (if needed).
- Connect Adapter 1 →
Lab_Internal(Internal switch). - Connect Adapter 2 →
External_Internet(External switch for internet). - Click Apply → OK.
Step 3: Identify Network Interfaces in Kali Linux
-
Boot Kali and open terminal.
-
Run:
ip a ip route -
Identify:
- Interface in default route → Internet adapter (
eth1) - Other interface → Internal adapter (
eth0)
- Interface in default route → Internet adapter (
Step 4: Assign Static IP to Internal Adapter in Kali
- Run the following (replace
eth0with your internal interface if different):
sudo ip addr add 192.168.100.10/24 dev eth0
sudo ip link set eth0 up-
Do not set a gateway on the internal adapter.
-
Verify:
ip a
ip route- Default route should still point to external adapter.
Step 4.1 How to make the IP address permanent in Kali Linux
Kali uses NetworkManager by default, so the recommended way is via NetworkManager.
Persistent static IP using NetworkManager
- List connections
nmcli connection show
You’ll see something like:
eth0
Wired connection 1
- Set static IP
Replace the connection name if different:
sudo nmcli connection modify "eth0" \
ipv4.method manual \
ipv4.addresses 192.168.100.10/24 \
ipv4.gateway "" \
ipv4.dns "8.8.8.8" # You dont need to add dns if you dont want to- Restart the connection
`sudo nmcli connection down "eth0"`
`sudo nmcli connection up "eth0"`Step 5: Assign Static IP to Internal Adapter in Windows Server
-
Open Network Connections → Internal NIC → Properties → IPv4.
-
Set:
- IP:
192.168.100.20 - Subnet Mask:
255.255.255.0 - Gateway: leave blank
- IP:
-
External NIC can stay on DHCP for internet.
Step 6: Enable Ping (ICMP) on Windows Server
Run PowerShell as Administrator:
Enable-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)"Step 6: Enable Ping (ICMP) on Windows Server Step 7: Verify Connectivity
- From Kali, test internet:
ping 8.8.8.8- From Windows, test internet:
ping 8.8.8.8- Test VM-to-VM ping over internal network:
- Kali → Windows:
ping 192.168.100.20- Windows → Kali:
ping 192.168.100.10Step 6: Enable Ping (ICMP) on Windows Server Step 8: Sanity Checks
- Both VMs have unique IPs in the same subnet for internal network.
- Default route points to external adapter for internet.
- ICMP allowed on Windows.
- Internal adapter IPs are static; external adapter uses DHCP.
This setup gives you internet access and VM-to-VM ping with a clean, realistic lab network in Hyper-V.
SETUP WITH NAT SWITCH (FOR WIFI)
Essentially this is made since Hyper-V Virtual Switch cannot be used on WiFi due to the nature of wifi
Why This Works on Ethernet but Breaks on Wi-Fi
Ethernet NICs (Why It Works)
- Support true Layer-2 bridging
- Hyper-V can safely bind an External vSwitch
- Host and VMs can share the same physical connection without issues
📡 Wi-Fi NICs (Why It Breaks)
Most Wi-Fi drivers do not support MAC address spoofing or bridging the way Hyper-V expects.
When you create an External vSwitch bound to a Wi-Fi adapter:
- Hyper-V takes control of the Wi-Fi NIC
- The host OS is moved behind a virtual NIC
- Many Wi-Fi drivers can’t handle this and lose connectivity
❌ Result: The host immediately drops its Wi-Fi connection
Bottom Line
| Connection Type | Behavior |
|---|---|
| Ethernet | ✅ Works fine |
| Wi-Fi | ❌ Host loses connection |
This behavior is extremely common and not a misconfiguration — it’s a limitation of most Wi-Fi drivers.
Steps to create NAT Switch for both Kali and Windows Server 2025
Virtual Switch Creation
- Assuming you already have an internal switch for both the VMs to communicate with each other (Either Internal LAB Switch etc.), make another switch called NAT_Internet
-
Go to Virtual Switch Manager
-
New Virtual Switch
-
Internal
-
Name it anything; I have named mine
NAT_InternetMake sure it is Internal and NOT External Switch -
Now open Powershell (admin) on your host machine
-
You will have to configure NAT on your machine first
-
New-NetIPAddress -IPAddress 192.168.200.1 -PrefixLength 24 -InterfaceAlias "vEthernet (NAT_Internet)"
New-NetNat -Name LabNAT -InternalIPInterfaceAddressPrefix 192.168.200.0/24-
This turns your host into a router for your VMs
-
You can check using the following commands if you have successfully configured the NAT on your machine
1. `Get-NetNat` 2. `Get-NetIPAddress -InterfaceAlias "vEthernet (NAT_Internet)"`
IP Configuration for Kali Linux
- Since the gateway to the NAT is
192.168.200.1we will follow the same pattern when setting the IP for our Kali Linux. (Kali Machine -⇒ xx.xx.xx.10, Windows Server -⇒ xx.xx.xx.20) ip a- Here, you will see two switches which are
eth0andeth1 eth0will ALREADY be configured for the internal switch so don’t make any changes for that one- We will be changing the IP address for
eth1-
-
nmcli con show -
You will see
Wired connection 1sudo nmcli connection modify "Wired connection 1" \ ipv4.method manual \ ipv4.addresses 192.168.200.10/24 \ ipv4.gateway 192.168.200.1 \ ipv4.dns "8.8.8.8" -
Restart the connection
sudo nmcli connection down "Wired connection 1" sudo nmcli connection up "Wired connection 1"
-
-
IP Configuration for Windows Server 2025
This one is basic.
- Open Network Settings
- Navigate to the Ethernet which is the NAT
- Add in the following details
- IP:
192.168.200.20 - Subnet mask:
255.255.255.0 - Gateway:
192.168.200.1 - DNS: set manually
8.8.8.8, since NAT doesn’t provide DHCP by default
- IP:
Enable ICMP4 and ICMP6 in Windows
Enable-NetFirewallRule -Name FPS-ICMP4-ERQ-In
Enable-NetFirewallRule -Name FPS-ICMP6-ERQ-In
IP ADDRESSES FOR VMS
192.168.200.1 - Gateway 192.168.200.20 - Windows Server 2025 192.168.200.10 - xfce 192.168.200.30 - KDE 192.168.200.50 - Gnome