ROS软路由论坛 ROSABC.com 网络方案网络工程交流

 找回密码
 会员注册

QQ登录

只需一步,快速开始

把路由器设置成dhcp服务器的方法和命令行

2014-7-31 04:05| 发布者: admin| 查看: 971| 评论: 0

摘要: 对于职业网管来说,把路由器设置成dhcp服务器(DHCP server)是一个必备技能,下面就以思科2514路由器做例子来说明设置的过程。 网络连接的拓扑很简单,就是一个台linux服务器连接cisco2514路由器的e0端口,然后e1 ...

对于职业网管来说,把路由器设置成dhcp服务器(DHCP server)是一个必备技能,下面就以思科2514路由器做例子来说明设置的过程。

网络连接的拓扑很简单,就是一个台linux服务器连接cisco2514路由器的e0端口,然后e1口再连接一台装了windows xp的pc,把pc设为自动获得ip地址。

看来也可以把一个3层的交换机设为dhcp server ,分了几个网段(vlan)就设几个pool 。但若是在一个大的网络环境中,这显然是加重了3层交换机的负担,各位作售前的前辈,有过这样的设计吗?给分析分析这个解决方法好吗?

Trace#sh ru
Building configuration...
Current configuration : 1035 bytes
!
version 12.1
no service single-slot-reload-enable
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Trace
!
logging rate-limit console 10 except errors
!
ip subnet-zero
no ip finger
no ip domain-lookup
!
ip dhcp pool lan1
  network 192.168.1.0 255.255.255.0
  default-router 192.168.1.1
  dns-server 1.1.1.1
  lease 0 0 30
!
ip dhcp pool lan2
  network 192.168.2.0 255.255.255.0
  dns-server 1.1.1.1
  default-router 192.168.2.1
  lease 0 0 30
!
cns event-service server
!
!
!
interface Ethernet0
ip address 192.168.1.1 255.255.255.0
no keepalive
!
interface Ethernet1


ip address 192.168.2.1 255.255.255.0
no keepalive
!
interface Serial0
no ip address
shutdown
no fair-queue
!
interface Serial1
no ip address
shutdown
!
ip kerberos source-interface any
ip classless
no ip http server
!
!
alias exec sr sh ru
alias exec ct conf t
alias exec sir sh ip ro
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
!
end
Trace#debug ip dhcp server events
00:42:23: DHCPD: assigned IP address 192.168.1.2 to client 0152.54ab.2a47.92.
Trace# http://www.luyouqiwang.com/14118/ 
00:42:25: DHCPD: assigned IP address 192.168.2.2 to client 0100.000e.82e9.d4.
-------------------------------------------------------------------------------
Trace#sh ip dhcp binding
IP address       Hardware address        Lease expiration        Type
192.168.1.2      0152.54ab.2a47.92       Mar 01 1993 01:12 AM    Automatic
192.168.2.2      0100.000e.82e9.d4       Mar 01 1993 01:12 AM    Automatic
-------------------------------------------------------------------------------
Trace#sh ip dhcp server statistics
Memory usage         14019
Address pools        2
Database agents      0
Automatic bindings   2
Manual bindings      0
Expired bindings     0
Malformed messages   0
Message              Received
BOOTREQUEST          0
DHCPDISCOVER         3


DHCPREQUEST          4
DHCPDECLINE          0
DHCPRELEASE          0
DHCPINform           0
Message              Sent
BOOTREPLY            0
DHCPOFFER            3
DHCPACK              4
DHCPNAK              0
Trace#
-----------------------------------------------------------------------------
C:>ipconfig/all
Ethernet adapter 本地连接:
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Fujitsu FMV-J182A
       Physical Address. . . . . . . . . : 00-00-0E-82-E9-D4
       Dhcp Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
       IP Address. . . . . . . . . . . . : 192.168.2.2
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . : 192.168.2.1
       DHCP Server . . . . . . . . . . . : 192.168.2.1
       DNS Servers . . . . . . . . . . . : 1.1.1.1
       Lease Obtained. . . . . . . . . . : 2003年2月7日 11:47:01
       Lease Expires . . . . . . . . . . : 2003年2月7日 12:17:01
C:>ping 192.168.1.2
Pinging 192.168.1.2 with 32 bytes of data:
Reply from 192.168.1.2: bytes=32 time=1ms TTL=254
Reply from 192.168.1.2: bytes=32 time=1ms TTL=254
Reply from 192.168.1.2: bytes=32 time=1ms TTL=254
Reply from 192.168.1.2: bytes=32 time=1ms TTL=254
Ping statistics for 192.168.1.2:
   Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
   Minimum = 1ms, Maximum = 1ms, Average = 1ms
Trace#

不良信息举报Q:2000617

软路由

不良信息举报Q:2000617|Archiver|ROS软路由论坛 ROSABC.com 网络方案网络工程交流

GMT+8, 2025-4-30 20:02 , Processed in 0.135144 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部