Setup NAT (Network Address Translation) on Hyper-V.

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 43

  • @HenryTsang
    @HenryTsang 2 роки тому +1

    Thank you, I finally understand a good use for an internal vs external switch.

  • @laobaixing244
    @laobaixing244 2 роки тому

    All your teaching videos are so great, very detailed and giving practical guide!!!! We really like your teaching style. Expect more videos on tech subjects from you. Thank you!

  • @rahulsaikh893
    @rahulsaikh893 2 роки тому

    Thanks for this wonderful video.

  • @TheDjBobie
    @TheDjBobie 2 роки тому

    You are one person whom video really helped me. Thanks a lot! :)

  • @JY-ni7id
    @JY-ni7id 3 роки тому

    Thank you for sharing! Very helpful information.. keep up the good work!

  • @MrAayooshmoitro
    @MrAayooshmoitro 4 роки тому +2

    It really helped. :)
    Thank you.

  • @gimenesrafael
    @gimenesrafael 3 роки тому

    This is Perfect , Thank you

  • @NullReferencer
    @NullReferencer 3 роки тому

    This was very helpful. Thank you!

  • @fulanitooriginal
    @fulanitooriginal 3 роки тому

    Thank you so much. This was helpful.

  • @javagamesfanclub5650
    @javagamesfanclub5650 5 днів тому

    What to do if I'm setting up a malware testing lab

  • @zt.5677
    @zt.5677 3 роки тому

    Thanks. Well-presented and useful.

  • @yousfinfis8154
    @yousfinfis8154 4 роки тому

    This is really helpful, thank you man

  • @shankarganesh5001
    @shankarganesh5001 Місяць тому

    @The Learning Channel: Thanks a lot this video, it’s have very good explanation. My question: Is this applicable for VirtualBox VM’s ? Or only for Hyper-V? In my virtual box VM I see network adapter selected as NAT Adapter, Do you have any procedure for that? Greatly Appreciated!!

  • @Capone80
    @Capone80 10 місяців тому

    thank you so much

  • @phanphan2251
    @phanphan2251 2 роки тому

    this video helped me a lot, thx sir.
    it's weird i have internet behind the NAT, i can't ping outside but in can connect with ssh, i thought i needed to port forward port 22 ssh.

    • @TheLearningChannel-Tech
      @TheLearningChannel-Tech  2 роки тому

      Hi, thanks for your feedback. So, your issue is that outward traffic from VMs doesn't work? Could you explain a bit more? Like you are not able to visit a site on the internet through your browser? Also, you mentioned unable to ping, does that mean you are not able to ping any other deice in your LAN? Can you perform those tasks from your Windows host?

  • @John-d8k8o
    @John-d8k8o Рік тому

    from a security perspective, should a person use NAT with hyper v in 2023 if want vm to connect to internet? and if so, anything to keep in mind like internal firewall? using 'default switch' currently (also, other functions like copy paste between host and vm seems enabled by default ... not sure if that's very secure )

    • @TheLearningChannel-Tech
      @TheLearningChannel-Tech  Рік тому

      Hi, all the traffic within the VM and Hyper-V is on an internal and private network. These devices are not accessible from outside your firewall because they are not routable from the Internet and are perfectly safe.
      If you have a service running on one of your VMs and want to expose it to the Internet, you must configure your firewall to allow address and port forwarding to your internal network. In that case, these are some of the security precautions I would recommend:
      1) Make sure the service uses a secure TLS connection (i.e. https) otherwise a hacker will be able to intercept your unencrypted communications.
      2) Make sure your service requires authentication so you can limit who can access it.
      3) Limit incoming traffic only to the IP address of the VM that hosts the service and the port number that it is listening on.
      Hope this helps.

  • @FouseQuentin
    @FouseQuentin 2 роки тому

    Hello 👋,
    I own a dedicated server running hyperv2019 at OVH.
    I've got a single public ip set up on the main nic of the hyperv.
    I followed the tutorial and my VM can contact the host vNic connected to the host virtual switch.
    When I manually setup a DNS it seems to resolve my request but I can't ping wan.
    Any idea ?

    • @TheLearningChannel-Tech
      @TheLearningChannel-Tech  2 роки тому

      Hi, from your VM, if you open a browser, are you able to navigate to a site say yahoo.com? In other words, is your issue only pinging targets outside your LAN or you are not able to visit any site on the internet?

  • @danimoosakhan
    @danimoosakhan 2 роки тому

    When the VM traffic goes out of vSwitch, the source IP is NATed to host’s ip right?

  • @technology-devil-
    @technology-devil- 3 роки тому

    thank you man

  • @Quarkburger
    @Quarkburger 3 роки тому +1

    In your example, if 10.0.0.145 was a computer, should it be able to ping 192.168.0.10? That is what I need to do but am not able to. From ip addresses in your example (and yes, in reality I'm using my own), from 192.168.0.10 I am able to ping 10.0.0.145, but not the other way around.

    • @TheLearningChannel-Tech
      @TheLearningChannel-Tech  3 роки тому

      Hi @Quarkburger, no, not directly. "192.168.0.10" is behind the switch. The switch acts a router from VMs out to the greater LAN and provides Network Address Translation (to/from the network) for VMs. Other devices on the LAN have no visibility to the VMs. We could, however, open ports for apps running on VMs and map them to the ports on the host machine (10.0.0.87) where other devices on the LAN could call those services but by default other devices have no visibility to the VMs behind the switch. Hope this makes sense, please let me know otherwise. Thanks!

  • @edgarallik9995
    @edgarallik9995 2 роки тому

    Thank you, that was very helpful. Question: are there any special considerations for a microk8s ubuntu vm? I edited the yaml file under /etc/netplan/ and then ran sudo netplan apply. It seems to work well, but just want to make sure it was done the proper way. Thanks!

    • @TheLearningChannel-Tech
      @TheLearningChannel-Tech  2 роки тому

      Hi Edgar, thanks for your feedback and glad it was helpful! Netplan is the correct way to set network attributes on Ubuntu.

  • @dba3579
    @dba3579 3 роки тому

    Great video and at a good pace. How can I get each Ubuntu VM to ping each other? Thanks

    • @TheLearningChannel-Tech
      @TheLearningChannel-Tech  3 роки тому

      Hi and thank you for your feedback! If you correctly set up the Hyper-V switch and assigned the IP addresses correctly to VMs, they will be able to ping each other as they are on the same switch and subnet. Please follow the steps exactly as I showed in the video and everything should work. If you still have issues please post here and I'll do my best to help. Thanks.

  • @some-thing-2024
    @some-thing-2024 2 роки тому

    i can not access internet via switch

    • @TheLearningChannel-Tech
      @TheLearningChannel-Tech  2 роки тому

      When you set up your Ubuntu VM, make sure you set its gateway IP address to that of your virtual switch IP address.

  • @themrunknown850
    @themrunknown850 3 роки тому

    when i switch to my newly created network with powershell, the vm cant connect to the internet :'(

    • @TheLearningChannel-Tech
      @TheLearningChannel-Tech  3 роки тому

      @Steve Steve
      Hey Steve,
      Are you able to connect to your LAN or can't connect to any destination outside the new network?
      Here is the script I used for that demo if you want to double check:
      New-VMSwitch -SwitchName "LabSwitch" -SwitchType Internal
      #Gat all network adapter and make a note of "LabSwitch" as you need it in the next step "INDX_ID_OF_LabSwitch":
      Get-NetAdapter
      New-NetIPAddress -IPAddress 192.168.0.1 -PrefixLength 24 -InterfaceIndex "INDX_ID_OF_LabSwitch"
      New-NetNat -Name NewInternalSwitch -InternalIPInterfaceAddressPrefix 192.168.0.0/24
      Get-NetNat
      ##To remove those objects:
      Remove-NetIPAddress -InterfaceAlias "vEthernet (LabSwitch)" -IPAddress 192.168.0.1
      Remove-VMSwitch "LabSwitch"
      Get-NetNat
      Remove-NetNat LabNAT
      Get-VMSwitch