生活随笔
收集整理的這篇文章主要介紹了
linux下安装配置DHCP服务器
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
前提是已經安裝了 core 及 base 兩個組
?
| 1 2 3 4 5 | #?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為靜態獲取
| 1 2 3 4 5 6 7 8 9 10 | #?vi?/etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=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
| 1 2 3 4 5 6 7 8 9 10 11 12 | #?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 | |
安裝服務器組件
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #?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%] | |
更改配置文件
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #?cat?dhcpd.conf? option?domain-name?"bigcloud.local";#此處設置主機名 option?domain-name-servers?192.168.188.11,?192.168.188.12;#此處設置默認DNS subnet?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
轉載于:https://www.cnblogs.com/kluan/p/4452697.html
總結
以上是生活随笔為你收集整理的linux下安装配置DHCP服务器的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。