日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux配置服务器心得体会,linux 学习 linux上搭建dhcp服务器

發(fā)布時間:2024/1/23 linux 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux配置服务器心得体会,linux 学习 linux上搭建dhcp服务器 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

①配置前的環(huán)境準(zhǔn)備

##確保dhcp服務(wù)器有固定ip

[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

BOOTPROTO=satic //ip獲取模式為static 靜態(tài)

ONBOOT=yes

HWADDR=00:0c:29:f5:82:fe

IPADDR=192.168.1.1

NETMASK=255.255.255.0

[root@localhost ~]# /etc/init.d/network restart //重啟network服務(wù)

正在關(guān)閉接口 eth0: [確定]

關(guān)閉環(huán)回接口: [確定]

彈出環(huán)回接口: [確定]

彈出界面 eth0: [確定]

[root@localhost ~]# chkconfig network on //保證network服務(wù)默認(rèn)啟動

[root@localhost ~]#

##安裝dhcp服務(wù)的rpm包

[root@localhost ~]# rpm -q dhcp

package dhcp is not installed

[root@localhost ~]# mount /dev/hdc /media/

mount: block device /dev/hdc is write-protected, mounting read-only

[root@localhost ~]#

[root@localhost ~]# rpm -ivh /media/Server/dhcp-3.0.5-31.el5_8.1.x86_64.rpm

warning: /media/Server/dhcp-3.0.5-31.el5_8.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:dhcp ########################################### [100%]

[root@localhost ~]#

##編輯dhcpd主配置文件

[root@localhost ~]# vim /etc/dhcpd.conf

##打開后是空文件,可以將下面的模板導(dǎo)入

/usr/share/doc/dhcp*/dhcpd.conf.sample

以下是主要的配置內(nèi)容

ddns-update-style interim; //DHCP和DNS更新模式,必須包括的設(shè)置項

ignore client-updates;

subnet 192.168.1.0 netmask 255.255.255.0 { //全局的子網(wǎng)和掩碼

option routers 192.168.1.254; //網(wǎng)關(guān)

option subnet-mask 255.255.255.0; //掩碼

option domain-name "domain.org";

option domain-name-servers 192.168.1.253; //主機所在域

range dynamic-bootp 192.168.1.128 192.168.1.250;//地址池

default-lease-time 21600;//默認(rèn)租期 ,可以放到全局下

max-lease-time 43200; //最大租期,可以放到全局下

host ns {

next-server marvin.redhat.com;

hardware ethernet 12:34:56:78:AB:CD;

fixed-address 207.175.42.254;//聲明的保留地址

}

}

[root@localhost ~]# /etc/init.d/dhcpd

Usage: /etc/init.d/dhcpd {start|stop|restart|force-reload|condrestart|try-restart|configtest|status}

[root@localhost ~]# /etc/init.d/dhcpd configtest //對dhcpd配置文件檢測

Syntax: OK

[root@localhost ~]# /etc/init.d/dhcpd restart //開啟dhcpd服務(wù)

關(guān)閉 dhcpd: [確定]

啟動 dhcpd: [確定]

[root@localhost ~]# chkconfig dhcpd on //確保dhcpd服務(wù)默認(rèn)開機啟動

③測試 :

windows 下運行cmd

ipconfig /all

ipconfig /release //釋放已獲得ip地址

ipconfig /renew //重新獲取

linux 輸入命令

dhclient -d 網(wǎng)卡名 //從dhcp服務(wù)器獲得ip

ifconfif 網(wǎng)卡名 //查看ip

總結(jié)

以上是生活随笔為你收集整理的linux配置服务器心得体会,linux 学习 linux上搭建dhcp服务器的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。