Linux中进行DHCP的配置_linux的dhcp配置

2020-02-27 其他范文 下载本文

Linux中进行DHCP的配置由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“linux的dhcp配置”。

Linux中进行DHCP的配置

以下红色区域是自己要修改的成自己的DHCP获取的地址范围

[root@OracleOnLinux root]# cp /usr/share/doc/dhcp-3.0pl1/dhcpd.conf.sample /etc/dhcpd.conf [root@OracleOnLinux root]# vi /etc/dhcpd.conf 1 ddns-update-style interim;2 ignore client-updates;3 4 subnet 192.168.0.0 netmask 255.255.255.0 {----“注:192.168.0.0是你给DHCP提供地址池的IP,而255.255.255.0是子网掩码”

6 #---default gateway 7 option routers 192.168.0.254;8 option subnet-mask 255.255.255.0;9 10 # option nis-domain “mylinux.org”;----“域名,没有域名的话可以在option nis-domain的前面加#号”

# option domain-name “mylinux.org”;----“域名,在windows环境下很有用,比如你的客户端是在那一个域,这里就要改成客户端所在的域名。没有域名的话可以在option domain-name的前面加#号”

option domain-name-servers 192.168.0.154,61.139.2.69;-----“192.168.0.154,61.139.2.69是你的DHCP客户端获取的DNS”

14 option time-offset-18000;# Eastern Standard Time 15 # option ntp-servers 192.168.1.1;16 # option netbios-name-servers 192.168.1.1;17 #---Selects point-to-point node(default is hybrid).Don't change this unle 18 #--you understand Netbios very well 19 # option netbios-node-type 2;20 21 range dynamic-bootp 192.168.0.18 192.168.0.100;---“动态地址池,你想给客户端获取的IP段”

range dynamic-bootp 192.168.0.160 192.168.0.200;---“动态地址池,你想给客户端获取的IP段”

default-lease-time 21600;24 max-lease-time 43200;25 26 # we want the nameserver to appear at a fixed addre 27 host ns1 { 28 next-server marvin.redhat.com;29 hardware ethernet 12:34:56:78:AB:CD;30 fixed-addre 192.168.0.17;31 }--“将192.168.0.17绑定给MAK地址为12:34:56:78:AB:CD的主机”

host db1 { 33 hardware ethernet 00:50:56:C0:00:01;34 fixed-addre 192.168.0.16;35 } 36 37 38 39 } “/etc/dhcpd.conf” [已转换] 39L, 1054C 已写入

[root@OracleOnLinux root]# service dhcpd restart 关闭 dhcpd:[失败] 启动 dhcpd:[ 确定 ] [root@OracleOnLinux root]# =========================================== linux客户机配置:

[root@OracleOnLinux dhcp]# cd /etc/sysconfig/network-scripts/ [root@OracleOnLinux network-scripts]# cat ifcfg-eth1 DEVICE=eth1 ONBOOT=yes BOOTPROTO=dhcp------租借: dhclient eth1 ====================================== windows客户机配置

1、设置为自动获取IP2、手动租借:ipconfig /release 和 ipconfig /renew ====================== 查看地址的租借情况:

root@OracleOnLinux root]# cd /var/lib/dhcp [root@OracleOnLinux dhcp]# ls dhclient.leases dhcpd.leases dhcpd.leases~ [root@OracleOnLinux dhcp]# more dhcpd.leases # All times in this file are in UTC(GMT), not your local timezone.This is # not a bug, so please don't ask about it.There is no portable way to # store leases in the local timezone, so please don't request this as a # feature.If this is inconvenient or confusing to you, we sincerely # apologize.Seriously, though-don't ask.# The format of this file is documented in the dhcpd.leases(5)manual page.# This lease file was written by isc-dhcp-V3.0pl1 lease 192.168.0.200 { starts 4 2007/04/26 11:46:57;ends 4 2007/04/26 17:46:57;binding state active;next binding state free;hardware ethernet 00:0c:29:1d:59:af;} [root@OracleOnLinux dhcp]# more dhclient.leases lease { interface “eth1”;fixed-addre 192.168.0.200;option subnet-mask 255.255.255.0;option time-offset-18000;option routers 192.168.0.254;option dhcp-lease-time 21600;option dhcp-meage-type 5;option domain-name-servers 192.168.0.154,61.139.2.69;option dhcp-server-identifier 192.168.0.154;option nis-domain “mylinux.org”;option domain-name “mylinux.org”;renew 4 2007/4/26 14:22:04;rebind 4 2007/4/26 17:01:57;expire 4 2007/4/26 17:46:57;}

《Linux中进行DHCP的配置.docx》
将本文的Word文档下载,方便收藏和打印
推荐度:
Linux中进行DHCP的配置
点击下载文档
相关专题 linux的dhcp配置 Linux DHCP linux的dhcp配置 Linux DHCP
[其他范文]相关推荐
    [其他范文]热门文章
      下载全文