linux下安裝配置DHCP伺服器

來源:互聯網
上載者:User

標籤:

前提是已經安裝了 core 及 base 兩個組

 

12345 # cat /etc/redhat-release  Red Hat Enterprise Linux Server release 6.4 (Santiago)  # uname -a Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

修改本機IP為靜態擷取

12345678910 # vi /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0 TYPE=Ethernet ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=static IPADDR=192.168.101.11 NETMASK=255.255.255.0 GATEWAY=192.168.101.1# service network restart

關閉 selinux

123456789101112 # vi /etc/sysconfig/selinux # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: #     enforcing - SELinux security policy is enforced. #     permissive - SELinux prints warnings instead of enforcing. #     disabled - No SELinux policy is loaded. #SELINUX=enforcing SELINUX=disabled # SELINUXTYPE= can take one of these two values: #     targeted - Targeted processes are protected, #     mls - Multi Level Security protection. SELINUXTYPE=targeted

安裝伺服器組件

1234567891011121314151617181920 # mkdir /mnt/cdrom # mount /dev/cdrom /mnt/cdrom/ mount: block device /dev/sr0 is write-protected, mounting read-only   # cd /mnt/cdrom/Packages/ # ls dhcp* dhcp-4.1.1-34.P1.el6.x86_64.rpm  dhcp-common-4.1.1-34.P1.el6.x86_64.rpm   #安裝 DHCP 軟體包 # rpm -Uvh dhcp-4.1.1-34.P1.el6.x86_64.rpm  error: Failed dependencies:         portreserve is needed by dhcp-12:4.1.1-34.P1.el6.x86_64   #解決包的依賴性 # rpm -Uvh dhcp-4.1.1-34.P1.el6.x86_64.rpm \  portreserve-0.0.4-9.el6.x86_64.rpm  Preparing...                ########################### [100%]    1:portreserve            ########################### [ 50%]    2:dhcp                    ########################### [100%]

更改設定檔

12345678910111213141516171819202122 # cat dhcpd.conf option domain-name "bigcloud.local";#此處設定主機名稱option domain-name-servers 192.168.188.11, 192.168.188.12;#此處設定預設DNSsubnet 192.168.188.0  netmask 255.255.255.0 {   #此處設定第一個子網  range dynamic-bootp 192.168.188.100  192.168.188.160;  #此處設定為不連續的IP段  range dynamic-bootp 192.168.188.169  192.168.188.253;  default-lease-time 259200; #預設租約時間  max-lease-time 259200;  option routers 192.168.188.2;  # 預設閘道}subnet 192.168.189.0  netmask 255.255.255.0 {    #第二個子網  range dynamic-bootp 192.168.189.100  192.168.189.253;  default-lease-time 691200;  max-lease-time 691200;  option routers 192.168.189.2;}host pc1 {     #為某一台主機單獨配置靜態IP  hardware ethernet 00:12:34:56:78:90;  fixed-address 192.168.188.111;#啟動服務。 # service dhcpd start Starting dhcpd:                                            [  OK  ]

 

本文出自 “李豪” 部落格,請務必保留此出處http://leaus.blog.51cto.com/9273485/1540292

linux下安裝配置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.