Build a Linux DHCP server

Source: Internet
Author: User

requirements, 1 , DHCP of the IP192.168.1.252

2 , Distribution 192.168.1.10-200 of the IP address,

3 , A Host, fixed IP

A 00:0c:29:a8:43:f0 192.168.1.100

Steps:

First, installation DHCP Service

RPM-IVH dhcp-3 (tab)

Second, the configuration file

1 , configure the native IP Address

Vim/etc/sysconfig/network-scripts/ifcfg-eth0 Permanent Configuration

Device=eth0

Bootproto=static

ipaddr=192.168.1.252

netmask=255.255.255.0

gatemay=192.168.1.1

Hwaddr=00:0c:29:a8:43:f0

Onboot=yes

ifconfig eth0 192.168.1.252/24 Temporary configuration (invalid restart)

1 , Configuration DHCP

vim/etc/dhcpd.conf DHCP Master configuration file

Ddns-update-style Interim;

Ignore client-updates;

Subnet 192.168.1.0 netmask 255.255.255.0 { network segment

option routers 192.168.1.1; Gateway

option Subnet-mask 255.255.255.0; Mask

Optionnis-domain "domain.org";

option Domain-name "tarena.com"; Domain name

Option Domain-name-servers 202.160.0.20; Dns

Option time-offset-18000; # Eastern Standard Time

range DYNAMIC-BOOTP 192.168.1.20 192.168.1.200; Address Pool

default-lease-time 21600; Default Lease Period

max-lease-time 43200; Maximum lease period

# We want the nameserver to appear at a fixed address

Host NS {

Next-server marvin.redhat.com;

Hardwareethernet 12:34:56:78:AB:CD;

Fixed-address 207.175.42.254;

}

}

Host Post {

Next-server marvin.redhat.com;

hardware Ethernet 00:0c:29:a8:43:f0; // Specify MAC address, assigning it the following IP

Fixed-address 192.168.1.100;

}

Service DHCPD Restart Restart Service

CHKCONFIGDHCPD on Power-on self-booting

Service Dhcpdconfigtest Troubleshooting (failed record)

Third, client authentication

Linux :

Vim/etc/sysconfig/network-scripts/ifcfg-eth0 Permanent Configuration

Device=eth0

Bootproto=dhcp

# dhclient-d Eth0 Temporary Access

# dhclient-r Eth0 Release

Ifconfig eth0 View IP

Windows :

Cmd>ipconfig/release Release IP

cmd>ipconfig/renew re-fetch

Cmd>ipconfig View IP

Preparation:

/etc/sysconfig/network-scripts/ifcfg-eth0 NIC Configuration

cat/etc/sysconfig/network Computer name

cat/etc/hosts Local DNS Record

cat/etc/resolv.conf DNS configuration file

Service Network Restart Restart Network Service

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.