Install and Setup DHCP Server on Ubuntu Linux - 通達人驛站
2015/8/20

Install and Setup DHCP Server on Ubuntu Linux

I had installed and setup DHCP Server on Ubuntu by below steps.

Install dhcp packages


At a terminal prompt, enter the following command to install dhcpd:
sudo apt-get install isc-dhcp-server

Config dhcp server


  1. Config dhcp server as below step
    sudo vim /etc/dhcp/dhcpd.conf
    # Sample /etc/dhcpd.conf
    default-lease-time 600;
    max-lease-time 7200;
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.1.255;
    option routers 192.168.1.254;
    option domain-name-servers 192.168.1.1, 192.168.1.2;
    option domain-name "mydomain.example";

    subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.10 192.168.1.100;
    }

  2. Config dhcp server network interface
    sudo vim /etc/network/interfaces
    #eth1
    auto eth1
    iface eth1 inet static
    address 192.168.1.1
    netmask 255.255.255.0

  3. Select Interface card of dhcp server
    sudo vim /etc/default/isc-dhcp-server
    INTERFACES="eth1"

Restart dhcp service


sudo service isc-dhcp-server restart
or
sudo service isc-dhcp-server start
sudo service isc-dhcp-server stop


Modify and test interface on Client site


  1. Modify dhcp ethernet interface
    vim /etc/network/interface
    #eth1
    auto eth1
    iface eth1 inet dhcp

  2. Down and up dhcp ethernet interface
    ifdown eth1
    ifup eth1

  3. Check dhcp ethernet interface getting IP
    ifconfig

ubuntu documentation -《isc-dhcp-server
 Related Posts with Thumbnails 

0 意見 :

張貼留言