实验要求:
全网互通
回环口宣告入较小的Area
两部分Area2产生域内路由
实验过程:
R1全配置:
en
conf t
no ip do lo
li co 0
no exec-t
logg s
ho R1
int lo0
ip add 11.11.1.1 255.255.255.255
int s2/0
en fr
no frame inverse
ip add 11.11.11.1 255.255.255.0
frame map ip 11.11.11.2 102 b
frame map ip 11.11.11.3 103 b
frame map ip 11.11.11.1 102
no sh //基于Hub-and-Spoke的帧中继配置
int s3/0
ip add 11.11.14.1 255.255.255.0
en fr
no frame inverse
frame map ip 11.11.14.4 114 b
frame map ip 11.11.14.1 114
ip ospf net point-to-point
no sh
router ospf 11
net 11.11.1.1 0.0.0.0 a 0
net 11.11.11.1 0.0.0.0 a 0
net 11.11.14.1 0.0.0.0 a 2
nei 11.11.11.2
nei 11.11.11.3 //NBMA网络需要指定邻居
exit
int tunn 0
ip unn s3/0
tunn sour 11.11.11.1
tunn des 11.11.25.5 //在R1上搭建到R5的tunnel,注意源IP与目的IP,在隧道建立后重新计算SPF时相应的路由条目不能发生变动,否则tunnel会翻动
R2全配置:
en
conf t
no ip do lo
li co 0
no exec-t
logg s
ho R2
int lo0
ip add 11.11.2.2 255.255.255.255
int s2/0
en fr
ip add 11.11.11.2 255.255.255.0
no frame inverse
frame map ip 11.11.11.1 201 b
frame map ip 11.11.11.3 201 b
frame map ip 11.11.11.2 201
ip ospf p 0
no sh
int f0/0
full
ip add 11.11.25.2 255.255.255.0
no sh
router ospf 11
net 11.11.11.2 0.0.0.0 a 0
net 11.11.2.2 0.0.0.0 a 0
net 11.11.25.2 0.0.0.0 a 5
R3全配置:
en
conf t
no ip do lo
li co 0
no exec-t
logg s
ho R3
int lo0
ip add 11.11.3.3 255.255.255.255
int f0/0
full
ip add 11.11.34.3 255.255.255.0
no sh
int s2/0
en fr
no frame inverse
ip add 11.11.11.3 255.255.255.0
frame map ip 11.11.11.1 301 b
frame map ip 11.11.11.2 301 b
frame map ip 11.11.11.3 301
ip ospf p 0
no sh
router ospf 11
net 11.11.11.3 0.0.0.0 a 0
net 11.11.3.3 0.0.0.0 a 0
net 11.11.34.3 0.0.0.0 a 2
R4全配置:
en
conf t
no ip do lo
li co 0
no exec-t
logg s
ho R4
int lo0
ip add 11.11.4.4 255.255.255.255
int f0/0
full
ip add 11.11.34.4 255.255.255.0
no sh
int s3/0
en fr
no frame inverse
ip add 11.11.14.4 255.255.255.0
frame map ip 11.11.14.1 411 b
frame map ip 11.11.14.4 411
ip ospf net point-to-point
no sh
router ospf 11
net 11.11.34.4 0.0.0.0 a 2
net 11.11.4.4 0.0.0.0 a 2
net 11.11.14.4 0.0.0.0 a 2
R5全配置:
en
conf t
no ip do lo
li co 0
no exec-t
logg s
ho R5
int lo0
ip add 11.11.5.5 255.255.255.255
int f0/0
full
ip add 11.11.25.5 255.255.255.0
no sh
int f1/0
full
ip add 11.11.55.5 255.255.255.0
no sh
router ospf 11
net 11.11.5.5 0.0.0.0 a 2
net 11.11.25.5 0.0.0.0 a 5
net 11.11.55.5 0.0.0.0 a 2
exit
int tunn 0
ip unn lo0
tunn sour 11.11.25.5
tunn des 11.11.11.1 //搭建到R1的tunnel,注意源IP与目的IP
exit
SW1全配置:
en
conf t
no ip do lo
li co 0
no exec-t
logg s
int range f0/2 , f0/5
sw ac vl 25
no sh
int range f0/3 - 4
sw ac vl 34
no sh
SW2全配置:
en
conf t
no ip do lo
li co 0
no exec-t
logg s
ho SW2
int f0/5
sw ac vl 55
no sh
end
测试:
R4上show ip route:
R4#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
11.0.0.0/8 is variably subnetted, 10 subnets, 2 masks
O 11.11.5.5/32 [110/11176] via 11.11.14.1, 00:14:49, Serial3/0
C 11.11.4.4/32 is directly connected, Loopback0
O IA 11.11.3.3/32 [110/2] via 11.11.34.3, 00:14:49, FastEthernet0/0
O IA 11.11.2.2/32 [110/66] via 11.11.34.3, 00:14:49, FastEthernet0/0
O IA 11.11.1.1/32 [110/65] via 11.11.14.1, 00:14:49, Serial3/0
O IA 11.11.11.0/24 [110/65] via 11.11.34.3, 00:14:49, FastEthernet0/0
C 11.11.14.0/24 is directly connected, Serial3/0
O IA 11.11.25.0/24 [110/66] via 11.11.34.3, 00:14:49, FastEthernet0/0
C 11.11.34.0/24 is directly connected, FastEthernet0/0
O 11.11.55.0/24 [110/11176] via 11.11.14.1, 00:14:49, Serial3/0 //R4上到R5上已经成为域内路由