Cara Konfigurasi DHCP Server di DEBIAN 9 VIRTUALBOX Mudah dan Jelas
Table of Contents
Introduction
This tutorial guides you through the process of configuring a DHCP server on Debian 9 using VirtualBox. It will cover the essential steps needed to set up the DHCP server, discuss its functions, and explain how to avoid common pitfalls. This setup is crucial for efficiently managing IP addresses in a local network, simplifying IP allocation for multiple devices.
Step 1: Install VirtualBox and Debian 9
- Download VirtualBox from the official website.
- Install VirtualBox on your host operating system following the installation instructions for your specific OS.
- Download Debian 9 ISO from the Debian website.
- Create a New Virtual Machine:
- Open VirtualBox and click on "New".
- Name your VM (e.g., "Debian 9") and select "Linux" and "Debian (64-bit)" as the type.
- Allocate memory (at least 1GB recommended).
- Create a virtual hard disk (at least 10GB).
- Load Debian 9 ISO:
- Select the VM and go to "Settings".
- Under "Storage", click on the empty disk icon and choose the Debian ISO.
- Start the Virtual Machine:
- Click "Start" to boot from the ISO and follow the installation prompts to install Debian 9.
Step 2: Update Your System
- Open Terminal in Debian.
- Update Package List:
sudo apt update
- Upgrade Installed Packages:
sudo apt upgrade
Step 3: Install DHCP Server
- Install DHCP Server Package:
sudo apt install isc-dhcp-server
Step 4: Configure the DHCP Server
- Open the DHCP Configuration File:
sudo nano /etc/dhcp/dhcpd.conf
- Add Configuration Settings:
- Define your network range and options. For example:
subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.10 192.168.1.50; option routers 192.168.1.1; option domain-name-servers 8.8.8.8, 8.8.4.4; }
- Save and Exit the editor (Ctrl + O, Enter, Ctrl + X).
Step 5: Specify Network Interfaces
- Edit the DHCP Server Default File:
sudo nano /etc/default/isc-dhcp-server
- Specify the Interface:
- Find the line starting with
INTERFACESv4
and add your network interface (e.g.,eth0
):
INTERFACESv4="eth0"
- Find the line starting with
- Save and Exit the editor.
Step 6: Start and Enable the DHCP Server
- Start the DHCP Service:
sudo systemctl start isc-dhcp-server
- Enable the DHCP Service to Start on Boot:
sudo systemctl enable isc-dhcp-server
Step 7: Verify DHCP Server Status
-
Check the Status of the DHCP Server:
sudo systemctl status isc-dhcp-server
- Ensure it is active and running without errors.
-
Test DHCP Server Functionality:
- Connect a client device (another VM or a physical machine) to the same network and verify it receives an IP address from the DHCP server.
Conclusion
You've successfully configured a DHCP server in Debian 9 on VirtualBox. This setup automates IP address allocation, prevents conflicts, and simplifies network management. Explore additional configurations and settings in the DHCP configuration file to tailor the server to your specific needs. Consider setting up DHCP reservations for critical devices to ensure they always receive the same IP address.