none
Can not access to internet virtual machine

    Question

  • Hello,


    I have a server 2016 STD with role Hyper V, and a virtual machine SRV2019 STD

    I have on my physical server an "Ethernet" card with ip as a public IP of my provider
    Internet works perfectly

    In the Hyper V Manager I created an "External Network" virtual switch using my Intel physical adapter

    in the configuration of the virtual machine, I assigned him the virtual card "VSwitch"

    When I start the VM, it does not have internet.

    note: Hyper-V Extensible Virtual Switch is checked on the "Ethernet" card and not "vEthernet", I do not know if it's good

    OnPhysical Machine :

    Carte Ethernet vEthernet (VSwitch) :
    
       Suffixe DNS propre à la connexion. . . :
       Description. . . . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter #3
       Adresse physique . . . . . . . . . . . : 00-25-90-D5-xx-xx
       DHCP activé. . . . . . . . . . . . . . : Non
       Configuration automatique activée. . . : Oui
       Adresse IPv6 de liaison locale. . . . .: fe80::6961:b193:bc21:xxxxx(préféré)
       Adresse IPv4. . . . . . . . . . . . . .: 37.187.xx.xx(préféré)
       Masque de sous-réseau. . . . . . . . . : 255.255.255.0
       Passerelle par défaut. . . . . . . . . : fe80::205:73ff:fea0:xxxx
                                           37.187.xx.xx
       IAID DHCPv6 . . . . . . . . . . . : 385885584
       DUID de client DHCPv6. . . . . . . . : 00-01-00-01-24-58-E9-A2-00-25-90-D5-FE-xx
       Serveurs DNS. . .  . . . . . . . . . . : 213.186.xx.xx
       NetBIOS sur Tcpip. . . . . . . . . . . : Activé


    On the virtual machine

    Carte Ethernet Ethernet:
    
       Suffixe DNS propre à la connexion. . . :
       Description. . . . . . . . . . . . . . : Microsoft Hyper-V Network Adapter
       Adresse physique . . . . . . . . . . . : 00-25-90-D5-xx-xx
       DHCP activé. . . . . . . . . . . . . . : Oui
       Configuration automatique activée. . . : Oui
       Adresse IPv6 de liaison locale. . . . .: fe80::6961:b193:bc21:xxxxx(préféré)
       Adresse IPv4. . . . . . . . . . . . . .: 169.254.178.75(préféré)
       Masque de sous-réseau. . . . . . . . . : 255.255.0.0
       Passerelle par défaut. . . . . . . . . : fe80::205:73ff:fea0:xxxx

    I understand that in 169 it can not work but I do not understand what I have to do

    Can you helping me ?

    Thanks



    • Edited by max3939 Tuesday, April 30, 2019 3:32 PM
    Tuesday, April 30, 2019 3:32 PM

Answers

  • Hello

    Finally I found, not running the GUI it did not work, I deleted everything and I did it in powershell! and it worked directly!
    Passing through powershell cards do not work the same way

    The correct configuration was :

    Just ONE card in the host

    Carte Ethernet vEthernet (ExternalVSwitch) :
    
       Suffixe DNS propre à la connexion. . . :
       Description. . . . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter
       Adresse IPv4. . . . . . . . . . . . . .: 37.187.xx.51(préféré)
       Masque de sous-réseau. . . . . . . . . : 255.255.255.0
       Passerelle par défaut. . . . . . . . . : 37.187.xx.254
       Serveurs DNS. . .  . . . . . . . . . . : 213.186.xx.99

    On the VM :

    Carte Ethernet vEthernet (ExternalVSwitch) :
    
       Suffixe DNS propre à la connexion. . . :
       Adresse IPv4. . . . . . . . . . . . . .: 37.187.xx.51(préféré)
       Masque de sous-réseau. . . . . . . . . : 255.255.255.0
       Passerelle par défaut. . . . . . . . . : 37.187.xx.254
       Serveurs DNS. . .  . . . . . . . . . . : 213.186.xx.99

    I give you powershell cmd's to add Vswitch :

    1 -Use Get-NetAdapter to return a list of network adapters connected to the host.

    Get-NetAdapter
    
     Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed
     ----                      --------------------                    ------- ------       ----------             ---------
    
     Ethernet                  Intel(R) PRO/100 M Desktop Adapter            3 Up           00-0E-0C-A8-DC-31        10 Mbps


    2 -Select the network adapter to use with the Hyper-V switch and place an instance in a variable named $net.

    $net = Get-NetAdapter -Name 'Ethernet'


    3 -Execute the following command to create the new Hyper-V virtual switch.

     New-VMSwitch -Name "External VM Switch" -AllowManagementOS $True -NetAdapterName $net.Name

    I hope it will be usefull for someone

    Max



    • Marked as answer by max3939 Tuesday, May 7, 2019 12:55 PM
    • Edited by max3939 Tuesday, May 7, 2019 3:16 PM
    Tuesday, May 7, 2019 12:54 PM

