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_DHCP配置文檔
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.