Jump to content

So i just setup two vm's on virtualbox.

 

I want each VM to be able to speak to each other. VM1 -> VM2 And VM2 -> VM1. Also i want both VMs to have internet access without being able to ping the host machine. How would i do that. I've setup and internal network and each VM can talk to each other and then i add a NAT to give each VM internet access but each VM can still contact the host IP how would i set it up to stop this?

Link to comment
https://linustechtips.com/topic/842347-private-vm-network/
Share on other sites

Link to post
Share on other sites

once the VM's have "internet" they will always be able to ping the machines on the same network.

You would need to set up 2 vlans on your router, and have a firewall rule on the router to block traffic between vlans.

if you want to annoy me, then join my teamspeak server ts.benja.cc

Link to comment
https://linustechtips.com/topic/842347-private-vm-network/#findComment-10513758
Share on other sites

Link to post
Share on other sites

1 minute ago, The Benjamins said:

once the VM's have "internet" they will always be able to ping the machines on the same network.

You would need to set up 2 vlans on your router, and have a firewall rule on the router to block traffic between vlans.

So would the only way be to put the two VMs on a different subnet? Basically im just setting up a AD Server and a Windows 10 VM to test and mess about with dhcp, dns, wds etc without effecting my main network. I still want new devices that connect to my normal network to get dhcp from my 192.168.0.1 router. Not the windows server...

Link to comment
https://linustechtips.com/topic/842347-private-vm-network/#findComment-10513766
Share on other sites

Link to post
Share on other sites

2 minutes ago, lukesterboy said:

So would the only way be to put the two VMs on a different subnet? Basically im just setting up a AD Server and a Windows 10 VM to test and mess about with dhcp, dns, wds etc without effecting my main network. I still want new devices that connect to my normal network to get dhcp from my 192.168.0.1 router. Not the windows server...

what VM software are you using?

 

for that I would set up 2 networks for the VMs. one being internet and the other being a private lan. on the private lan you can set up the AD server and mess with DHCP and stuff, but the machines will still have internet access if needed.

if you want to annoy me, then join my teamspeak server ts.benja.cc

Link to comment
https://linustechtips.com/topic/842347-private-vm-network/#findComment-10513789
Share on other sites

Link to post
Share on other sites

1 minute ago, The Benjamins said:

what VM software are you using?

 

for that I would set up 2 networks for the VMs. one being internet and the other being a private lan. on the private lan you can set up the AD server and mess with DHCP and stuff, but the machines will still have internet access if needed.

I'm using Oracle VirtualBox, so how would i do this? I thought you said if i gave it internet access it will be able to ping my Host machine?

Link to comment
https://linustechtips.com/topic/842347-private-vm-network/#findComment-10513801
Share on other sites

Link to post
Share on other sites

1 minute ago, lukesterboy said:

I'm using Oracle VirtualBox, so how would i do this? I thought you said if i gave it internet access it will be able to ping my Host machine?

yes, but you can set up 2 network adapter for the VM's one is a private network, and the other is internet. so you can disable the internet when you are messing with the server DHCP stuff.

 

In Hyper V its called Virtual switches, you can have one switch set to external (internet) and the other as internal, and run your tests on the internal network.

if you want to annoy me, then join my teamspeak server ts.benja.cc

Link to comment
https://linustechtips.com/topic/842347-private-vm-network/#findComment-10513814
Share on other sites

Link to post
Share on other sites

2 minutes ago, The Benjamins said:

yes, but you can set up 2 network adapter for the VM's one is a private network, and the other is internet. so you can disable the internet when you are messing with the server DHCP stuff.

 

In Hyper V its called Virtual switches, you can have one switch set to external (internet) and the other as internal, and run your tests on the internal network.

Ah ok, i have the VM's on whats called a Internal network so they can connect with each other. I see you propose turning off the internet when not in use. I did plan on using it as a test environment when away from home which would require internet access. I suppose i could setup some sort of remote desktop on my host machine to do that.

Link to comment
https://linustechtips.com/topic/842347-private-vm-network/#findComment-10513835
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×