Skip to content

burakcanbalta/pfsense-network-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

116 Commits
Β 
Β 

Repository files navigation

TOPOLOJΔ°

πŸ›‘οΈ Network Segmentation and Service Configuration Lab with pfSense (Windows, Kali, Ubuntu)

This document covers the setup of a virtual lab environment using pfSense, Windows, Kali Linux, and Ubuntu Server to implement network segmentation, configure DHCP, DNS, and FTP services, and apply firewall rules. Each step is documented with relevant screenshots for clarity.

🌐 pfSense Installation and Initial Configuration πŸ–₯️ Installation Steps

Download the pfSense ISO image. Launch the installation and complete the disk partitioning.

pfsense kurulum

Important: Before rebooting, go to Devices > Optical Drives and unmount the ISO file. Otherwise, the installation process will restart. After a successful installation, you'll see the pfSense console interface.

3

Change the LAN IP address. Default pfSense LAN is typically set to 192.168.1.1, but you must adjust it according to your VirtualBox Host-Only Adapter subnet (e.g., 192.168.56.1) to gain web interface access.

Ekran gΓΆrΓΌntΓΌsΓΌ 2025-07-16 124036 a b c d

🧱 LAN Segmentation & Topology Overview Three additional VMs are installed:

πŸͺŸ Windows 10

🐱 Kali Linux

🐧 Ubuntu Server

Each VM is attached to a separate Host-Only Adapter for network segmentation.

vb host only 2 3 4 win0 kali0 ubuntuvm ubuntuvm1 pfsense1 pfsense2 pfsense3 pfsense4

Start the pfSense VM and configure the newly added interfaces

shell

πŸ”Œ VirtualBox Network Configuration Navigate to File > Preferences > Network > Host-Only Networks

Create 3 new Host-Only Adapters (one per VM)

Assign each adapter to a pfSense OPT interface

Start the pfSense VM and configure the newly added interfaces

🌍 Interface Definitions

ArayΓΌz TanΔ±m IP Adresi
WAN NAT Otomatik (DHCP)
LAN HOST-ONLY 10.10.10.1
  • Access the pfSense web interface at https://10.10.10.1
  • Default credentials: Username: admin, Password: pfsense.
ekran

🧰 Ubuntu Server: DHCP, DNS, and FTP Configuration πŸ–₯️ Set a Static IP (via Netplan)

sudo nano /etc/netplan/00-installer-config.yaml

Sample configuration (adjust interface name accordingly):

statik 1

❗You should replace enp0s8 with your own network graph name. Using the 'ip a' command:

sudo netplan apply

πŸ“ Ubuntu IP: 30.30.30.101/24 (Statik)

πŸ”„ Configure DHCP Server

sudo apt update
sudo apt install isc-dhcp-server
sudo nano /etc/dhcp/dhcpd.conf

Edit DHCP configuration:

dhcp conf

Set interface in:

sudo nano /etc/default/isc-dhcp-server

We check the DHCP service distribution and enter the interface names. INTERFACESv4="enp0s3" And we restart the DHCP service:

sudo systemctl restart isc-dhcp-server
sudo systemctl status isc-dhcp-server
dhcp status

🌐 Configure DNS (BIND9)

sudo apt install bind9
sudo nano /etc/bind/named.conf.options
namedconf

Restart service:

sudo systemctl restart bind9
bind9

πŸ“ FTP SERVER

sudo apt install vsftpd -y
sudo systemctl enable vsftpd
sudo adduser ftpuser (We create a username and password)

πŸ“„ Edit FTP configuration:

 sudo nano /etc/vsftpd.conf
vsftpset

Restart the service: sudo systemctl restart vsftpd

vsftpd
  • FTP access is defined for users.
ftp localhost 
FTPLOCAL

πŸ”’ Firewall Rules and Access Controls

πŸ”’ Firewall Rules and Access Controls

Rule Status
LAN1 β†’ OPT1 ❌ Block
OPT1 -> LAN1 ❌ Block
OPT1 β†’ FTP(30.30.30.101) ❌ Block
LAN1 β†’ FTP(30.30.30.101) βœ… Allow
All LANs β†’ WAN βœ… Allow

βœ… Only specific traffic is allowed to ensure segmented and secure communication. DHCP will automatically provide the ability to run and maintain the external network!

***Client Systems

  • πŸͺŸ Windows: Connected to LAN1
windows win lan1 opt2
  • 🩻 Kali Linux: Connected to OPT1
kali
  • 🐧 Ubuntu Server: Connected to OP2
ubuntu

πŸ›‘οΈ pfSense

ekran
  • LAN interface connects to the internet via WAN.
googlegidiyo

FIREWALL RULES :

WAN lan1 lan2 lan3

SETTΔ°NG DHCP RELAY:

dhcprelay

Set the target interface and specify the DHCP server IP (e.g., Ubuntu DHCP IP)

πŸ“š References

https://www.networkreverse.com/2020/06/how-to-build-linux-router-with-ubuntu.html

https://medium.com/@sydasif78/setting-up-a-dhcp-server-on-ubuntu-a-guide-for-network-engineer-d620c5d7afb2

https://medium.com/@sydasif78/setting-up-a-dns-server-on-ubuntu-a-guide-for-network-engineer-8890e634aab3

https://medium.com/@haticeadiguzel/pfsense-4b9092e71ced

https://www.freecodecamp.org/news/setting-a-static-ip-in-ubuntu-linux-ip-address-tutorial/

https://medium.com/@akardev/dual-boot-ubuntu-22-04-lts-kurulumu-1217ed7bf2fe

About

A security-focused network lab with pfSense and multi-OS service configuration for educational and testing purposes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors