Linux网络管理之七:在Linux中进行DHCP的配置
作者 佚名技术
来源 Linux系统
浏览
发布时间 2012-05-10
[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 { 5 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"; 11 option domain-name "mylinux.org"; 12 option domain-name-servers 192.168.0.154,61.139.2.69; 13 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 unless 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; 22 range dynamic-bootp 192.168.0.160 192.168.0.200; 23 default-lease-time 21600; 24 max-lease-time 43200; 25 26 # we want the nameserver to appear at a fixed address 27 host ns1 { 28 next-server marvin.redhat.com; 29 hardware ethernet 12:34:56:78:AB:CD; 30 fixed-address 192.168.0.17; 31 } 32 host db1 { 33 hardware ethernet 00:50:56:C0:00:01; 34 fixed-address 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、设置为自动获取IP 2、手动租借: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. # T |
|
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
上一篇: linux 忘记root密码又忘记grub密码怎么办下一篇: 不必害怕Ubuntu的命令行
关于Linux网络管理之七:在Linux中进行DHCP的配置的所有评论