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!
@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!!
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.
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?
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 )
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.
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 ?
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?
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.
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!
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!
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.
@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
Thank you, I finally understand a good use for an internal vs external switch.
Glad it helped!
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!
Thank you very much! Glad they are helpful. Thanks again!
Thanks for this wonderful video.
You are one person whom video really helped me. Thanks a lot! :)
Very welcome!
Thank you for sharing! Very helpful information.. keep up the good work!
Thanks for watching!
It really helped. :)
Thank you.
Glad to hear that!. Thank you for the feedback.
This is Perfect , Thank you
This was very helpful. Thank you!
Thank you and glad it was helpful!
Thank you so much. This was helpful.
Glad it was helpful!
What to do if I'm setting up a malware testing lab
Thanks. Well-presented and useful.
Thank you very much for the kind words and glad you fount it useful!
This is really helpful, thank you man
Hi Yousf thank you and glad to hear you found it useful.
@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!!
thank you so much
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.
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?
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 )
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.
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 ?
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?
When the VM traffic goes out of vSwitch, the source IP is NATed to host’s ip right?
Correct.
thank you man
Hi Hasantha, welcome!, Gald you found it useful.
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.
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!
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!
Hi Edgar, thanks for your feedback and glad it was helpful! Netplan is the correct way to set network attributes on Ubuntu.
Great video and at a good pace. How can I get each Ubuntu VM to ping each other? Thanks
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.
i can not access internet via switch
When you set up your Ubuntu VM, make sure you set its gateway IP address to that of your virtual switch IP address.
when i switch to my newly created network with powershell, the vm cant connect to the internet :'(
@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