Configuration documentation for DHCP

Source: Internet
Author: User
Tags gpg

1. Configuring Yum


Vim/etc/yum.repos.d/rhel-debuginfo.repo


[Rhel-debuginfo]

name=red Hat Enterprise Linux $releasever-$basearch-debug

Baseurl=file:///misc/cd/server

Enabled=1

Gpgcheck=0

Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release



2. Configure IP


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


Device=eth0

Bootproto=none

Hwaddr=00:0c:29:fc:e2:45

Onboot=yes

ipaddr=192.168.100.1

netmask=255.255.255.0


Vim/etc/sysconfig/network-scripts/ifcfg-eth1


Device=eth1

Bootproto=none

Hwaddr=12:34:56:78:90:ab

Onboot=yes

ipaddr=192.168.200.1

netmask=255.255.255.0


Service Network restart



3. Install and configure DHCP service


Yum Install Dhcp-y


Cp/usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample/etc/dhcpd.conf


Vim/etc/dhcpd.conf


# Global Configuration

Ddns-update-style none; #动态DNS更新方法

Ignore client-updates; # Ignore Client Updates


# Subnet Configuration


#谁写IP谁傻X

Subnet 192.168.100.0 netmask 255.255.255.0 {

# Assign IP address pool, subnet mask, gateway, DNS

Range DYNAMIC-BOOTP 192.168.100.128 192.168.100.254;

Option Subnet-mask 255.255.255.0;

Option routers 192.168.100.1;

Option Domain-name "benet.com";

Option Domain-name-servers 192.168.100.1,192.168.100.2;

#租约时间: Maximum time, update time

Default-lease-time 21600;

Max-lease-time 43200;


# Host configuration (equivalent to retention in Windows)

Host NS {

#next-server marvin.redhat.com;

#hardware Ethernet 12:34:56:78:AB:CD;

#fixed-address 207.175.42.254;

}

Subnet 192.168.200.0 netmask 255.255.255.0 {

Range DYNAMIC-BOOTP 192.168.200.128 192.168.200.254;

Option Subnet-mask 255.255.255.0;

Option routers 192.168.200.1;

Option Domain-name "benet.com";

Option Domain-name-servers 192.168.200.1,192.168.200.2;

Default-lease-time 21600;

Max-lease-time 43200;


Host FTP {

Hardware Ethernet 00:0c:29:60:e4:ad;

Fixed-address 192.168.200.10;

}

Host Web {

Hardware Ethernet 12:34:56:78:90:ab;

Fixed-address 192.168.200.20;

}

}


Service DHCPD Start

Chkconfig DHCPD on



4. Supplement:


Restricting the network interfaces that the DHCP server provides services


Vim/etc/sysconfig/dhcpd


dhcpdargs= "Eth0 eth1"



Lease file


Tail-f/var/lib/dhcpd/dhcpd.leases


If you want to dive into the Linux system novice, you can also download a German Linux software center trial.

: Http://www.nfs-wuxi.com/cx/appCenter/open/softcenter




























Configuration documentation for DHCP

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.