路由
两种线缆
- 直通电缆
- 交叉电缆
show ip route 查看路由表
show ip inter b 查看接口简要配置信息
1. 配置路由器主机名。Hostname
2. 禁用 DNS 查找。No ip domain-lookup
3. 配置执行模式口令。enable secret class
4. 配置当天消息标语。Banner motd #
5. 配置控制台连接的口令。Line con 0
6. 配置 VTY 连接的口令。 Line vty 0 4
7. 将控制台和虚拟终端线路自动提供的消息和调试输出与所请求的输出以及提示相同步。logging synchronous
8. 将执行超时配置为 15 分钟。exec-timeout 15
使用default-information originate 命令将该静态路由包括在从路由器 R1 发出
**的 OSPF 更新中。**default-information originate
router ospf 1
de o
路由器常用指令
清除配置
erase s
重新加载
reload
#基本配置命令
en
conf t
hostname name
no ip domain-lookup
enable se class
ban motd #
message
#
line con 0
exec-timeout 0 0 超时设置 exec-timeout minutes [seconds]
password cisco
logg s 就是说 logging synchronous 命令能防止传送到控制台或 Telnet 线路的 IOS 消息对您的键盘输入造成干扰。
login
exit
line vty 0 4
password cisco
logg s
login
exit
基本接口配置
以太网接口
inter fa0/0
ip addr 192.168.1.1 255.255.255.0
desc miaoshu
no shut
exit
串行接口
inter se0/0/0
ip addr 192.168.1.2 255.255.255.0
desc miaosh
clock rate 64000 (DCE)_
no shut
exit
静态路由配置
ip route 子网 子网掩码 下一跳ip地址/送出接口
ip route 192.168.1.0 255.255.255.0 se0/0/0
删除
no ip route 192.168.1.0 255.255.255.0 se0/0/0
缺省路由
ip route 0.0.0.0 0.0.0.0 se0/0/0 or exit-address
路由汇总
ip route 172.16.1.0 255.255.255.0 se0/0/1
ip route 172.16.2.0 255.255.255.0 se0/0/1
ip route 172.16.3.0 255.255.255.0 se0/0/1
汇总
ip route 172.16.0.0 255.255.252.0 se0/0/1
动态路由配置 OSPF
router ospf 1
network 172.16.1.16 0.0.0.15 area 0
network 192.168.10.0 0.0.0.3 area 0
network 192.168.10.4 0.0.0.3 area 0
配置环回接口
inter l0
ip addr ip-address ip-mask
设置路由器id
router ospf 1
router-id ip-address
修改路由器Id
router ospf 1
router-id ip-address
clear ip ospf process 重新加载生效
校验OSPF
显示邻居关系
show ip ospf neig
show ip p
show ip ospf
show ip ospf neig
show ip ospf inter
配置 OSPF Hello 间隔和Dead 间隔
inter se0/0/0
ip ospf h 5
ip ospf d 10
修改带宽
inter se0/0/0
band 64
等价
inter se0/0/0
ip ospf cost 156
使用auto-cost reference-bandwidth 命令调整参考带宽值。