This environment is used to build up the lab set-up. It provides the base network and hosts. The entire network is built up in VirtualBox, using Vagrant and Ansible.
The network consists of 4 subnets:
- 172.30.0.0/16: internal company LAN.
- 192.168.62.254/24: fake internet.
- 172.10.10.0/24: employee home LAN.
- 10.0.2.0/24: VirtualBox NAT network.
-
Create the following host-only network in VirtualBox to simulate the the fake internet:
- Name:
vboxnet1
(when different, for example on Windows: "VirtualBox Host-Only Ethernet Adapter #2", change this in theVagrantfile
) - IP range: 192.168.62.0/24
- Name:
-
Make sure your vagrant boxes are up to date:
vagrant box update
-
vagrant up --parallel
or go slowly (1 by 1) and dovagrant up <vm_name>
-
Disable all the NAT connections added by vagrant:
python ./disable-nat.py
⚠️ vagrant ssh
won't work anymore and that is by design! This command is also not available in a real network, so learn to use SSH properly: login into the required hosts using SSH with IP addresses and jump/forward options! -
SSH into the isprouter VM:
ssh vagrant@192.168.62.254
💡 It could be that you have to wait a minute until the isprouter VM has booted and accepts SSH requests.
💡 Vagrant boxes often use the following credentials:
- username:
vagrant
- password:
vagrant
- username:
-
Execute the following commands. This can take a while!
isprouter:~$ cd ansible/ isprouter:~/ansible$ find . -type f -not -path "./files/web/app.jar" -print0 | xargs -0 dos2unix isprouter:~/ansible$ chmod u+x run-on-isprouter.sh isprouter:~/ansible$ sudo ./run-on-isprouter.sh ... # Use the following command to check if the network is setup OK isprouter:~/ansible$ sudo ansible-playbook --inventory inventory.yml check.yml
💡 We have added
dos2unix
here for Windows users, but why do they need this? Tip: Linux users don't need this. Tip2:\r\n
vs.\n
.