Configure and install the DHCP server in Ubuntu10.10

Source: Internet
Author: User
DHCP is based on the customer/Server mode. When the DHCP Client is started, it automatically communicates with the DHCP server, and the DHCP server provides services with automatically assigned IP addresses for the DHCP client. The server where the DHCP service software is installed is called the DHCP server, and the client with the DHCP function enabled is called the DHCP client. The DHCP server provides services for the DHCP client through address lease, it can be either of the following methods: limited lease period or permanent lease of DHCP server, you must know DHC

DHCP is based on the customer/Server mode. When the DHCP Client is started, it automatically communicates with the DHCP server, and the DHCP server provides services with automatically assigned IP addresses for the DHCP client.

The server where the DHCP service software is installed is called the DHCP server, and the client with the DHCP function enabled is called the DHCP client. The DHCP server provides services for the DHCP client through address lease, it has the following two methods:

Limited lease term and permanent lease

To learn about a DHCP server, you must know how the DHCP server works:

DHCPDISCOVER (DHCP invention)

DHCPOFFER (DHCP supply)

DHCPREQUEST (DHCP request)

DHCPACK (DHCP confirmation)

The four steps are necessary for the client to obtain the IP address.

Background process: dhcpd

Script:/etc/rc. d/init. d/dhcpd

Port: 67

Configuration File:/etc/dhcpd. conf

Log:/var/log/xferlog

Note that the network startup method is also called bootpc, so that the obtained IP address will not be subject to the lease period of the server linuxidc.com, and it will always be valid.

Now, we need to install the DHCP server first.

1. dhcp3-server-ldap_3.1.3-2Ubuntu6_i386.deb

2. dhcp3-server_3.1.3-2ubuntu6_i386.deb

Ii. Install dpkg-I dhcp3-server under root user *

(You do not need to use apt-get install to install it. If you place your own package to/var/ca ~ /Archive ~ /Decompress the package in the directory)

3. Configure the DHCP server

If your Ubuntu server uses two NICs, which one is used to listen to the DHCP service. Eth0 is listened to by default. You can change this default value by editing the file/etc/default/dhcp3-server.

Sudo vi/etc/default/dhcp3-server

Find this line,

INTERFACES = "eth0 ″

Use the following line to replace it.

INTERFACES = "eth1 ″

Save and exit. This step is optional.

Next, you need to create a backup for the/etc/dhcp3/dhcpd. conf file.

Cp/etc/dhcp3/dhcpd. conf/etc/dhcp3/dhcpd. conf. back

Run the following command to edit the/etc/dhcp3/dhcpd. conf file:

Sudo vi/etc/dhcp3/dhcpd. conf

Open dhcpd. conf and modify the following items:

Subnet is followed by the network segment you defined. It must be the same as the IP address of the local machine,

Each statement ends with a semicolon (;). Do not forget it.

For example, if my IP address is "192.168.2.11", the following is my configuration file:

Note: The address here must be consistent with the network segment on the sub-host.

Ddns-update-style interim; # define the supported DNS dynamic update types (required). Generally, we set them to disabled. interim and none both mean to disable

Ignore client-updates; # Allow/neglect clients to update DNS records

Subnet 192.168.2.0 netmask 255.255.255.0 {

Option routers 192.168.2.1;

Option subnet-mask limit 255.0;

Option nis-domain "domain.org ";

Option domain-name "domain.org ";

Option domain-name-servers 192.168.2.1;

Option time-offset-18000;

Range dynamic-bootp 192.168.2.100 192.168.2.254

Default-lease-time 21600;

Max-lease-time 43200;

Filename "/pxelinux.0 ";

Next-server 192.168.2.11;

Host ns {

Next-server marvin.RedHat.com;

Hardware ethernet 12: 34: 56: 78: AB: CD;

Fixed-address 207.175.42.254;

}

}

4. After configuring the dhcpd. conf file, you can start the dhcp service:

# Service dhcpd restart

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.