40思科模拟器网络设备常见命令大全

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

1.创建VLAN、端口隔离、配置SVISW1(config)#vlan10#创建VLAN10SW1(config-vlan)#exit#返回全局模式SW1(config)#interfacerangefastEthernet0/6-10#进入接口模式SW1(config-if-range)#switchportaccessvlan10#将接口划入到VLAN10SW1(config-if-range)#exit#返回全局模式SW1(config)#interfacevlan10#进入VLAN接口模式SW1(config-VLAN10)#ipaddress192.168.10.1255.255.255.0#配置SVI接口地址2.配置TRUNK口链路SW1(config)#interfacefastEthernet0/2#进入接口模式SW1(config-FastEthernet0/2)#switchportmodetrunk#设置端口模式为trunk#如果是三层交换机,在模拟器上需要封装802.1Q协议SW1(config)#interfacefastEthernet0/2#进入接口模式SW1(config-FastEthernet0/2)#switchporttrunkencapsulationdot1q#封装802.1q协议SW1(config-FastEthernet0/2)#switchportmodetrunk#设置端口模式为trunk3.配置单臂路由RTA(config)#interfacefastEthernet0/0RTA(config-if-FastEthernet0/0)#noshutdownRTA(config)#interfacefastEthernet0/0.1#进入子接口模式RTA(config-subif)#encapsulationdot1Q10#封装VLAN标签RTA(config-subif)#ipaddress192.168.10.1255.255.255.0#配置子接口IP地址RTA(config-subif)#noshutdown#启用子接口4.配置静态路由RA(config)#iproute192.168.2.0255.255.255.0192.168.1.2#配置到非直连网段静态路由RA(config)#iproute192.168.3.0255.255.255.0192.168.1.2#配置到非直连网段静态路由5.配置RIPV2路由RA(config)#routerrip#启用RIP路由进程RA(config-router)#version2#定义RIP版本号RA(config-router)#network192.168.0.0#宣告直连路由RA(config-router)#network192.168.1.0#宣告直连路由RA(config-router)#noauto-summary#关闭自动汇总6.配置RIP路由协议认证RA(config)#keychainruijie#配置密钥链RA(config-keychain)#key1#配置密钥IDRA(config-keychain-key)#key-string12345#配置密钥值RA(config-keychain-key)#exitRA(config-keychain)#exitRA(config)#interfacefastEthernet0/0RA(config-if)#ipripauthenticationmodemd5#配置验证方式为MD5RA(config-if)#ipripauthenticationkey-chainruijie#配置接口启用RIP验证7.配置OSPF单区域路由RA(config)#routerospf#启用OSPF路由进程RA(config-router)#network192.168.0.00.0.0.255area0#宣告直连路由RA(config-router)#network192.168.1.00.0.0.255area0#宣告直连路由8.配置OSPF多区域路由RA(config)#routerospf#启用OSPF路由进程RA(config-router)#network192.168.1.00.0.0.255area0#宣告直连路由RA(config-router)#network172.16.1.00.0.0.255area1#宣告直连路由RA(config-router)#network172.16.2.00.0.0.255area1#宣告直连路由Router(config-router)#area1stubno-summary#完全stub过滤路由ipaccess-liststandardacl_1deny3.3.3.00.0.0.255permitanyrouterospf10distribute-listacl_1in9.配置OSPF协议认证(1)明文验证RA(config)#interfacefastEthernet0/0RA(config-if-FastEthernet0/0)#ipospfauthentication#启用接口的明文验证RA(config-if-FastEthernet0/0)#ipospfauthentication-key123#配置明文验证的密码(2)暗文验证RB(config)#interfacefastEthernet0/1RB(config-if-FastEthernet0/1)#ipospfauthenticationmessage-digest#启用接口的MD5验证RB(config-if-FastEthernet0/1)#ipospfmessage-digest-key1md5aaa#配置MD5验证的密钥ID和密钥10.访问控制列表(1)标准访问控制列表RB(config)#access-list10permit192.168.1.00.0.0.255RB(config)#access-list10deny192.168.2.00.0.0.255RB(config)#interfacefastEthernet0/0RB(config-if-fastEthernet0/0)#ipaccess-group10out(2)扩展访问控制列表RB(config-ext-nacl)#permittcp192.168.2.00.0.0.255host192.168.4.2eqftpRB(config-ext-nacl)#permittcp192.168.2.00.0.0.255host192.168.4.3eq(config-ext-nacl)#denyip192.168.2.00.0.0.255192.168.4.00.0.0.255RB(config-ext-nacl)#permitipanyanyRB(config)#interfacefastEthernet0/0RB(config-if-FastEthernet0/0)#ipaccess-group100in#接口应用访问控制列表11.NAT(1)静态NATRA(config)#ipnatinsidesourcestatic192.168.100.468.1.1.4RA(config)#ipnatinsidesourcestatic192.168.100.668.1.1.6RA(config)#interfacefastEthernet0/0RA(config-if-FastEthernet0/0)#ipnatinside#定义接口为内部接口RA(config-if-FastEthernet0/0)#exitRA(config)#interfaceserial2/0RA(config-if-Serial2/0)#ipnatoutside#定义接口为外部接口(2)动态NATRA(config)#interfacefastEthernet0/0RA(config-if)#ipnatinsideRA(config-if)#exitRA(config)#interfaceserial2/0RA(config-if-Serial2/0)#ipnatoutsideRA(config)#access-list10permit192.168.1.0255.255.255.0RA(config)#access-list10permit192.168.2.0255.255.255.0RA(config-std-nacl)#exitRA(config)#ipnatinsidesourcelist10interfaceserial2/0overload12.远程登录SW1(config)#enablepassword123456#配置enable密码SW1(config)#linevty04#进入线程配置模式SW1(config-line)#password123456#配置Telnet密码SW1(config-line)#login#启用Telnet的用户名密码验证13.DHCP服务SW1(config)#ipdhcppoolvlan10#设定地址池名称SW1(dhcp-config)#network192.168.10.0255.255.255.0#配置DHCP地址池SW1(dhcp-config)#dns-server68.1.1.6#配置DNS地址SW1(dhcp-config)#default-router192.168.10.1#配置网关SW1(dhcp-config)#exitSW1(config)#ipdhcpexcluded-address192.168.10.160192.168.10.200#配置排除地14.生成树协议SWA(config)#spanning-treemodepvst/rapid-pvst#开启生成树协议或者快速生成树SWA(config)#spanning-treevlan10priority4096#优先级为4096,默认为32768多生成树SW1(config)#spanning-tree#启用生成树协议SW1(config)#spanning-treemodemstp#定义为MSTP模式SW1(config)#spanning-treemst1priority4096#SW1设为实例1的根核心要配SW1(config)#spanning-treemstconfiguration#进入MSTP配置模式SW1(config-mst)#instance1vlan10#创建实例1SW1(config-mst)#instance2vlan20#创建实例2SW1(config-mst)#nameaaa#定义区域名称aaaSW1(config-mst)#revision1#定义配置版本号为115.VRRP服务RB(config)#interfacefastEthernet0/0RB(config-if-FastEthernet0/0)#vrrp1ip52.1.1.254#启用VRRP进程RB(config-if-FastEthernet0/0)#vrrp1priority120#定义接口VRRP优先级RB(config-if-FastEthernet0/0)#vrrp1preempt#启用抢占模式15.配置EIGRP路由router(config)#routereigrp1router(config-router)#networkA.B.C.Drouter(config-router)#noauto-summary#在主类边界关闭自动汇总,默认开启16.配置BGP路由router(config)#routerbgp100router(config-router)#network15.1.1.0mask255.255.255.0#传递网络route

1 / 5
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功