Brian Phillips

Junior Member
Feb 2, 2017
2
0
1
I want my virtual machines (VMs) to think that they're connecting to the Internet...but not let them connect to the Internet.

For simplicity's sake, let's say I have three virtual machines (VMs). Two are Windows 7 workstations, and the third is a Linux firewall installation (IPFire) that is used strictly to provide DHCP services to the two workstations (MAC IP reservations). In case terminology matters, all three are running in VirtualBox and using an "internal network"; all the VMs can see each other, but they can't see the host computer or the Internet. The two workstations mostly talk to each other, but occasionally they need access to a very small number of things on the Internet.

For testing purposes, I do not want to give the VMs access to the Internet, but I would like them to think that they are connecting to it. Since there are very few things that they need from the Internet, I would like to host them in the virtual network and serve them up as needed. I do not want to change the URLs that they connect to; what I want is for those URLs to somehow magically get redirected somewhere in the virtual network that all the VMs think is actually the internet. For example, if the workstations need access to "http://images.intellicast.com/WxImages/RadarLoop/usa_None_anim.gif", I would like them to use that URL but to retrieve an image that I serve them from within the virtual network.

I am not opposed to swapping out my virtual firewall for something more robust (say, a full Linux distro) if need be. So, then, my question is: how can I make a fake Internet within my virtual network so that my VMs think that they're actually accessing the actual Internet?

In order to help you help me, here's where I stand: well-versed in Windows and moderately-well-versed in Linux, but hard-core networking is iffy.
 

XavierMace

Diamond Member
Apr 20, 2013
4,307
450
126
You can use host files in Windows to send the traffic to local boxes instead, but I'm not sure how you're planning on acquiring and hosting all the internet content.
 

Brian Phillips

Junior Member
Feb 2, 2017
2
0
1
You can use host files in Windows to send the traffic to local boxes instead, but I'm not sure how you're planning on acquiring and hosting all the internet content.
I don't need to host the entire Internet. I just need about 10 specific pages/images from the Internet. They don't even have to be real-time accurate; I'm just testing a few computers and don't want to have to change URLs between the test environment and live.
 

VirtualLarry

No Lifer
Aug 25, 2001
56,343
10,045
126
Couldn't you potentially use a Squid cache system, access the pages while connected to the internet, then disconnect and mark the squid cache read-only? I don't know much about squid configuration, have no idea if you could do that.
 
Feb 25, 2011
16,790
1,472
126
Nah, just create a pi hole. Do the local DNS to sub the domain you're hitting with a local server instead. Have it serve up dummy pages with whatever content you need. (Does it really matter?)

When you're done testing, "fix" the DNS server and you're done.
 

Red Squirrel

No Lifer
May 24, 2003
67,385
12,131
126
www.anyf.ca
You could create more VMs on a separate virtual network that host internet stuff, like a DNS server, web server etc. Then setup a virtual router that connects to that network. Have that network also provide DHCP and pretend that is the ISP.

Software/network side, the internet is just a big network. If you want to simulate the hardware side too you could try to find an old DSLAM or something, that could be kinda fun to mess with. You could mix VMs and physical hardware together as you see fit to create a rather complex virtual internet, so to speak.