路由器常用配置命令

更新时间:2023-06-10 00:53:10 阅读: 评论:0

Cisco常用配置命令 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 / 设置主机名为2950A
interface f0/23 / 进入端口23的配置模式
enable password cisco / 设置enable password为cisco
enable cret cisco1 / 设置enable cret为cisco1
ip address 192.168.1.1 255.255.255.0 / 设置交换机IP地址
ip default-gateway 192.168.1.254 / 设置默认网关
ip / 设置域名
ip name-rver 200.0.0.1 / 设置域名服务器
配置查看MAC地址表
mac-address-table ?
mac-address-table aging-time 100 / 设置超时是时间为100s
mac-address-table permanent 0000.0c01 /f0/3 加入永久地址
mac-address-table restricted static 0000.0c02.bbcc / f0/6 f0/7 加入静态地址游戏道具
end
show 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/s
dulplex full/half/auto /设置该端口为全双工
description TO_PC1 /设置该端口描述为TO_PC1
show interface fastethernet 0/1 /查看端口0/1的配置结果
show interface fastethernet 0/1 status /查看端口0/1的状态
配置VTP和STP
一. 配置VTP
2950A #vlan databa /进入VLAN配置子模式
show vtp status /查看VTP设置信息
show vlan /查看VLAN配置信息
中国画图片
成都理工大学排名copy running-config startup-config /保存配置文件
2950A(vlan)#vtp rver/client /设置本交换机为rver/client模式
vtp pruning /启动修剪功能
vtp domain vtprver /设置域名为vtprver
vlan 2 /创建VLAN2,系统将自动命名
vlan 3 name vlan3 /创建VLAN3,并命名为vlan3
Switch(config-if)#
switchport mode trunk /设置当前端口为Trunk模式
switchport trunk allowed vlan all /设置允许从该端口交换数据的VLAN
switchport trunk vlan remote vlan6 /设置允许交换数据的Vlan(除vlan6外)
switchport mode access /设置端口为静态VLAN访问模式
三年级语文教学计划switchport access vlan2 /将端口9分配给相信的VLAN2
show vlan
生成树协议配置(负载均衡)
Switch#
spanning-tree vlan 1 port-priority 10 /设置VLAN 1的端口的权值为10 (默认值为128)
spanning-tree vlan 1 cost 19 /设置VLAN 1生成树路径值为19
专题三 配置路由协议
Router# enable
Router#config terminal
Router(conf)#hostname R1
show ssion /查看终端服务器的会话
show line 1 /查看线路1的状态
clear line 2 /清除线路2
A. 静态路由
格式: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协议的版本为2
neighbor 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不自动根据每个接口的带宽,计算出其cost
ip ospf cost /手动设置接口的cost
area 1 range 172.16.4.0 255.255.255.0 /说明区域一的范围是子网172.16.4.0/24
心灵密码(4)配置EIGRP协议
no auto-summary 关闭EIGRP协议的路由自动汇总功能
network network-addr 掩码反码
广域网接入
一.配置ISDN
isdn switch-type switch-type /设置交换机类型为 switch-type
interface bri 0 /进入ISDN的BRI接口配置模式
encapsulation ppp /设置封装协议为ppp
ppp multilink /启动ppp多连接
dialer string 80000002 /设置拨号串,R2的ISDN号码为80000002
dialer-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和DDR
ppp authentication chap /设置PPP认证方式为CHAP
clockrate speed /设置DCE端线路速度为speed
dialer idle-timeout 120 /设置拨号空闲时间为120s
no cdp enable /禁止通过此接口传递CDP控制数据
dialer map ip 192.168.1.2 name R2 broadcast 800000002
/设置拨号串,将IP地址与ISDN的SPID对应起来.
uname R2 password cret
/设置用户名和口令,即设置拨号链路对端路由器名为R2,口令为cret.
三. 配置帧中继
frame-relay lmi-type cisco /设置帧中继的LMI类型为cisco
no frame-relay inver-arp /关闭帧中继逆向ARP口才艺术
王艺达
no ip address /只在数据链路层工作,无需IP地址
frame-relay interface-dlci dlci
interface rial 2 /进入串行口2端口配置模式
frame-relay route 303 interface Serial 1 302 在串行口2的DLCI 303与串行口1的DLCI 302之间
建立关联
show frame route /显示完整的路由信息

本文发布于:2023-06-10 00:53:10,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1031424.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:设置   配置   路由   协议
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图