Contact
- Slack: @nanjuan on wcscusf.slack.com
- Email: nestor@nntorres.com
Table
Prerequisites
- Have Network Adapter setuprunning
- If you have not setup your network adapter look here https://goo.gl/vs4cHC.
- Just copy the Prerequisites of peoples guides before yours here.
- Have your virtual environment configured
- Have the ISP gateway running.
- Have pfSense running.
Summary
The logical ideal of this tutorial is for you to be able to setup the ISP server for your lab. The ISP lab is the one that allow you to connect your other lab to the internet think at it as your internet provider at home.
| Network adapters | Description |
|---|---|
| Adapter 1 | Leave it to NAT |
| Adapter 2 | Change to Host-only (WAN Environment) |
VirtualBox VM Setup
- Go to Ubuntu and download the LTS server version.
- Install Ubuntu Server in Virtual Machine
- On Virtual Box go to top left corner to
Newto create the virtual box.

- Create the name of this Box recommended name
ISP Ubuntu - In Type choose
Linuxif is not auto setected - In Version choose
Ubuntu (64-bit)

- On the memory section depending to your machine
RAMcapacity the minimun should be(254MB)but if you have enough memory use(1024MB)

- Leave the Hard drive section as default which is
(Create a virutal hard disk now)

- Leave the Hard disk file type to
(VDI)

- Leave storage on physical hard disk to
(Dynamically allocated)this will used the hard drive memory dinamically until it reach the max you gave it on the next step.

- For this machine the minimun for Ubuntu so it does not give you problem set the File location and
size to (20.00GB)

- After the Virtual Machine is created now you have to add the
ISOthat you download at the beginning - Go to Storage section and click on top that it say
[Optical Drive]Empty

- Then press
Choose disk image...

- Find the location where you download your ISO for Ubuntu Server.

-
On this step make sure you add the network adapters to the server
-
Right clicktheISP Ubuntuand clicksettings

- On network adapter one leave it to
NAT - Then go to Network Adapter 2 and change the network adapter to
WAN Environmentlike the picture bellow.

-
On this part start the ISP ubuntu virtual box to start the setup.
-
Click on the
ISP Ubuntuthen pressstart

Ubuntu Server installation
- The setup of the ISP Ubuntu on the photos bellow
- select you language

- Press enter on
Install Ubuntu Server

- Select the language again

- Select your location

- Press
noon the Configure the Keyboard

- Select Keyboard language


- Select
enp0s3which is theNATthis might vary on your PC

- Set the
Hostnameof you VM machine to whatever you want

- Set the full name for
new user


- Then set your
Usernamefor your account

- Set the new user
password

- verify password again

- Select if you want to encrypt your home directory
I advice to select no for this test lab

- Select your
Time zoneif the one shown is correct press yes otherwise press no

- Select Partition disks select the
defaultthe one on the picture.

- Select disk partition the
default

- On the next step select
YESon configure LVM

- Select the partition size
you need to leave it as default

- Press
yeson write the changes to disks

Do notset a proxy leave black and press continue

- The update question is all up to you. Can be setup to
no auto updatesorinstall security updates automatically

- On the
sofware selectionfor this lableave default

- on the install the grub boot loader question select
YES

- On the last question select
continue

Ubuntu Server Configuration
- After Reboot log in into computer with the
usernameyou setup early and enterpasswordto log in

- First step run
sudo apt-get updatesudo apt-get upgradeto make sure the system is up to date. - Enable ipv4 routing on Ubuntu. By default Ubuntu doesn’t allow for routing on IP traffic.
- To get this done you will need to edit
sysctl.confwhich is on the directory /etc/. - This can be done by using nano like so,
sudo nano /etc/sysctl.conf. - It will require your
root passwordsince it effect the entire system when you edit this file.

- Go to the line that say
Uncomment the next line to enable packet forwarding for IPv4and the remove the symbol#by removing the#sign this will make the program read and use that line toenable packet forwarding.

- Then press
control+Xto save the config file on ubuntu and enterYto confirm the file and safe the file

- Then press
Enterto make sure the file name stay the same

- Next step run command
ip link showto see which network interfaces are up it will look like the picture bellow - You should have you loopback
loand your network adaptersenp0s3andenp0s8or similars.

- You will need to add another interface to the server which is going to be the ip address for your lap to go into th einternet.
- Run command on the terminal
sudo nano /etc/network/interfacesand enter your admin password

- Then you will see a text file like bellow

- Then add the new network adapter like bellow
- ISP sever network interface
auto enp0s8iface enp0s8 inet staticaddress 172.31.11.1netmask 255.255.255.248up route add -net 172.0.0.0 netmask 255.0.0.0 gw 172.31.1.2

- Then press
control Xto exit andYto save file then enter to leave the file with the same name do not change the file name

- run
sudo rebooton the terminal this will reboot the machine and the seeting on the interfaces will take effect - Then run
routeron the terminal after it reboot it shout look like picture bellow

- Then run the next line on terminal this will add the new network adapter to your network route.
sudo route add –net 172.0.0.0 netmask 255.0.0.0 gw 172.31.1.3 dev enp0s8

- Then run
routeagain to verify it took effect

- Then run
sudo services networking restartto restard the network services nothing will display it only going to ask you for your admin password. This will restard your network services for the code above take effect.

- Then to verify everything is working fine run
ifconfigthe enp0s8 should have the infomation you enter like bellow

- Before running the following command run
sudo apt-get update and upgradeandsudo apt-get install iptables-persistantthis will make the followin lines work correctly. - Then run this tree line on terminal like the picture bellow this will enable persistent on the iptables.
sudo apt-get install -y iptables-persistent

- Then on the next two question select yes like bellow

- Run next line bellow and password if ask it will not display anything after you run the line same as above is to make the iptables not reset.
sudo iptables -t nat -A POSTROUTING -o enp0s3 -j MASQUERADE

- Run next line bellow and password if as and it will look like the picture bellows
sudo netfilter-persistent save

- Run next line bellow and password if as and it will look like the picture bellows
sudo netfilter-persistent reload

- After all this reboot Virtual Machine which can be done by running the following command
sudo reboot nowand move to next step pfsense setup.