Linux operating system is known for its versatility and affordability. It is an open-source operating system, which means anyone can access the source code and modify it for their use. It also means that there are several Linux distributions available in the market – some are geared towards enterprise use, and some are for individual use. One of the most popular Linux distributions is Debian. Debian is known for its stability, security, and easy installation process. It is also a great choice for setting up servers; it has all the necessary packages and tools to get started with any kind of server. In this article, we will learn how to install and configure a DHCP and FTP server in Debian.
Cara Install dan Konfigurasi DHCP server di Debian 9
DHCP stands for Dynamic Host Configuration Protocol. A DHCP server is a network server that automatically provides and assigns IP addresses, default gateways, and other network parameters to client devices. It makes networking much easier and hassle-free as the server controls the IP address allocation rather than you having to assign them manually.
To install and configure DHCP server in Debian 9, follow these steps:
Step 1: Update the system
Before installing any new package, it is essential to update the system and its packages. Open the terminal and type in the following command:
sudo apt update
Step 2: Install DHCP Server
After updating the system, the next step is to install the DHCP server package. Type in the following command in the terminal:
sudo apt install isc-dhcp-server
After installing the package, we need to configure the DHCP server. The first step is to edit the dhcpd.conf file.
Step 3: Configure DHCP Server
To configure the DHCP server, type in the following command:
sudo nano /etc/dhcp/dhcpd.conf
It will open up the dhcpd.conf file. Delete all the content of the file and add the following lines:
option domain-name "yourdomain.com";
option domain-name-servers ns1.yourdomain.com, ns2.yourdomain.com;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0
range 192.168.1.10 192.168.1.100;
option routers 192.168.1.1;
option broadcast-address 192.168.1.255;
The above configuration indicates that the DHCP server will issue IP addresses on the 192.168.1.x network with a netmask of 255.255.255.0. The DHCP server will assign addresses ranging from 192.168.1.10 to 192.168.1.100 with a default lease time of 600 seconds (10 minutes) and a maximum lease time of 7200 seconds (2 hours).
The “option routers
” line specifies the IP address of the default gateway/router in the network. The “option broadcast-address
” line specifies the broadcast address for the network.
After configuring the DHCP server, we need to assign a static IP address to the network interface that the DHCP server will use to provide IP addresses.
Step 4: Assign Static IP Address to Network Interface
To assign a static IP address, type in the following command:
sudo nano /etc/network/interfaces
It will open up the interfaces file. Delete all the content of the file and add the following lines:
auto enp0s3
iface enp0s3 inet static
address 192.168.1.1
netmask 255.255.255.0
Replace “enp0s3
” with the name of your network interface. The “address
” line specifies the static IP address you want to assign to your network interface. Save and exit the file.
After configuring the DHCP server and assigning a static IP address to the network interface, the next step is to start the DHCP service. Type in the following command:
sudo systemctl start isc-dhcp-server.service
To make sure that the DHCP service starts automatically at boot time, type in the following command:
sudo systemctl enable isc-dhcp-server.service
That’s it! Your DHCP server is now up and running.
Cara Install dan Konfigurasi FTP Server di Debian 8 Virtualbox
FTP (File Transfer Protocol) is a standard protocol used to transfer files from one host to another over a TCP-based network, such as the Internet. An FTP server is a software program that runs on a computer and accepts FTP connections from remote clients. The clients can then upload or download files from the server. Setting up an FTP server in Debian is easy and straightforward, as it has all the necessary packages and tools. However, in this example, we will demonstrate how to set up an FTP server on a Debian 8 VirtualBox.
To install and configure FTP server in Debian 8 VirtualBox, follow these steps:
Step 1: Install vsftpd package
Type in the following command in the terminal:
sudo apt-get update
sudo apt-get install vsftpd
Once it is done installing, the service is running, and the default configuration file is in place, which means you have a functional FTP server up and running on your Debian 8 VirtualBox.
Step 2: Configure vsftpd
The default vsftpd configuration allows anonymous logins but does not allow uploads. If you want to allow uploads, you will need to modify the configuration file.
To open the configuration file, type in the following command:
sudo nano /etc/vsftpd.conf
Locate the line “#write_enable=YES
” and uncomment it:
write_enable=YES
Save and exit the file.
Step 3: Test the FTP server
Now it’s time to test our FTP server. Open your preferred FTP client, such as FileZilla. Enter the IP address of the Debian 8 VirtualBox instance as the host, and use the default FTP port, 21. Enter the username as “anonymous” and leave the password field blank.
Once you have logged in, you should see the following message:
230 Login successful.
You can now transfer files between your client and server.
FAQ
1. What is DHCP?
DHCP stands for Dynamic Host Configuration Protocol. It is a network server that automatically provides and assigns IP addresses, default gateways, and other network parameters to client devices. It makes networking much easier and hassle-free, as the server controls the IP address allocation rather than you having to assign it manually.
2. What is FTP?
FTP stands for File Transfer Protocol. It is a standard protocol used to transfer files from one host to another over a TCP-based network, such as the Internet. An FTP server is a software program that runs on a computer and accepts FTP connections from remote clients. The clients can then upload or download files from the server.
Include Video YouTube
Conclusion:
Setting up a DHCP and FTP server in Debian is easy and straightforward with all the necessary packages and tools. DHCP makes networking much more accessible and hassle-free, while FTP allows you to transfer files from one host to another over the internet. With the above steps, you can easily install and configure DHCP and FTP servers on Debian, and your servers will be up and running in no time.