频道栏目
首页 > 网络 > 其他 > 正文

cisco交换机开启dhcp服务

2018-12-20 11:45:46         来源:f_066 的BLOG   
收藏   我要投稿
拓扑图如下:

wKiom1mAbhHgLT-uAABkvE_XhAg204.jpg

上述设备用途说明:

1、使用R1做dhcp server

2、使用R2和R3代替电脑做dhcp client

3、SW1用做傻瓜交换机

dhcp server配置(R1配置):

R1#disable

#############使用disable命令退出特权模式

R1>

R1>enable

#############使用enable命令进入特权模式

R1#showprivilege

Currentprivilegelevelis15

#############查看特权模式的级别

#############进入配置模式

R1#configureterminal

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

R1(config)#exit

#############查看接口状态

R1#showipinterfacebrief

InterfaceIP-AddressOKMethodStatusProtocol

FastEthernet0/0unassignedYESunsetadministrativelydowndown

FastEthernet0/1unassignedYESunsetadministrativelydowndown

Serial1/0unassignedYESunsetadministrativelydowndown

Serial1/1unassignedYESunsetadministrativelydowndown

Serial1/2unassignedYESunsetadministrativelydowndown

Serial1/3unassignedYESunsetadministrativelydowndown

R1#configureterminal

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

#############进入接口进行配置

R1(config)#intfastEthernet0/0

R1(config-if)#noshutdown

R1(config-if)#

*Aug119:39:28.523:%LINK-3-UPDOWN:InterfaceFastEthernet0/0,changedstatetoup

*Aug119:39:29.523:%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/0,changedstatetoup

R1(config-if)#ipaddress123.1.1.1255.255.255.0

R1(config-if)#

R1(config-if)#

#############在配置模式中查看接口状态需要加do前缀

R1(config-if)#doshowipinterfacebrief

InterfaceIP-AddressOKMethodStatusProtocol

FastEthernet0/0123.1.1.1YESmanualupup

FastEthernet0/1unassignedYESunsetadministrativelydowndown

Serial1/0unassignedYESunsetadministrativelydowndown

Serial1/1unassignedYESunsetadministrativelydowndown

Serial1/2unassignedYESunsetadministrativelydowndown

Serial1/3unassignedYESunsetadministrativelydowndown

R1(config-if)#

#############也可使用end命令退出配置模式

R1(config-if)#end

R1#

R1#

*Aug119:43:17.991:%SYS-5-CONFIG_I:Configuredfromconsolebyconsole

R1#

R1#configureterminal

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

#############开启dhcpserver功能

R1(config)#servicedhcp

R1(config)#ipdhcppoolR123

R1(dhcp-config)#network123.1.1.0255.255.255.0

#############将客户端的网关指向dhcpserver接口的IP

R1(dhcp-config)#default-router123.1.1.1

#############将客户端的DNS指向dhcpserver接口的IP

R1(dhcp-config)#dns-server123.1.1.1

#############设置租期为1天0时1分

R1(dhcp-config)#lease101

#############配置域名为cisco.com

R1(dhcp-config)#domain-namecisco.com

R1(dhcp-config)#

dhcp client配置(R2和R3配置):

R2#configureterminal

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

#############禁用iprouting路由转发表,将路由器模拟为pc

R2(config)#noiprouting

R2(config)#intfastEthernet0/0

R2(config-if)#noshutdown

R2(config-if)#

*Aug119:07:41.279:%LINK-3-UPDOWN:InterfaceFastEthernet0/0,changedstatetoup

*Aug119:07:42.279:%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/0,changedstatetoup

#############开启dhcp动态获取

R2(config-if)#ipaddressdhcp

R2(config-if)#

*Aug119:11:47.891:%DHCP-6-ADDRESS_ASSIGN:InterfaceFastEthernet0/0assignedDHCPaddress123.1.1.2,mask255.255.255.0,hostnameR2

R2(config-if)#end

#############查看接口状态

R2#showipinterfacebrief

InterfaceIP-AddressOKMethodStatusProtocol

FastEthernet0/0123.1.1.2YESDHCPupup

FastEthernet0/1unassignedYESunsetadministrativelydowndown

Serial1/0unassignedYESunsetadministrativelydowndown

Serial1/1unassignedYESunsetadministrativelydowndown

Serial1/2unassignedYESunsetadministrativelydowndown

Serial1/3unassignedYESunsetadministrativelydowndown

R2#

#############查看单独接口状态

R2#showrunning-configinterfacefastEthernet0/0

Buildingconfiguration...

Currentconfiguration:94bytes

!

interfaceFastEthernet0/0

ipaddressdhcp

noiproute-cache

duplexauto

speedauto

end

相关TAG标签 甘木 交换机 技术
上一篇:Cisco路由器配置GRE over IPsec
下一篇:三层交换机的VLAN间路由
相关文章
图文推荐
文章
推荐
热门新闻

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站