步骤2在网络中各个路由器上启OSPF协议 R1(config)#router ospf 100
R1(config-router)#network 172.16.1.0 0.0.0.255 area 1 R1(config-router)#network 172.16.2.0 0.0.0.255 area 1 R1(config-router)#network 172.16.3.0 0.0.0.255 area 1 R1(config-router)#network 172.16.4.0 0.0.0.255 area 1 R1(config-router)#network 12.1.1.0 0.0.0.255 area 1
R1(config-router)#log-adjacency-changes //打开OSPF邻居状态日志 R2(config)#router ospf 100
R2(config-router)#network 12.1.1.0 0.0.0.255 area 1 R2(config-router)#network 23.1.1.0 0.0.0.255 area 0 R2(config-router)#log-adjacency-changes R3(config)#router ospf 100
R3(config-router)#network 23.1.1.0 0.0.0.255 area 0 R3(config-router)#network 34.1.1.0 0.0.0.255 area 2 R3(config-router)#log-adjacency-changes R4(config)#router ospf 100
R4(config-router)#network 34.1.1.0 0.0.0.255 area 2 R4(config-router)#log-adjacency-changes 步骤2 在R2上对区域1进行路由汇总 R2(config)#router ospf 100
R2(config-router)#area 1 range 172.16.0.0 255.255.248.0 步骤3在R2、R3之间做区域的MD5认证 R2(config)#int s1
R2(config-if)#ip ospf message-digest-key 1 md5 cisco //定义认证密钥
R2(config)#router ospf 100
R2(config-router)#area 0 authentication message-digest R3(config)#int s1
R3(config-if)#ip ospf message-digest-key 1 md5 cisco R3(config)#router ospf 100
R3(config-router)#area 0 authentication message-digest 步骤4 在R1与R2之间配置简单口令认证 R1(config)#int s0
R1(config-if)#ip ospf authentication-key stsd //配置密码为stsd
R1(config-router)#area 1 authentication //在区域1中开启认证 R2(config)#int s0
R2(config-if)#ip ospf authentication-key stsd R2(config-router)#area 1 authentication 步骤5修改hello、dead 间隔的值 R3(config)#int s0
R3(config-if)#ip ospf hello-interval 5 R3(config-if)#ip ospf dead-interval 20 R4(config)#int s0
R4(config-if)#ip ospf hello-interval 5 R4(config-if)#ip ospf dead-interval 20
步骤6 修改R4的s0接口的cost R4(config)#int s0
R4(config-if)#ip ospf cost 80
使用命令show ip ospf interface s0查看修改结果,包括RID,优先级,所属区域,计时器以及开销值等信息。 OSPF常用show命令:
Router#show ip protocol 显示路由器上运行的所有路由选择协议 Router#show ip route 显示完整的路由表 Router#show ip ospf 显示OSPF路由进程的基本信息 Router#show ip ospf interface 显示接口的OSPF相关信息 Router#show ip ospf interface 显示特定接口Fa0/0的OSPF信息 fastethernet 0/0 Router#show ip ospf border-routers 显示所有边界路由器信息 Router#show ip ospf neighbor 显示OSPF的邻居表 Router#show ip ospf neighbor detail 显示OSPF邻居的详细信息 Router#show ip ospf database 显示OSPF的数据库 OSPF常用debug命令
Router#debug ip ospf events Router#debug ip ospf adjacency Router#debug ip ospf packets
显示所有OSPF事件 显示OSPF邻居建立过程,可用来观察DR/BDR选举 显示所有OSPF数据包 DHCP 中继
拓扑:
需求:
1, client的DHCP请求通过ASA转发到DHCP-SER1跟DHCP-SER2上 2, ASA接收DCHP服务器的应答等待时间为120秒 3, 下发E1 (inside)地址为client的网关
DHCP-SER1配置:
Interface fa0/0
Ip add 192.168.1.1 255.255.255.0
No shutdown
Ip route 0.0.0.0 0.0.0.0 192.168.1.254
Ip dhcp pool DHCP
Network 10.1.1.0 /24
Default-router 10.1.1.254 Exit
Ip dhcp excluded-address 10.1.1.1 10.1.1.10 Wr
DHCP-SER2配置: Interface fa0/0
Ip add 192.168.1.2 255.255.255.0 No shutdown Exit
Ip dhcp pool DHCP Network 10.1.1.0 /24 Default-router 10.1.1.254
Ip dhcp excluded-address 10.1.1.1 10.1.1.10 Ip route 0.0.0.0 0.0.0.0 192.168.1.254 Wr ASA配置: