西红柿吃多少都不会胖:cisc 路由配置命令汇总 - 技术学习 - 51CTO技术博客

来源:百度文库 编辑:九乡新闻网 时间:2024/04/29 14:37:02
Cisco常用配置命令一.交换机的基本配置C2950# config terminal 进入全局配置模式show interface fastethernet0/1 查看端口0/1的配置结果show interface fastethernet0/1 status 查看端口0/1的状态show mac-address-table 查看整个MAC地址表clear mac-address-table restricted static 清除限定性地址C2950(config)# hostname 2950A / 设置主机名为2950Ainterface f0/23 / 进入端口23的配置模式enable password cisco / 设置enable password为ciscoenable secret cisco1 / 设置enable secret为cisco1ip address 192.168.1.1 255.255.255.0 / 设置交换机IP地址ip default-gateway 192.168.1.254 / 设置默认网关ip domain-name cisco.com / 设置域名ip name-server 200.0.0.1 / 设置域名服务器配置查看MAC地址表mac-address-table ?mac-address-table aging-time 100 / 设置超时是时间为100smac-address-table permanent 0000.0c01.cc /f0/3 加入永久地址mac-address-table restricted static 0000.0c02.bbcc / f0/6 f0/7 加入静态地址endshow mac-address-table /查看整个Mac地址表clear mac-address-table restricted static C2950(config-if)#interface fastethernet0/1 /进入接口F0/1子配置模式interface Ethernet0 /进入以太网口0子配置模式no shutdown /激活接口speed ? /查看speed命令的子命令speed 100 /设置该端口速率为100Mb/sdulplex full/half/auto /设置该端口为全双工description TO_PC1 /设置该端口描述为TO_PC1show interface fastethernet 0/1 /查看端口0/1的配置结果show interface fastethernet 0/1 status /查看端口0/1的状态配置VTP和STP一. 配置VTP2950A #vlan database /进入VLAN配置子模式show vtp status /查看VTP设置信息show vlan /查看VLAN配置信息copy running-config startup-config /保存配置文件2950A(vlan)#vtp server/client /设置本交换机为server/client模式vtp pruning /启动修剪功能vtp domain vtpserver /设置域名为vtpservervlan 2 /创建VLAN2,系统将自动命名vlan 3 name vlan3 /创建VLAN3,并命名为vlan3Switch(config-if)#switchport mode trunk /设置当前端口为Trunk模式switchport trunk allowed vlan all /设置允许从该端口交换数据的VLANswitchport trunk vlan remote vlan6 /设置允许交换数据的Vlan(除vlan6外)switchport mode access /设置端口为静态VLAN访问模式switchport access vlan2 /将端口9分配给相信的VLAN2show vlan生成树协议配置(负载均衡)Switch#spanning-tree vlan 1 port-priority 10 /设置VLAN 1的端口的权值为10 (默认值为128)spanning-tree vlan 1 cost 19 /设置VLAN 1生成树路径值为19专题三 配置路由协议Router# enableRouter#config terminalRouter(conf)#hostname R1 show session /查看终端服务器的会话show line 1 /查看线路1的状态clear line 2 /清除线路2A. 静态路由格式:ip route ip-addr subnet-mask gateway 加入静态路由R1(conf)#ip route 192.168.1.0 255.255.255.0 10.1.1.1 ip routing /启动IP路由B. 动态路由(1)配置RIP协议no logging console 防止大量的端口状态变化信息和报警信息对配置过程的影响[no] ip routing 允许/不允许路由选择协议router ri p 进入RIP协议配置模式network 192.168.1.0 声明192.168.1.0与路由器R1直接邻接version 2 设置RIP协议的版本为2neighbor ip-addr 说明邻接路由器,以使它们能够自动更新路由passive interface 接口 阻止在指定的接口发送路由更新协议show ip route 查看路由表信息show ip route rip/igrp/ospf 查看RIP/IGRP/OSPF协议路由信息(2)配置IGRP协议no keepalive /不监测keepalive信号,即不连接设备时可激活该接口bandwidth x /设置带宽为x(Kb/s)clockrate x /设置时钟频率为x(HZ)timer basic /更新时间 到期时间 抑制与否清除时间 设置自定义的路由更新时间……no metric holddown /禁止抑制功能,路由信息删除后可立即接受新的metric maximum-hop 50 /当信息包穿过50个路由器时,删除信息包router igrp/eigrp autonomous-system /进入IGRP协议配置子模式(3)配置OSPF协议router ospf 1 /指定使用ospf选择协议,并运行在1号进程中network 网络地址 掩码反码 area 区域号 /说明与区域1的172.16.4.6邻接area 区域号 stub /将区域x转化为根区show ip ospf neighbor /列出与本路由器是“邻接”关系的路由器no ospf auto-cost-determination /使OSPF不自动根据每个接口的带宽,计算出其costip ospf cost /手动设置接口的costarea 1 range 172.16.4.0 255.255.255.0 /说明区域一的范围是子网172.16.4.0/24(4)配置EIGRP协议no auto-summary 关闭EIGRP协议的路由自动汇总功能network network-addr 掩码反码广域网接入一.配置ISDNisdn switch-type switch-type /设置交换机类型为 switch-typeinterface bri 0 /进入ISDN的BRI接口配置模式encapsulation ppp /设置封装协议为pppppp multilink /启动ppp多连接dialer string 80000002 /设置拨号串,R2的ISDN号码为80000002dialer-group 1 /设置拨号组号为1,把BRI 0接口与拨号列表1相关联dialer-list 1 protocol ip permit /设置拨号列表1,即当有IP包时将引起拨号dialer load-threshold load /设置达到load后,启动第二个B通道.logging console /在终端上显示监测信息debug dialer /监测dialer信息undebug all /关闭所有调试信息二. 配置PPP和DDRppp authentication chap /设置PPP认证方式为CHAPclockrate speed /设置DCE端线路速度为speeddialer idle-timeout 120 /设置拨号空闲时间为120sno cdp enable /禁止通过此接口传递CDP控制数据dialer map ip 192.168.1.2 name R2 broadcast 800000002/设置拨号串,将IP地址与ISDN的SPID对应起来.usename R2 password secret/设置用户名和口令,即设置拨号链路对端路由器名为R2,口令为secret.三. 配置帧中继frame-relay lmi-type cisco /设置帧中继的LMI类型为ciscono frame-relay inverse-arp /关闭帧中继逆向ARPno ip address /只在数据链路层工作,无需IP地址frame-relay interface-dlci dlciinterface serial 2 /进入串行口2端口配置模式frame-relay route 303 interface Serial 1 302 在串行口2的DLCI 303与串行口1的DLCI 302之间建立关联show frame route /显示完整的路由信息frame-relay map ip 192.168.1.2 302 broadcast /将IP地址192.168.1.2与帧中继的DLCI 302关联起来interface s 0.1 划分子接口,对其进行逻辑划分interface s 0.1 point-to-point 划分子接口,并设置为点对点模式VPN配置一 L2TP的配置与测试A:命令模式:特权用户模式Quidway#(1)show l2tp session 显示当前的L2TP会话的信息举例:Quidway#show l2tp session(2) show l2tp tunnel 显示当前的L2TP通道的信息举例:Quidway#show l2tp tunnel(3)clear vpdn tunnel l2tp remote-name 断开通道对端名称为X的通道连接举例:Quidway#clear vpdn tunnel l2tp A8010B:命令模式:全局配置模式Quidway(config)#(4) [no] vpdn-group group-nunmber 创建/删除组号为x的VPDN组举例:Quidway(config)#vpdn-group 2默认情况:系统默认没有创建VPDN组(5)[no] interface vitual-template vitual-template-number 创建/删除虚接口模块举例:Quidway(config)#interface virtual-template 1默认配置:系统默认没有创建虚接口模块C:命令模式:VPDN组配置模式Quidway(config-vpdn1)#(6) [no]lcp renegotiation 允许/不允许LCP再次协商举例:Quidway(config-vpdn1)#lcp renegotiation扩展:lcp renegotiation always 一直允许进行LCP协商默认情况:系统默认不重新进行LCP协商(7)local name name 指定通道本端的名称为nameno local name 将通道本端的名称恢复成默认名称举例:Quidway(config-vpdn1)#local name itsme默认情况:系统默认的本端名称为路由器名(8) [no] l2tp tunnel authentication 启用/关闭L2TP通道验证功能举例:Quidway(config-vpdn1)#no l2tp tunnel authentication默认情况:系统默认对L2TP通道进行验证(9) l2tp tunnel password password 设置L2TP通道验证的密码为passwordno l2tp tunnel password 将L2TP通道验证的密码还原为默认值举例:Quidway(config-vpdn1)#l2tp tunnel password yougotit默认情况:系统默认的通道验证密码为路由器名(10) [no] force-local-chap 强制/禁止LNS与Client之间重新进行CHAP验证举例:Quidway(config-vpdn1)#force-local-chap默认情况:系统默认不进行CHAP的重新验证(11)accept-dialin l2tp virtual-template virtual-template-number remoteremote-peer-name 接受名称为remote-peer-name的对端发起的L2TP通道连接请求,并根据vitual-template virtual-template-number 创建virtual-access接口no accept dialin 删除此设置举例: Quidway(config-vpdn1)#accept-dialin l2tp virtual-template 1 remote A8010, 默认情况:系统默认为禁止接受呼入二 IPSec的配置Crypto isakmp policy1 /配置IKE策略1Authentication pre-share /IKE策略1的验证方法设为pre-shareGroup 2;1024-bit Diffie-Hellman /加密算法未设置则取默认值:DESCrypto isakmp key test123 address 202.96.1.2 /设置Pre-share密钥为test123,此值两端需一致crypto ipsec transform-set VPNtag ah-md5-hmac esp-des/设置AH散列算法为md5,ESP加密算法为DES.crypto map VPNdemo 10 ipsec-isakmp /定义crypto mapset peer 202.96.1.2 /设置隧道对端IP地址set transform-set VPNtag /设置隧道AH及ESPmatch address 101interface Tunnel0 /定义隧道接口ipaddress 192.168.1.1 255.255.255.0 /隧道端口IP地址no ip directed-broadcasttunnel source 202.96.1.1 /隧道源端地址tunnel destination 202.96.1.2 /隧道目的端地址crypto map VPNdemo /应用VPNdemo于此接口其他的略NAT——网络地址转换(1)静态地址转换ip nat inside source static 内部地址 合法地址 (全局配置模式)举例: ip nat inside source static 10.1.1.2 192.1.1.2在内部地址X和合法地址Y之间建立静态转换ip nat inside /说明该端口是内网接口ip nat outside /说明该端口是外网接口(2)动态地址转换ip nat pool 地址池名称 起始IP地址 终止IP地址 netmask 子网掩码 (全局配置模式)举例:ip nat pool poolA 192.1.1.2 192.1.1.10 netmask 255.255.255.0/设置合法地址池,名为PoolA, 地址范围为192.1.1.2~192.1.1.10,子网掩码为255.255.255.0access-list 标号 permit 源地址 通配符(其中标号为1~99间的整数)举例:access-list 1 permit 10.1.1.0 0.0.0.255定义标准访问列表1,指出10.1.1.0/24的本地地址进行NAT转换ip nat inside source list 访问列表标号 pool 地址池名称举例:ip nat inside source list 1 pool poolA设置:对访问列表1中设置的本地地址,应用PoolA池进行动态地址转换(3)复用动态地址转换ip nat inside source list 访问列表标号 pool 地址池名称 overload举例:ip nat inside source list 1 pool poolA overload设置:对访问列表1中设置的本地地址,应用PoolA池进行复用动态地址转换本文出自 51CTO.COM技术博客

