SETUP WITH ETHERNET SWITCH

Step 1: Create Virtual Switches in Hyper-V

  1. Open Hyper-V Manager → Virtual Switch Manager.

  2. Create an Internal Switch:

    • Type: Internal
    • Name: Lab_Internal
    • Click OK.
  3. 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:

  1. Open VM → Settings → Add Network Adapter (if needed).
  2. Connect Adapter 1Lab_Internal (Internal switch).
  3. Connect Adapter 2External_Internet (External switch for internet).
  4. Click Apply → OK.

Step 3: Identify Network Interfaces in Kali Linux

  1. Boot Kali and open terminal.

  2. Run:

    ip a
    ip route
  3. Identify:

    • Interface in default route → Internet adapter (eth1)
    • Other interface → Internal adapter (eth0)

Step 4: Assign Static IP to Internal Adapter in Kali

  1. Run the following (replace eth0 with your internal interface if different):
sudo ip addr add 192.168.100.10/24 dev eth0
sudo ip link set eth0 up
  1. Do not set a gateway on the internal adapter.

  2. 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

  1. List connections
    nmcli connection show

You’ll see something like:

eth0
Wired connection 1
  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
  1. Restart the connection
    `sudo nmcli connection down "eth0"`  
    `sudo nmcli connection up "eth0"`

Step 5: Assign Static IP to Internal Adapter in Windows Server

  1. Open Network Connections → Internal NIC → Properties → IPv4.

  2. Set:

    • IP: 192.168.100.20
    • Subnet Mask: 255.255.255.0
    • Gateway: leave blank
  3. 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

  1. From Kali, test internet:
ping 8.8.8.8
  1. From Windows, test internet:
ping 8.8.8.8
  1. Test VM-to-VM ping over internal network:
  • Kali → Windows:
ping 192.168.100.20
  • Windows → Kali:
ping 192.168.100.10

Step 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:

  1. Hyper-V takes control of the Wi-Fi NIC
  2. The host OS is moved behind a virtual NIC
  3. Many Wi-Fi drivers can’t handle this and lose connectivity

❌ Result: The host immediately drops its Wi-Fi connection


Bottom Line

Connection TypeBehavior
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

  1. 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
    1. Go to Virtual Switch Manager

    2. New Virtual Switch

    3. Internal

    4. Name it anything; I have named mine NAT_Internet Make sure it is Internal and NOT External Switch

    5. Now open Powershell (admin) on your host machine

    6. 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
  1. This turns your host into a router for your VMs

  2. 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

  1. Since the gateway to the NAT is 192.168.200.1 we 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)
  2. ip a
  3. Here, you will see two switches which are eth0 and eth1
  4. eth0 will ALREADY be configured for the internal switch so don’t make any changes for that one
  5. We will be changing the IP address for eth1
      1. nmcli con show

      2. You will see Wired connection 1

        sudo 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"
      3. 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.

  1. Open Network Settings
  2. Navigate to the Ethernet which is the NAT
  3. 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

 

 

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