《思科路由网络通信技术实验指令汇总》由会员分享,可在线阅读,更多相关《思科路由网络通信技术实验指令汇总(41页珍藏版)》请在金锄头文库上搜索。
1、网络实验指令汇总一、配置Cisco交换机二、配置VLAN三、Cisco VTP和非VTP中继四、STP生成树协议五、无线路由配置六、配置单个路由器七、静态路由八、配置动态路由RIP九、Cisco EIGRP(增强型内部网关路由协议)十、配置单区域OSPF十一、路由器实现Vlan间通信(单臂路由)十二、PPP(数据链路层协议)十三、ACL简单的配置十四、使用 Easy IP 配置 DHCP (DNS服务器)十五、利用 NAT 扩展网络一、配置Cisco交换机设置访问口令switch(config)#enable password设置进入特权模式进的密码 switch(config-line)可以
2、设置通过console端口连接设备及telnet远程登录时所需要的密码S1#configure terminalS1(config)#line console 0 S1(config-line)#password ciscoS1(config-line)#loginS1(config-line)#line vty 0 15S1(config-line)#password ciscoS1(config-line)#loginS1(config-line)#exit设置命令模式口令将使能加密口令设置为 class:S1(config)#enable secret class配置IP地址及默认网关管
3、理MAC地址表switch#show mac-address-table显示MAC地址列表switch#clear mac-address-table dynamic清除动态MAC地址列表配置端口安全switch(config-if)switchport port-security switch(config-if)switchport port-security maximum 4配置端口在发生端口安全违规事件时自动关闭:如果不配置以下命令,则 S1 只会将违规事件登记在端口安全性统计信息中,而不会关闭端口。S1(config-if)#switchport port-security vio
4、lation shutdown配置快速以太网接口的端口速率和双工设置S1#configure terminalS1(config)#interface fastethernet 0/18S1(config-if)#speed 100 S1(config-if)#duplex full二、配置VLAN创建VLAN在Cisco IOS中有两种方式创建vlan,在全局配置模式下使用vlan vlanid命令,如switch(config)#vlan 10;在vlan database下创建vlan,如switch(vlan)vlan 20把端口划分给vlan(基于端口的vlan)switch(con
5、fig)#interface fastethernet0/1进入端口配置模式switch(config-if)#switchport mode access配置端口为access模式switch(config-if)#switchport access vlan 10把端口划分到vlan 10如果一次把多个端口划分给某个vlan可以使用interface range命令。删除配置把第0个模块中的第8个端口从vlan 40中删除:删除vlan 40:为vlan配置ip地址三、CiscoVTP1、配置基本交换机配置2、配置主机 PC 上的以太网接口3、启用用户交换机上的用户端口S2(config)
6、#interface fa0/6S2(config-if)#switchport mode accessS2(config-if)#no shutdownS2(config-if)#interface fa0/11S2(config-if)#switchport mode accessS2(config-if)#no shutdown4、配置VTP(1)将 S1 Fa0/1 和 Fa0/3 配置为中继,并使用 VLAN 99 作为本征 VLAN。S1(config)#interface FastEthernet 0/1S1(config-if)#switchport mode trunkS1(
7、config-if)#switchport trunk native vlan 99 S1(config-if)#interface FastEthernet 0/3S1(config-if)#switchport mode trunkS1(config-if)#switchport trunk native vlan 99 (2)S2上启用中继,并将 VLAN 99 配置为本征 VLANS2(config)#interface FastEthernet 0/1S2(config-if)#switchport mode trunkS2(config-if)#switchport trunk n
8、ative vlan 99(3)为交换机配置工作模式、域名和 VTP 口令S1(config)#vtp mode serverDevice mode already VTP SERVER.S1(config)#vtp domain CCNAChanging VTP domain name from NULL to Lab4S1(config)#vtp password ciscoSetting device VLAN database password to ciscoS1(config)#end S2(config)#vtp mode clientSetting device to VTP
9、CLIENT modeS2(config)#vtp domain CCNAChanging VTP domain name from NULL to Lab4S2(config)#vtp password ciscoSetting device VLAN database password to ciscoS2(config)#end S3(config)#vtp mode transparentSetting device to VTP TRANSPARENT mode.S3(config)#vtp domain CCNAChanging VTP domain name from NULL
10、to Lab4S3(config)#vtp password ciscoSetting device VLAN database password to ciscoS3(config)#end (4)为所有交换机上的中继端口配置中继和本征 VLAN。S1(config)#interface fa0/1S1(config-if)#switchport mode trunkS1(config-if)#switchport trunk native vlan 99S1(config-if)#no shutdownS1(config-if)#interface fa0/2S1(config-if)#s
11、witchport mode trunkS1(config-if)#switchport trunk native vlan 99S1(config-if)#no shutdownS1(config-if)#endS2(config)#interface fa0/1S2(config-if)#switchport mode trunkS2(config-if)#switchport trunk native vlan 99S2(config-if)#no shutdownS2(config-if)#endS3(config)#interface fa0/2S3(config-if)#switc
12、hport mode trunkS3(config-if)#switchport trunk native vlan 99S3(config-if)#no shutdownS3(config-if)#end(5)在 S2 和 S3 接入层交换机上配置端口安全功能配置端口 fa0/6和fa0/11使它们只支持一台主机,并且动态获知该主机的 MAC 地址。S2(config)#interface fa0/6S2(config-if)#switchport port-security S2(config-if)#switchport port-security maximum 1S2(config-
13、if)#switchport port-security mac-address sticky S2(config-if)#interface fa0/11S2(config-if)#switchport port-security S2(config-if)#switchport port-security maximum 1S2(config-if)#switchport port-security mac-address sticky S3(config)#interface fa0/6S3(config-if)#switchport port-security S3(config-if
14、)#switchport port-security maximum 1S3(config-if)#switchport port-security mac-address sticky S3(config-if)#interface fa0/11S3(config-if)#switchport port-security S3(config-if)#switchport port-security maximum 1S3(config-if)#switchport port-security mac-address sticky (6)在 VTP 服务器上(server)配置 VLAN。(7
15、)在所有交换机上配置管理接口地址。S1(config)#interface vlan 99S1(config-if)#ip address 172.17.99.11 255.255.255.0S1(config-if)#no shutdownS2(config)#interface vlan 99S2(config-if)#ip address 172.17.99.12 255.255.255.0S2(config-if)#no shutdownS3(config)#interface vlan 99S3(config-if)#ip address 172.17.99.13 255.255.255.0S3(config-if)#no shutdown