For testing Moodle is running on Hyper-V with Default Switch as the network device. This makes it easy to test because only the host computer has access to the Moodle LAMP server, yet the server can access the internet.
One drawback is the IP address changes every time the server is restarted. Th Moodle site stops functioning. Running this script ever time the server is started makes it so the IP is updated in config.php:As many have helped me on this site I thought I would share something too.
Someone who knows Linux more may be able automate this.