Additional IP


  1. Posts : 37
    Windows 10
       #1

    Additional IP


    Hello!
    On the host computer I added an ip from another class (see -> Configuring an Additional IP Address on a Windows Server | Simply Cloud)So I have two IP's from different classes, one static IP and another IP from another class.How do you assign an additional ip (10 .....) to a virtual machine (VMWare)?
    Attached Thumbnails Attached Thumbnails Additional IP-screenshot-14-.jpg  
      My Computer


  2. Posts : 2,068
    Windows 10 Pro
       #2

    what are you trying to accomplishing having multiple IP addresses on the same adapter?

    If you were using a virtual machine, i would add another virtual adapter to the machine and assign that IP to the secondary adapter. This will allow you to connect to multiple networks.
      My Computers


  3. Posts : 37
    Windows 10
    Thread Starter
       #3

    I am not trying to accomplish anything? Just out of curiosity.
    I am using a virtual machine, I added a secondary adapter but I don't know how to assign a specific IP, let's say 10.1.1.10
      My Computer


  4. Posts : 2,068
    Windows 10 Pro
       #4

    if your vm is running windows 10, right click on the network icon in the taskbar area, "Open Network and Internet Settings", click on "Change Adapter options", right click on your secondary interface, choose Properties, highlight Internet Control Protocol 4 (TCP/IP V4), click on properties, and choose "Use the following IP address", and you can do something similar to this.

    Additional IP-image.png
      My Computers


  5. Posts : 37
    Windows 10
    Thread Starter
       #5

    Oh, yes, I knew how to assign a static IP.I wanted to assign the virtual machine an IP from another class of IP's.As I have the IP 192.168.... on the Host and I added an additional IP from another class 10.10 ....., I would like to assign this additional IP to the virtual machine, so that I have 2 computers with IP from different classes.
    I don't know if this is done but what I want is to have ips of different classes on 2 computers,
    Host(192.168...) and Guest(10.10...).
      My Computer


  6. Posts : 2,068
    Windows 10 Pro
       #6

    so, I assume you are talking about class A, B and C. There are private ranges in each class which are non routable on the internet.

    class a is 10.0.0.0/8
    class b is 172.16.0.0/16
    class c is 192.168.0.0/24

    while you can have a host on 192 and a guest on 10, you would have to setup a nat for the 10 network box to get out. Efffectively, you would have 2 different networks and you have to have a mechanism to route between them. This is usually a router. If you had multiple vms on 10 addresses they could talk to each other.
      My Computers


  7. Posts : 37
    Windows 10
    Thread Starter
       #7

    How to set a NAT for network 10?In the virtual machine settings at Network Connection I have the NAT option: Used to share the host's IP address but my host has two IPs (192 and 10).I do not have the option to select the IP address for which to set a NAT.
      My Computer


  8. Posts : 2,068
    Windows 10 Pro
       #8

    In my scenario, my home network is on 192.168.1.0/24 and my local Windows 10 Pro machine has an IP address of 192.168.1.25
    Additional IP-image.png

    I have Hyper-V installed and I use that to run my virtual machines. My preference is to setup a NAT switch in Hyper-V so that all of my VM's can run in an isolated network space that doesn't impact my home network. I want to be able to control the IP addressing ranges in this space and I want these VM hosts to be able to access the Internet via my host computer.

    I created my NAT switch using this powershell command
    New-VMSwitch –SwitchName “NAT-Switch” –SwitchType Internal –Verbose

    Once I had this switch, I ran the following powershell to get the interface # of my nat switch, which happens to be 4
    get-netadapter
    Additional IP-image.png

    Then I ran the following command to assign an IP address to this interface with the following powershell command
    New-NetIPAddress –IPAddress 10.0.1.1 -PrefixLength 24 -InterfaceIndex 4 –Verbose

    Finally, i setup the new NAT network, for 10.0.1.0/24 with the following powershell
    New-NetNat –Name NATNetwork –InternalIPInterfaceAddressPrefix 10.0.1.0/24 –Verbose

    So, now on my home computer, I have 2 interfaces. I have my 192.168.1.25, and I also have a 10.0.1.1 on my interface to my NAT Switch.

    Additional IP-image.png

    My first VM, is a Windows 2019 Domain controller with DHCP and it hands out addresses to all of the VM's using a the 10.0.1.100 to 10.0.1.200 address space, since my HyperV switch won't do DHCP natively.
      My Computers


  9. Posts : 11,246
    Windows / Linux : Arch Linux
       #9

    Hi there

    Easy to do on Guests including Windows on a Linux host running KVM/QEMU.

    1) create an Isolated network on the Host say in /tmp/isolated.xml (XML file) -- give it a fixed IP address e.g as shown.

    <network>
    <name>isolated</name>
    <ip address="192.168.254.1" netmask="255.255.255.0">
    <dhcp>
    <range start="192.168.254.2" end="192.168.254.254"/>
    </dhcp>
    </ip>
    </network>


    2) define it via virsh net-define, start / auto start it e.g [root@hestur hrafn]# virsh net-define /tmp/isolated.xml
    Network isolated defined from /tmp/isolated.xml

    [root@hestur hrafn]# virsh net-autostart isolated
    Network isolated marked as autostarted

    Ist Nic define as Host device <nic inteface e.g ethx or empxx or whatever>:macvtap source mode bridge

    add in the VM a second NIC defined as :

    2nd Nic Virtual network <name --in my case isolated> device model virtio


    start guest

    Host will be accessible always as 192.168.254.1

    Works fine for Windows VM's on Arch and Fedora. Should also work if the real NIC is a wifi card too.

    The XML file will look something like this for NIC 2 --depending on your hardware

    <interface type="network">
    <mac address="52:54:00:b0:3c:94"/>
    <source network="isolated" portid="4afe495d-53a4-49fa-84e1-85d5c658bf78" bridge="virbr0"/>
    <target dev="vnet0"/>
    <model type="virtio"/>
    <alias name="net0"/>
    <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
    </interface>


    Then :
    Additional IP-screenshot_20210127_215413.png

    Now the Windows VM configuration :

    1) the real NIC :

    Additional IP-screenshot_20210127_215646.png

    2) The Virtual / Isolated NIC

    The "virtual NIC -- the "Isolated" network -- allows HOST and VM to communicate on 192.168.254.1 in my case on the "Isolated network".

    Additional IP-screenshot_20210127_215940.png

    Windows VM network config :

    Additional IP-screenshot_20210127_220434.png

    The guest access the Host via the address 192.168.254.1

    guest accesses rest of Internet normally e.g using any browser etc.

    Rest of network can access this VM via Hostname or its IP address in this case 192.168.1.94

    e.g accessing files on this VM from another server on my LAN :

    Additional IP-screenshot_20210127_221448.png

    Cheers
    jimbo
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:17.
Find Us




Windows 10 Forums