How to Install a DHCP Server in Ubuntu and Debian. Dynamic Host Configuration Protocol (DHCP) is a network protocol that is used to enable host computers to be automatically assigned IP addresses and related network configurations from a server. The IP address assigned by a DHCP server to DHCP client is on a “lease”, the lease time normally varies depending on how long a client computer is likely to require the connection or DHCP configuration. How Does DHCP Work? The following is a quick description of how DHCP actually works: Once a client (that is configured to use DHCP) and connected to a network boots up, it sends a DHCPDISCOVER packet to the DHCP server.
When the DHCP server receives the DHCPDISCOVER request packet, it replies with a DHCPOFFER packet. Then the client gets the DHCPOFFER packet, and it sends a DHCPREQUEST packet to the server showing it is ready to receive the network configuration information provided in the DHCPOFFER packet. Finally, after the DHCP server receives the DHCPREQUEST packet from the client, it sends the DHCPACK packet showing that the client is now permitted to use the IP address assigned to it. In this article, we will show you how to setup a DHCP server in Ubuntu/Debian Linux, and we will run all the commands with the sudo command to gain root user privileges. Testing Environment Setup. We are going to use following testing environment for this setup. DHCP Server - Ubuntu 1. DHCP Clients - Cent. OS 7 and Fedora 2. Step 1: Installing DHCP Server in Ubuntu. Run the command below to install the DCHP server package, which was formerly known as dhcp. When the installation completes, edit the file /etc/default/isc- dhcp- server to define the interfaces DHCPD should use to serve DHCP requests, with the INTERFACES option. For example, if you want the DHCPD daemon to listen on eth. INTERFACES=. The main DHCP configuration file is /etc/dhcp/dhcpd. And, there are two types of statements defined in the DHCP configuration file, these are: parameters – specify how to perform a task, whether to carry out a task, or what network configuration options to send to the DHCP client. Now, open and modify the main configuration file, define your DHCP server options: $ sudo vi /etc/dhcp/dhcpd. Question: How to install Python 3.x in Ubuntu, Fedora & Centos? Answer: 1- To be able to compile Python Source, you will need few packages. Open terminal and execute. In this article, we will explain you how to setup a DHCP server in Ubuntu and Debian distributions, as well as how to configure a client machine to use dhcp. Set the following global parameters at the top of the file, they will apply to all the declarations below (do specify values that apply to your scenario): option domain- name . Now, define a subnetwork; here, we’ll setup DHCP for 1. LAN network (use parameters that apply to your scenario). To assign a fixed (static) IP address to a particular client computer, add the section below where you need to explicitly specify it’s MAC addresses and the IP to be statically assigned: host centos- node . Next, start the DHCP service for the time being, and enable it to start automatically from the next system boot, like so: -- -- -- -- -- -- System. D - -- -- -- -- -- -. Sys. Vinit - -- -- -- -- -- -. Next, do not forget to permit DHCP service (DHCPD daemon listens on port 6. UDP) on firewall as below: $ sudo ufw allow 6. Step 4: Configuring DHCP Client Machines. At this point, you can configure your clients computers on the network to automatically receive IP addresses from the DHCP server. Login to the client computers and edit the Ethernet interface configuration file as follows (take note of the interface name/number): $ sudo vi /etc/network/interfaces. And define the options below: auto eth. Save the file and exit. And restart network services like so (or reboot the system): -- -- -- -- -- -- System. D - -- -- -- -- -- -. Sys. Vinit - -- -- -- -- -- -. Alternatively, use the GUI on a desktop machine to perform the settings, set the Method to Automatic (DHCP) as shown in the screenshot below (Fedora 2. Set DHCP Network in Fedora. At this point, if all settings are correctly configured, your client machine should be receiving IP addresses automatically from the DHCP server. That’s it! In this tutorial, we showed you how to setup a DHCP server in Ubuntu/Debian. Share your thoughts with us via the feedback section below. If you are using Fedora based distribution, go through how to setup a DHCP server in Cent. How To Install and Setup Bind. On Ubuntu Server. So you knew how to manually install and setup a Linux, Apache, My. SQL and PHP (also known as LAMP Stack) on a server based on Ubuntu. You may be wondering how to make your server being accessible by domain not by IP address. Well, there are several ways you can do that but the key method is simple: by using DNS Server. There are two methods to have DNS Server connecting your domain to your server: First, you can simply use DNS management service which is usually offered freely by most of domain registrar like Go. Daddy and Name. Cheap; Another method is to install and setup your own DNS server right inside your operating system to manage how the way your domain resolves to your server. I will explain the first method another day while today in this page you’ll see the second method. When I say “server” it refers to both VPS or Dedicated server. This tutorial is done on Ubuntu- based server. I am running Ubuntu 1. Windows users should download Putty while Mac and Linux users can simply use Terminal. You’ll also need a basic skill to use Putty and to navigate through SSH. Read: Most common Unix commands used to SSH. In this tutorial I will use Bind. DNS management software available for most Operating System including Unix- based OS. I will not explain what is BIND and what are its key features as Wikipedia covers that topics better. Read: What is DNS Management Software and comparison of available software. You may firstly install LAMP stack or any other stack you wish. About 1. 5 minutes of your time and a cup of tea if you like. Step 1. Login to your server. Launch Putty (or Terminal) and login to your server via SSH connection. Please remember if you’ve followed our very basic guide here, you may already have disabled root login or changing default SSH port from 2. If you really did disable root login, then login by using new username and password you created then type following command once you logged in, otherwise you can simply skip this command: sudo suthen you have to enter root password. Step 2. Install Bind. Type this command then hit enter: apt- get install bind. Once done you’ll see a message saying: * Starting domain name service.. Basic Configuration. So you have installed BIND9 on your server. It is time to show you a basic configuration how to setup your domain to resolve to your server. Here’s what I did. Type following command then hit Enter on your keyboard: nano /etc/bind/named. Nano editor screen will appear. Copy- paste command below into your favorite text editor like Notepad, Notepad. Notepad++: zone . E. g: servermom. com. Also, you have to replace xxx. IP address of your server. Once you’ve done editing necessary values, you can paste it to Nano editor screen. You can also simply type command syntax above to Nano editor screen while replacing necessary value during your typing. Now hit Control+O on your keyboard to save the file then hit Control+X to exit Nano editor. Then go to bind directory to make things easier. Type this command: cd /etc/bind. Create new directory called “zones” inside it. Use this command: mkdir zones. Now go enter that directory as well. Then create new file called “nano domain. Type this command: nano domain. Example: nano servermom. That command brings Nano editor screen up once again. Next, you can either copy these syntax to Notepad first then edit it or simply type it in Nano editor directly: ; BIND data file for domain. IN SOA ns. 1. domain. IN NS ns. 1. domain. IN NS ns. 2. domain. IN MX 1. 0 mail. domain. IN A xxx. xxx. xxx. IN A xxx. xxx. xxx. IN A xxx. xxx. xxx. IN CNAME domain. com. IN NS ns. 1. servermom. IN NS ns. 2. servermom. IN MX 1. 0 mail. servermom. IN A 1. 41. 0. 1. IN A 1. 41. 0. 1. IN A 1. 41. 0. 1. IN CNAME servermom. Otherwise simply use the same IP. Once done editing, hit Control+O to save that file then hit Control+X to exit Nano editor. Next step, it’s time to define reverse DNS lookup. Sounds not so familiar? Don’t worry simply repeat my steps. Type this command syntax: nano /etc/bind/zones/rev. That will open Nano editor screen again but this time you will edit another file. Add following lines inside that file.@ IN SOA domain. Once done, press Control+O to save followed by Control+X to exit. Example: @ IN SOA servermom. There is another file you have to edit. Run this command: nano /etc/resolv. Now add following line at very top of any lines you see there: search domain. Example: Once done, press Control+O to save followed by Control+X to exit. But to make sure that Bind. Bind. 9 service using this command: /etc/init. To conclude, in your Putty screen it will show all the command syntax used which is something like this: Step 4. Change Nameserver In Your Domain Registrar. I will not explain this last step because the way it can be done is really vary. It depends on which registrar you purchased the domain from. E. g: Go. Daddy, Name. Cheap, Name, and so on. The key point is to add ns. Once done, wait for about 2. You can confirm it easily via web browser then type your newly configured domain name: Step 5. Test Your DNSIn this case lets install additional tool called “DNS Utility”. Here’s how to install it: apt- get install dnsutils. Once the install process finished, type following command: dig domain. If everything is set correctly you’ll see something like this one below. You can also test it using third- party service like Pingdom. DNS test tool here.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
August 2017
Categories |