Many of you have reached out and asked me how do I get internet to my homelab? My setup is a little more complicated than just plugging in an ethernet cable to my existing router. I share my vCenter cluster with my lab and my self-hosted applications. I keep both my lab network and my “production” network separate.
Hi All – Welcome to my channel, I’m Alex Hubbard, I’m a Sr. Sys Admin and Cybersecurity Engineer. I have over 15 years of experience in the IT field. If you’re new to the channel, please subscribe below. If you’ve been here before, welcome back. Be sure to check out my Instagram @ach_sysadmin.
Overview
This overview, assumes that you have some basic knowledge of pFSense, VMware and networking. I want to show you the physical aspect of my lab setup before we jump into VMWare. I won’t get into how I handle my home or “production” network in this video.
The lab consists of 2 hosts, a Dell R720, which is my ACH-ESX01 host, and a Dell R730 (ACH-ESX02). On the back of an R720 or R730, there are typically 4 NIC cards. Keep in mind, there may be some variations between models. Looking at the system from the back, the NICs are numbered 0-3, left to right. NIC1 on both hosts is my “WAN” connection. NIC2 is my “LAN” connection. This will be important to remember when we jump into VMWare.
I’ve cabled my hosts identically. I’ve also color coded my cabling. Yellow indicates an uplink to a firewall, router or switch. Red indicates LAN or Production.
On my first host, ACH-ESX01, I have a virtual pFSense appliance. This is my lab firewall. We can ignore ACH-ESX02 for the time being as I do not have a virtual firewall on it at this time. So how do we get an internet connection to it?
Physical Network Connections
![Get Internet To Homelab Visio Diagram 1](https://achubbard.com/wp-content/uploads/2021/11/image-1024x798.png)
I have two internet connection in my home, but I only feed one of them to my lab. The connection we’ll look at today is my Cox Business connection. I have several static IPs on this account. 1 I use for fail-over for my home, another provides internet to my lab. How do we split that up since the modem only has 1 active LAN port? That’s easy! VLANS!
Ubiquiti Unifi VLAN Setup
On my Ubiquiti controller, I created a VLAN. I called it COX-WAN-VLAN5 and it’s number is, 5. To do this, make sure you’re in the older/legacy Ubiquiti interface. Navigate to Settings > Networks > Create a New Network > VLAN Only. As a side note, if you’re not in a Unifi environment, you could use an unmanaged switch or create a VLAN on whatever network product you are using to achieve the same result.
![Get Internet To Homelab Unifi Networks](https://achubbard.com/wp-content/uploads/2021/11/1-Vlan5-Unifi-Networks-1024x352.png)
Instead of plugging my Arris SB8200 right into my firewall or UDM-P for my main network, I took the output from the modem, and plugged it into an open port on my Ubiquiti Switch. That port had been assigned to VLAN5. You can assign the port to VLAN5 by going into Devices and finding your switch.
![Get Internet To Homelab Unifi Devices](https://achubbard.com/wp-content/uploads/2021/11/2-Unifi-Devices.png)
Ubiquiti Unifi Device Configuration – Core Switch
Click on it, and on the right-hand side, you’ll see a menu/window appear. Select the port you connected your modem to. Click it.
![Get Internet To Homelab Unifi Switch Ports](https://achubbard.com/wp-content/uploads/2021/11/3-Unifi-Core-Sw.png)
I used Port 45. Select that port, a list of ports will appear. Scroll down and find Port 45 again. Hit the edit button, the little blue pencil.
![Get Internet To Homelab Unifi Switch Ports](https://achubbard.com/wp-content/uploads/2021/11/4-Unifi-Core-Sw-Ports.png)
Give your port a descriptive name so that you know what you’re looking at and don’t have to guess every time. Under Switch Port Profile, find your VLAN5 network. Hit the apply button.
![Get Internet To Homelab Unifi Switch Port Configuration](https://achubbard.com/wp-content/uploads/2021/11/5-Unifi-Core-Sw-Port45.png)
Now we need to send VLAN5 to the back of rack switch, my 24 port Ubiquiti. I have a 10gig trunk port between the two switches.
On my core switch, port 51 is the trunk port. Looking at the switch port profile, you can see it’s set to all.
![Get Internet To Homelab Unifi Trunk Port](https://achubbard.com/wp-content/uploads/2021/11/6-Unifi-Core-Sw-TrunkPort.png)
Ubiquiti Unifi Device Configuration – Back of Rack Switch
My uplink port on the back of rack switch is also set to the same configuration. We can now access VLAN5 on the back of rack switch.
![Get Internet To Homelab Unifi Trunk Port](https://achubbard.com/wp-content/uploads/2021/11/7-Unifi-BOR-Sw-TrunkPort.png)
We’re going to take a look at switch port 4 on my back of rack switch, you can see that the Switch Port Profile is set to COX-WAN-VLAN5. This is essentially placing this switch port on VLAN5. This switch port then connects to my host, ACH-ESX01, and presents a WAN connection to the virtual firewall appliance that resides there.
![Get Internet To Homelab Unifi Switch Port VLAN5](https://achubbard.com/wp-content/uploads/2021/11/8-Unifi-BOR-Sw-Port4.png)
VMware Network Topology
Moving over to our VMWare environment, this is a rough diagram of how things are connected, logically.
![Get Internet To Homelab Visio Diagram 2](https://achubbard.com/wp-content/uploads/2021/11/9-Visio-Logical-1024x673.png)
VMware Virtual Network Configurations
Checking out the Networking section on ESX01, you can see I have LAB_WAN_SW, LAB_LAN_SW and their associated port groups.
![VMware Networking Menu](https://achubbard.com/wp-content/uploads/2021/11/10-VMware-NetworkingMenu.png)
LAB_WAN_SW has an uplink to physical NIC1 (Remember early on I said know the number of the NIC was going to be needed later on?)
![VMware Switch](https://achubbard.com/wp-content/uploads/2021/11/11-VMware-Lab-Wan-Sw.png)
LAB_LAN_SW has an uplink to physical NIC2.
![VMware Switch](https://achubbard.com/wp-content/uploads/2021/11/12-VMware-Lab-Lan-Sw.png)
The port group is what is presented to the virtual machine. Think of it as a way to break or divy up your virtual switch.
![Get Internet To Homelab VMware Port Group](https://achubbard.com/wp-content/uploads/2021/11/13-VMware-Lab-Wan-Pg.png)
![VMware Port Group](https://achubbard.com/wp-content/uploads/2021/11/14-VMware-Lab-Wan-Pg2-1024x392.png)
The LAN side of things is setup identically to the WAN side, with the exception it has a different physical NIC.
![VMware Port Group](https://achubbard.com/wp-content/uploads/2021/11/15-VMware-Lab-Lan-Pg.png)
![Get Internet To Homelab VMware Port Group](https://achubbard.com/wp-content/uploads/2021/11/16-VMware-Lab-Lan-Pg2-1024x331.png)
Taking a look at the settings for my virtual firewall, I have 2 network adapters presented to it. 1 on the LAB_LAN_PG and one on the LAB_WAN_PG. You’ll want to note the MAC addresses presented below each NIC
![pfsense VMware Settings](https://achubbard.com/wp-content/uploads/2021/11/17-VMware-Lab-Fw01.png)
pFSense
In the pFSense console, you can see we have a WAN and a LAN connection. I’ve already got this setup, but I will show you how you pick your NICs/PGs.
![Get Internet To Homelab pFsense](https://achubbard.com/wp-content/uploads/2021/11/18-pfsense1.png)
Press 1 to assign interfaces. This is where you’ll need the MAC addresses to distinguish which NIC is which.
00:0c:29:d1:de:b3 is our LAN NIC
00:0c:29:d1:de:bd is our WAN NIC
![Get Internet To Homelab pFsense](https://achubbard.com/wp-content/uploads/2021/11/19-pfsense2.png)
Select No, we are not going to setup VLANs.
![pFsense interfaces](https://achubbard.com/wp-content/uploads/2021/11/20-pfsense3.png)
Le1 is going to be our WAN interface. Type le1. I find that auto doesn’t always work.
![Get Internet To Homelab pFsense](https://achubbard.com/wp-content/uploads/2021/11/21-pfsense4.png)
Select le0 for our LAN interface.
![Get Internet To Homelab pFsense](https://achubbard.com/wp-content/uploads/2021/11/22-pfsense5.png)
Select Yes.
We will need to set our IP addresses. Select 2 from the main menu.
![Get Internet To Homelab pFsense](https://achubbard.com/wp-content/uploads/2021/11/23-pfsense6-1024x473.png)
We’ll start with 1, the WAN. Hit 1. Follow the prompts to add your WAN IP, Mask, and Gateway
![Get Internet To Homelab pFsense](https://achubbard.com/wp-content/uploads/2021/11/24-pfsense7-1024x478.png)
We’re not going to configure it for IPv6, so select no for any questions related to it.
![Get Internet To Homelab pFsense](https://achubbard.com/wp-content/uploads/2021/11/25-pfsense8-1024x162.png)
![Get Internet To Homelab pFsense](https://achubbard.com/wp-content/uploads/2021/11/26-pfsense9-1024x355.png)
We’ll need to repeat this process for the LAN side of the firewall. Then we can jump into the GUI.
Press 2 again from the main menu.
Select 2 to pick your LAN interface.
![Get Internet To Homelab pFsense](https://achubbard.com/wp-content/uploads/2021/11/27-pfsense10-1024x91.png)
Enter the pertinent info for your lab network. I opt not to turn DHCP on as that is handled by my Domain Controller.
![Get Internet To Homelab pFsense](https://achubbard.com/wp-content/uploads/2021/11/28-pfsense11-1024x528.png)
Now we’ve got LAN and WAN IPs assigned to our lab firewall. You can hit option 7 and perform a test ping. Let’s ping Google’s public DNS server, 8.8.8.8
![Get Internet To Homelab pFsense](https://achubbard.com/wp-content/uploads/2021/11/29-pfsense12-1024x447.png)
You can see 3 responses, indicating the system can get out to the web.
VMware Virtual Test PC Network Settings
On one of your lab VMs, make sure the network adapter is set to LAB_LAN_PG.
![VMware Lab VM Network Config](https://achubbard.com/wp-content/uploads/2021/11/30-VMware-Lab-Win10B-Settings.png)
If you opted to enable DHCP on your firewall, you should get an IP address on your lab workstation/VM. I have my LAB-DC01 providing DHCP. Additionally, you could give your system a static IP. Open up a web browser and navigate to the LAN IP of the pFSense firewall and login. You can now administer your firewall from here. You SHOULD be able to open up another browser and hit a webpage.
Also, I use my Domain Controllers for DNS. I do not use pFSense for this.
![pFsense web gui](https://achubbard.com/wp-content/uploads/2021/11/31-pfsense-web-gui-1024x461.png)
I hope this overview helped you understand how you can get internet to your lab environment. This is the way that I accomplish it, there are likely other or better ways to accomplish this. If you enjoyed this video, please subscribe and hit that like button below. Give my new Instagram page a follow as well @ach_sysadmin.