All replies

  • Hi 

    I understand your setup as follows. Correct me if I am wrong

    You have a hyper-v host with Intel network card, You have created a vSwitch as external and also  selected the option "Allow management operating system to use this connection". Due to which you have got a vEthernet adapter on the physical machine. When you create a vSwitch with a NIC in physical host, it will act like a Layer 2 switch and the uplink for that L2 switch will be the connection that goes out from the NIC with which you have created the vSwitch. vEthernet is the vNIC which is used by your physical machine. 

    now let's see the VM configuration. VM's vNIC is connected to the same vSwicth? Or do you have any other switch?

    Secondly, in the physical host, I could see you have allocated the IP address manually, i.e. static IP address but in the VM it is set to DHCP.

    So, as a first step, you may need to assign a static IP to the VM. The IP should be one of the public IP addresses from your internet service provider

    After doing so, still if the problem persists, then you may need to check the vSwitch configuration

    Regards,
    Bala N

    Tuesday, April 30, 2019 4:05 PM
  • My guess is that your ISP is providing you with a single fixed IP address.  That is pretty common for ISPs.  ISPs generally leave it up to the user to configure an environment that allows for multiple IP addresses.  Some ISPs wil provide a router that also serves as a DHCP server.  You need to talk with your ISP to determine what they have provided to you.  If the first, you need to insert a router into your environment that will use the ISP's fixed IP address on one side and your own subnet on the other side, such as a 192.168.1.0/24 subnet.  Then you can configure your private side of the network to have as many IP addresses as you want under your control.

    tim

    Wednesday, May 1, 2019 1:25 PM
  • Yes, my virtual machine is connected to the VSwitch of my host machine

    If I understand correctly, I have to put a second network card on my host and put a private IP 192.168.1.0/24?

    Then put an ip in the same subnet to my virtual machine?

    I bought a failover ip to my provider, I can not have internet using this public ip?
    Thursday, May 2, 2019 8:08 AM
  • If you get a public IP from your ISP, then put that IP address in the VM's vNIC which is connected to the external vswitch

    Regards,
    Bala N

    Thursday, May 2, 2019 11:52 AM
  • - I put the public IP address on my virtual machine

    - I assigned a static MAC provided by my ISP

    -The virtual machine is connected to the VSwitch of the physical machine

    but... I do not ping anything

    Thursday, May 2, 2019 12:07 PM
  • the physical NIC which was used to create vswitch is connected to the physical switch as the physical machine is connected ?

    Regards,
    Bala N

    Thursday, May 2, 2019 12:15 PM
  • Yes

    In network pannel on my physical machine, i have 2 cards

    1st

    Ethernet : Intel I350 Gigabyt Network Connexion :

    - With public IP (37.187.X.X)

    - With HyperV extensible Vswitch

    - With NOT Internet connexion sharing

    2nd

    vEthernet (VSwitch) : Hyper-V Virtual ethernet Adapter :

    - With SAME public IP (37.187.X.X)

    - With NOT HyperV extensible Vswitch

    - With NOT Internet connexion sharing

    My VM is connected with VSwhitch card

    And in my VM i have 1 card " Hyper-V Virtual ethernet Adapter" the IP is my IP failover from my ISP

    Carte Ethernet Ethernet 4:
    
       Suffixe DNS propre à la connexion. . . :
       Description. . . . . . . . . . . . . . : Microsoft Hyper-V Network Adapter
       Adresse physique . . . . . . . . . . . : 00-25-90-D5-xx-xx
       DHCP activé. . . . . . . . . . . . . . : Non
       Configuration automatique activée. . . : Oui
       Adresse IPv6 de liaison locale. . . . .: fe80::6961:b193:bc21:xxxxx(préféré)
       Adresse IPv4. . . . . . . . .  : 51.255.x.x(préféré)
       Masque de sous-réseau. . . . . . . . . : 255.255.0.0
       Passerelle par défaut. . . . . . 51.255.x.245
       Serveur DNS : 213.186.33.99
    • Edited by max3939 Thursday, May 2, 2019 12:44 PM
    Thursday, May 2, 2019 12:34 PM
  • Hi,

    1st

    Ethernet : Intel I350 Gigabyt Network Connexion :

    - With public IP (37.187.X.X)

    - With HyperV extensible Vswitch

    - With NOT Internet connexion sharing

    2nd

    vEthernet (VSwitch) : Hyper-V Virtual ethernet Adapter :

    - With SAME public IP (37.187.X.X)

    - With NOT HyperV extensible Vswitch

    - With NOT Internet connexion sharing

    It seems the configuration is correct.

    And in my VM i have 1 card " Hyper-V Virtual ethernet Adapter" the IP is my IP failover from my ISP

    Carte Ethernet Ethernet 4:
    
       Suffixe DNS propre à la connexion. . . :
       Description. . . . . . . . . . . . . . : Microsoft Hyper-V Network Adapter
       Adresse physique . . . . . . . . . . . : 00-25-90-D5-xx-xx
       DHCP activé. . . . . . . . . . . . . . : Non
       Configuration automatique activée. . . : Oui
       Adresse IPv6 de liaison locale. . . . .: fe80::6961:b193:bc21:xxxxx(préféré)
       Adresse IPv4. . . . . . . . .  : 51.255.x.x(préféré)
       Masque de sous-réseau. . . . . . . . . : 255.255.0.0
       Passerelle par défaut. . . . . . 51.255.x.245
       Serveur DNS : 213.186.33.99

    We are not familiar with failover IP.

    I suggest you remove the nic and test the vm if it is connect to internet.

    Best Regards,

    Frank


    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, May 6, 2019 9:41 AM
    Moderator
  • Hello

    Finally I found, not running the GUI it did not work, I deleted everything and I did it in powershell! and it worked directly!
    Passing through powershell cards do not work the same way

    The correct configuration was :

    Just ONE card in the host

    Carte Ethernet vEthernet (ExternalVSwitch) :
    
       Suffixe DNS propre à la connexion. . . :
       Description. . . . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter
       Adresse IPv4. . . . . . . . . . . . . .: 37.187.xx.51(préféré)
       Masque de sous-réseau. . . . . . . . . : 255.255.255.0
       Passerelle par défaut. . . . . . . . . : 37.187.xx.254
       Serveurs DNS. . .  . . . . . . . . . . : 213.186.xx.99

    On the VM :

    Carte Ethernet vEthernet (ExternalVSwitch) :
    
       Suffixe DNS propre à la connexion. . . :
       Adresse IPv4. . . . . . . . . . . . . .: 37.187.xx.51(préféré)
       Masque de sous-réseau. . . . . . . . . : 255.255.255.0
       Passerelle par défaut. . . . . . . . . : 37.187.xx.254
       Serveurs DNS. . .  . . . . . . . . . . : 213.186.xx.99

    I give you powershell cmd's to add Vswitch :

    1 -Use Get-NetAdapter to return a list of network adapters connected to the host.

    Get-NetAdapter
    
     Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed
     ----                      --------------------                    ------- ------       ----------             ---------
    
     Ethernet                  Intel(R) PRO/100 M Desktop Adapter            3 Up           00-0E-0C-A8-DC-31        10 Mbps


    2 -Select the network adapter to use with the Hyper-V switch and place an instance in a variable named $net.

    $net = Get-NetAdapter -Name 'Ethernet'


    3 -Execute the following command to create the new Hyper-V virtual switch.

     New-VMSwitch -Name "External VM Switch" -AllowManagementOS $True -NetAdapterName $net.Name

    I hope it will be usefull for someone

    Max



    • Marked as answer by max3939 Tuesday, May 7, 2019 12:55 PM
    • Edited by max3939 Tuesday, May 7, 2019 3:16 PM
    Tuesday, May 7, 2019 12:54 PM
  • Hi,

    Thanks for your sharing.

    Best Regards,

    Frank


    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, May 8, 2019 2:45 AM
    Moderator