关于cisco路由器串口配置DHCP的问题
拓扑很简单
R1作为DHCP服务器模拟为ISP,R2作为DHCP客户端,作为公司链接ISP的出口
按道理来说,这种配置是相当容易的
R1的配置
R1#conf t
R1(config)#int s2/0
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#ip dhcp pool ISP
R1(dhcp-config)#network 10.1.1.0 /24
R1(dhcp-config)#default-router 10.1.1.1
R1(dhcp-config)#exit
R1(config)#ip dhcp excluded-address 10.1.1.1 //排除地址
R2的配置
R2#conf t
R2(config)#int s2/0
R2(config-if)#ip address ?
A.B.C.D IP address
negotiatedIP Address negotiated over PPP
pool IP Address autoconfigured from a local DHCP pool
slarp Set IP address through SLARP
可以看出,并没有dhcp选项,然后我上网查了一下,还可以使用
R2(config-if)#ip dhcp client client-id s2/0
其实并没有什么卵用(可能是我配置错误)
一开始我以为是IOS的问题,一开始使用的是
c3640-ik9o3s-mz.124-25c.bin
后来我换成了
c3660-ik9o3s-mz.124-15.T6.bin
发现还是同样的问题
接下来我思考的是,是不是串口不能做DHCP(一开始感觉这个想法有点扯淡,毕竟链接ISP的介质大多都是串行线)
接下来我使用了快速以太网端口
R1(config)#int s2/0
R1(config-if)#no ip add
R1(config-if)#int f0/0
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#no sh
DHCP服务照常
R2(config-if)#int f0/0
R2(config-if)#no sh
R2(config-if)#ip add ?
A.B.C.DIP address
dhcp IP Address negotiated via DHCP
pool IP Address autoconfigured from a local DHCP pool
发现DHCP选项,很惊喜有木有
R2(config-if)#ip add dhcp
结果如下
R2(config-if)#
*Mar1 00:49:17.411: %DHCP-6-ADDRESS_ASSIGN: Interface FastEthernet0/0 assigned DHCP address 10.1.1.2, mask 255.255.255.0, hostname R2
R2#show ip int b
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 10.1.1.2 YES DHCP up up
FastEthernet0/1 unassigned YES unsetadministratively down down
FastEthernet1/0 unassigned YES unsetadministratively down down
Serial2/0 unassigned YES unsetadministratively down down
获取到了
接下来,我使用Cisco Packet Tracer 7.0 来配置
R1配置完了之后R的配置如下R2(config)#int s0/3/0R2(config-if)#ip addR2(config-if)#ip address ?A.B.C.DIP addressR2(config-if)#ip ?access-group Specify access control for packetsaddress Set the IP address of an interfaceauthentication authentication subcommandsflow NetFlow Related commandshello-interval Configures IP-EIGRP hello intervalhelper-address Specify a destination address for UDP broadcastsmtu Set IP Maximum Transmission Unitnat NAT interface commandsospf OSPF interface commandssplit-horizon Perform split horizonsummary-address Perform address summarizationvirtual-reassemblyVirtual Reassembly
还是没有dhcp的选项
同样的,吉比特以太网接口是有的
R2(config-if)#int g0/0R2(config-if)#ip add ?A.B.C.DIP addressdhcp IP Address negotiated via DHCP
小结(暂时):思科的串行接口不支持DHCP动态获取地址。
页:
[1]