OSPF的stub区域

 

1、 OSPF的stub区域

 

a、 stub区域不能学习外部路由,只能通过默认路由

 

b、 在区域内配置:area 区域-id stub






R1配置

en
conf t
hostname R1
 
int loopback 0
ip address 1.1.1.1 255.255.255.0
no shutdown
exit
 
int f0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
exit
 
router ospf 1
network 1.1.1.0 0.0.0.255 area 1
network 192.168.1.0 0.0.0.255 area 1
area 1 stub
exit
end


 

 

R2配置

en
conf t
hostname R2
 
int loopback 0
ip address 2.2.2.2 255.255.255.0
no shutdown
exit
 
int f0/0
ip address 192.168.1.2 255.255.255.0
no shutdown
exit
 
int f0/1
ip address 192.168.2.1 255.255.255.0
no shutdown
exit
 
router ospf 1
network 2.2.2.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 1
network 192.168.2.0 0.0.0.255 area 0
area 1 stub
exit
end


 

 

R3配置

en
conf t
hostname R3
 
int loopback 0
ip address 3.3.3.3 255.255.255.0
no shutdown
exit
 
int f0/1
ip address 192.168.2.2 255.255.255.0
no shutdown
exit
 
int f0/0
ip address 202.168.1.1 255.255.255.0
no shutdown
exit
 
router ospf 1
network 192.168.2.0 0.0.0.255 area 0
network 3.3.3.0 0.0.0.255 area 0
redistribute static metric-type 1 subnets
exit
 
 
ip route 4.4.4.0 255.255.255.0 f0/0
end

 

 

 

R4配置

en
conf t
hostname R4
 
int f0/0
ip address 202.168.1.2 255.255.255.0
no shutdown
exit
 
int loopback 0
ip address 4.4.4.4 255.255.255.0
no shutdown
exit
 
ip route 0.0.0.0 0.0.0.0 f0/0
end


 

 

 

 

 

R1#show ip ospf database

           OSPF Router with ID (1.1.1.1) (Process ID 1)

 

                Router Link States (Area 1)

 

Link ID         ADV Router      Age         Seq#       Checksum Link count

1.1.1.1         1.1.1.1         135         0x80000003 0x00500e 2

2.2.2.2         2.2.2.2         135        0x80000002 0x005515 1

 

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum

192.168.1.2     2.2.2.2         135         0x80000001 0x00741f

 

                Summary Net Link States (Area1)

Link ID         ADV Router      Age         Seq#       Checksum

192.168.2.0     2.2.2.2         115         0x80000001 0x008f5b

0.0.0.0         2.2.2.2         115         0x80000002 0x0055ff

2.2.2.2         2.2.2.2         115         0x80000003 0x00f655

3.3.3.3         2.2.2.2         115         0x80000004 0x00d075

R1#show ip route

Codes: C - connected, S - static, I - IGRP,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 - OSPFexternal type 2, E - EGP

       i - IS-IS, 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 192.168.1.2 tonetwork 0.0.0.0

 

    1.0.0.0/24 is subnetted, 1 subnets

C      1.1.1.0 is directly connected, Loopback0

    2.0.0.0/32 is subnetted, 1 subnets

O IA   2.2.2.2 [110/2] via 192.168.1.2, 00:01:52, FastEthernet0/0

    3.0.0.0/32 is subnetted, 1 subnets

O IA   3.3.3.3 [110/3] via 192.168.1.2, 00:01:52, FastEthernet0/0

C   192.168.1.0/24 is directly connected, FastEthernet0/0

O IA 192.168.2.0/24 [110/2] via192.168.1.2, 00:01:52, FastEthernet0/0

O*IA 0.0.0.0/0 [110/2] via 192.168.1.2,00:01:52, FastEthernet0/0

 

 

解释:存根区域不能学习外部路由,可以通过默认路由0.0.0.0

 

 

R2#show ip ospf database

           OSPF Router with ID (2.2.2.2) (Process ID 1)

 

                Router Link States (Area 0)

 

Link ID         ADV Router      Age         Seq#       Checksum Link count

2.2.2.2         2.2.2.2         22          0x80000003 0x0057f7 2

3.3.3.3         3.3.3.3         22          0x80000003 0x004af6 2

 

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum

192.168.2.2     3.3.3.3         22         0x80000001 0x007f07

 

                Summary Net Link States (Area0)

Link ID         ADV Router      Age         Seq#       Checksum

192.168.1.0     2.2.2.2         17          0x80000001 0x009a51

1.1.1.1         2.2.2.2         17          0x80000002 0x00311f

 

                Router Link States (Area 1)

 

Link ID         ADV Router      Age         Seq#       Checksum Link count

2.2.2.2         2.2.2.2         22          0x80000003 0x005316 1

1.1.1.1         1.1.1.1         22          0x80000003 0x00500e 2

 

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum

192.168.1.2     2.2.2.2         22          0x80000001 0x00741f

 

                Summary Net Link States (Area1)

Link ID         ADV Router      Age         Seq#       Checksum

2.2.2.2         2.2.2.2         17          0x80000001 0x00fa53

 

R2#show ip route

Codes: C - connected, S - static, I - IGRP,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 - OSPFexternal type 2, E - EGP

       i - IS-IS, 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

 

    1.0.0.0/32 is subnetted, 1 subnets

O      1.1.1.1 [110/2] via 192.168.1.1, 00:00:20, FastEthernet0/0

    2.0.0.0/24 is subnetted, 1 subnets

C      2.2.2.0 is directly connected, Loopback0

    3.0.0.0/32 is subnetted, 1 subnets

O      3.3.3.3 [110/2] via 192.168.2.2, 00:00:15, FastEthernet0/1

    4.0.0.0/24 is subnetted, 1 subnets

O E1   4.4.4.0 [110/21] via 192.168.2.2, 00:00:15, FastEthernet0/1

C   192.168.1.0/24 is directly connected, FastEthernet0/0

C   192.168.2.0/24 is directly connected, FastEthernet0/1

 

 

 

解释:非存根区域能学习外部路由OE1


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值