本文出自 “技术学习” 博客,请务必保留此出处http://hankaixiaoyue.blog.51cto.com/1838323/344722

cisc 路由配置命令汇总 - 技术学习 - 51CTO技术博客 网络命令汇总 - 菜鸟小强 - 51CTO技术博客 锐捷网络交换机的配置命令集 - ckf网安技术小组 - 51CTO技术博客 Cisco IOS 基本命令集 - prozrtr - 51CTO技术博客 华为交换机、路由器命令集 - butter520 - 51CTO技术博客 AIX 常用命令汇总 - lengxf - 51CTO技术博客 Cisco交换机配置新手篇-端口配置(一) - SwitchMan - 51CTO技术博客 重读Route Print路由表的一些心得 - 许一君的原创技术博客 - 51CTO技术博... 学习 华为3COM 交换机配置的资料 (厂家资料) - lengxf - 51CTO技术博... 开始→运行→输入的命令集锦 - 紫砂狐 - 51CTO技术博客 WINDOWS XP 开始→运行→命令 集锦 - 网络与英语共享 - 51CTO技术博客 路由器NAT功能配置简介 - ★Beckham~23 - 51CTO技术博客 查看端口状态相关知识汇总 - wsbl - 51CTO技术博客 WINDOWS XP系统 开始→运行→命令 集合 - ☆阿川网络☆ - 51CTO技术博客 巧用“IP地址冲突” 揪出ARP病毒 - 网络学习与交流 - 51CTO技术博客 输入法故障 - 改变自己,做强者!!! - 51CTO技术博客 IP地址规划实例 - 星星之火 - 51CTO技术博客 C++/C程序员 - zkm - 51CTO技术博客 Windows2003下DNS架设攻略 - 大愚若智 - 51CTO技术博客 借助Sniffer分析网络流量 - 矩阵西点 - 51CTO技术博客 partprobe 小命令大作用 - seven - 51CTO技术博客 组策略基本功能使用 - jianyungao - 51CTO技术博客 交换机级联与堆叠的区别 - ckf网安技术小组 - 51CTO技术博客 集线器和交换机的区别 - ckf网安技术小组 - 51CTO技术博客