DHCP的配置文檔

來源:互聯網
上載者:User

標籤:linux   file   

1、配置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、配置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、安裝、配置DHCP服務


yum install dhcp -y


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


vim /etc/dhcpd.conf


#全域配置

ddns-update-style none;  #動態DNS更新方法

ignore client-updates;     #忽略客戶機更新


#子網配置


#誰寫IP誰傻X

subnet 192.168.100.0 netmask 255.255.255.0 {

#分配IP位址集區、子網路遮罩、網關、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;

#租約時間:最大時間,更新時間

        default-lease-time 21600;

        max-lease-time 43200;


#主機配置(相當於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、補充:


限制dhcp伺服器提供服務的網路介面


vim  /etc/sysconfig/dhcpd


DHCPDARGS="eth0 eth1"



租約檔案


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


如果想深入體驗LINUX系統的新手,也可以先下載一個方德Linux軟體中心試用一下。

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




























DHCP的配置文檔

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.