分类: 系统运维
2011-01-17 21:55:46
要点:端口开销值设置相同。
配置命令:
R0配置:
Router>en
Router#config t
Enter configuration commands, one per line.
Router(config)#hostname r0
r0(config)#
r0(config)#int e1/0
r0(config-if)#ip address 192.168.20.2 255.255.255.0
r0(config-if)#no shutdown
r0(config)#int e1/1
r0(config-if)#ip address 192.168.30.1 255.255.255.0
r0(config-if)#no shutdown
r0(config-if)#exit
r0(config)#router ospf 100
r0(config-router)#net
r0(config-router)#network 192.168.20.0 0.0.0.255 area 0
r0(config-router)#network 192.168.30.0 0.0.0.255 area 0
r0(config-router)#exit
r0(config)#int e1/1
r0(config-if)#ip ospf cost 2
r0(config-if)#int e1/0
r0(config-if)#ip ospf cost 2
r0(config-if)#end
r0#ping 192.168.40.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.40.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 64/93/1
==========================================================================
Router>en
Enter configuration commands, one per line.
Router(config)#hostname r3
r3(config)#int loopback 0
r3(config-if)#ip address 10.10.10.10 255.255.255.255
r3(config-if)#no shutdown
r3(config-if)#int e1/1
r3(config-if)#ip address 192.168.40.2 255.255.255.0
r3(config-if)#no shutdown
r3(config-if)#int e1/0
r3(config-if)#ip address 192.168.30.2 255.255.255.0
r3(config-if)#no shutdown
r3(config-if)#exit
r3(config)#router ospf 100
r3(config-router)#network 192.168.30.0 0.0.0.255 area 0
r3(config-router)#network 192.168.40.0 0.0.0.255 area 0
r3(config-router)#exit
r3(config)#int e1/0
r3(config-if)#ip ospf cost 2
r3(config-if)#int e1/1
r3(config-if)#ip ospf cost 2
r3(config-if)#exit
r3(config)#router ospf 100
r3(config-router)#network 10.10.10.10 0.0.0.0 area 0
r3(config-router)#end
r3#show ip ospf database
Link ID
10.10.10.10
192.168.20.1
192.168.30.1
192.168.40.1
Link ID
192.168.10.1
192.168.20.1
192.168.30.2
192.168.40.2
r3#
====================================================================
Router>en
Router#config t
Enter configuration commands, one per line.
Router(config)#hostname r2
r2(config)#int e1/0
r2(config-if)#ip address 192.168.20.1 255.255.255.0
r2(config-if)#no shutdown
r2(config)#int e1/1
r2(config-if)#ip address 192.168.10.1 255.255.255.0
r2(config-if)#no shutdown
r2(config-if)#exit
r2(config)#router ospf 100
r2(config-router)#network 192.168.10.0 0.0.0.255 area 0
r2(config-router)#network 192.168.20.0 0.0.0.255 area 0
r2(config-router)#exit
r2(config)#int e1/0
r2(config-if)#ip ospf cos
r2(config-if)#ip ospf cost 2
r2(config-if)#int e1/1
r2(config-if)#ip ospf cost 2
r2#traceroute 10.10.10.10
Type escape sequence to abort.
Tracing the route to 10.10.10.10