ESXi

  • 1.  Can VMs Having Different Subnet From ESXi Itself

    Posted Feb 20, 2024 09:28 AM

    I would like to have VMs in different subnet from the ESXi it reside.

    Said:

    Router Gateway: 192.168.0.1 /26

    Switch : No IP

    ESXi : 192.168.0.3 / 26

    VM 1 : 192.168.0.8 / 26

    VM 2 : 192.168.0.68 / 26

    VM 3 : 192.168.0.69 / 26

    Also with VLAN implement.

     

    How do I Implement the whole network?

    1. External IP to Nat internal IP and Configure Router to having two gateway?

    2. Switch configure as 2nd layer VLAN database only will do?

    3. vCenter vSwitch VLAN can leave without configure, as long router and switch port are configure and able to deliver VLAN?

     

    Correct me if the above IP given are not proper, as it is only illustration and provide example. Kindly explain in detail and easy to understand, or else your correct solution may not fit the purpose.



  • 2.  RE: Can VMs Having Different Subnet From ESXi Itself
    Best Answer

    Posted Feb 20, 2024 10:10 AM

    you can configure VMs on different subnets from the ESXi host they reside on, including implementing VLANs to manage network traffic and isolate different network segments effectively.

     

    Router Configuration

    • Enable NAT on your router to translate your internal VM IP addresses to a public external IP for internet access.
    • Your router will likely need static routes configured to know how to reach the VM subnet (e.g., 192.168.0.64/26 via the ESXi host's IP address).

     

    Switch Configuration

    • Create the necessary VLANs on your switch
    • Make the port connecting the switch to your router a "trunk port." This allows it to carry traffic for multiple VLANs.
    • Assign other switch ports to their respective VLANs 
    •  

    ESXi Configuration

    • Create a standard vSwitch or distributed vSwitch (depending on your vCenter setup).
    • Add port groups to the vSwitch and assign them to their respective VLANs. One port group will connect to the ESXi management network, and another port group will be for your VMs.
    • Assign VMs their necessary IP addresses, and ensure you connect each VM's virtual network adapter to the correct port group (VM VLAN).

     

    Example Detailed Instructions (May Vary by Device)

    Let's say you want VLAN 10 for your ESXi network and VLAN 20 for your VMs:

    Router:

    • Consult your router manual for NAT setup
    • Add static route:
      • Destination network: 192.168.0.64/26
      • Gateway: 192.168.0.3 (ESXi IP)

    Switch:

    • Create VLAN 10 (name: ESXi_VLAN)
    • Create VLAN 20 (name: VM_VLAN)
    • Configure router-facing port as trunk: Allow VLAN 10 and VLAN 20
    • Assign ESXi host port to access mode VLAN 10

    ESXi:

    • Create a vSwitch
    • Create port group "ESXi_Management" on VLAN 10
    • Create port group "VM_Network" on VLAN 20

     

     



  • 3.  RE: Can VMs Having Different Subnet From ESXi Itself

    Posted Feb 21, 2024 01:59 AM

    Hi Sdtslmn,

    Thank for your Kudos answer, this make me have a clearer picture on the setup. After viewing so many post and answer, your replied with professional really impress people. Really appreciate

    This raise my another curious, I saw some youtube/internet post said:

    if router or switch has already configure the VLAN, then in vCenter or vSphere you do not need to configure VLAN is that true?