NSSA區域處於邊界引入默認路由該怎麼處理呢?

如下圖的拓撲所示,

wKioL1hQ3R-xGEyWAAEo7_1N4a0225.png-wh_50

內部網絡的路由連接internet上,邊界的路由器的內部網口屬於ospf的NSSA區域,路由器上配置相應的默認路由指向internet的下一跳。內部網絡中跑着不同協議的路由信息,保證內部的OSPF區域當中還需要引入其他類型的路由信息;並且要保證內部網絡能夠正常訪問internet(在邊界的路由器上做NAT暫時忽略,保證網絡的連通性 )

怎麼保證內部的網絡能夠正常訪問internet呢?

具體的配置信息如下:

R5的路由配置信息:

router ospf 1
 log-adjacency-changes
 area 1 nssa
 redistribute connected subnets
 redistribute static subnets
 network 192.168.4.0 0.0.0.255 area 1
ip route 0.0.0.0 0.0.0.0 192.168.5.6

R4的路由配置信息:

router ospf 1
 log-adjacency-changes
 area 1 nssa default-information-originate no-summary
 network 4.4.4.0 0.0.0.255 area 1
 network 192.168.3.0 0.0.0.255 area 0
 network 192.168.4.0 0.0.0.255 area 1
!

R3的路由配置信息:

router ospf 1
 log-adjacency-changes
 redistribute rip metric 1 subnets
 network 3.3.3.0 0.0.0.255 area 0
 network 192.168.2.0 0.0.0.255 area 3
 network 192.168.3.0 0.0.0.255 area 0
!
router rip
 version 2
 redistribute ospf 1 metric 2
 network 192.168.1.0
 no auto-summary

R2路由配置信息:

router ospf 1
 log-adjacency-changes
 network 2.2.2.0 0.0.0.255 area 3
 network 192.168.2.0 0.0.0.255 area 3

R1路由配置信息:

router rip
 version 2
 network 1.0.0.0
 network 192.168.1.0
 no auto-summary
查看R1的路由信息

R1#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
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback1
     2.0.0.0/32 is subnetted, 1 subnets
R       2.2.2.2 [120/2] via 192.168.1.3, 00:00:16, FastEthernet0/0
     3.0.0.0/24 is subnetted, 1 subnets
R       3.3.3.0 [120/2] via 192.168.1.3, 00:00:16, FastEthernet0/0
     4.0.0.0/32 is subnetted, 1 subnets
R       4.4.4.4 [120/2] via 192.168.1.3, 00:00:16, FastEthernet0/0
     5.0.0.0/24 is subnetted, 1 subnets
R       5.5.5.0 [120/2] via 192.168.1.3, 00:00:16, FastEthernet0/0
R    192.168.4.0/24 [120/2] via 192.168.1.3, 00:00:16, FastEthernet0/0
R    192.168.5.0/24 [120/2] via 192.168.1.3, 00:00:16, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Loopback10
C    192.168.1.0/24 is directly connected, FastEthernet0/0
R    192.168.2.0/24 [120/2] via 192.168.1.3, 00:00:17, FastEthernet0/0
R    192.168.3.0/24 [120/2] via 192.168.1.3, 00:00:17, FastEthernet0/0
查看R2的路由信息:

R2#  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
     1.0.0.0/24 is subnetted, 1 subnets
O E2    1.1.1.0 [110/1] via 192.168.2.3, 04:44:05, FastEthernet0/1
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback2
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/2] via 192.168.2.3, 05:06:48, FastEthernet0/1
     4.0.0.0/32 is subnetted, 1 subnets
O IA    4.4.4.4 [110/12] via 192.168.2.3, 05:06:48, FastEthernet0/1
     5.0.0.0/24 is subnetted, 1 subnets
O E2    5.5.5.0 [110/20] via 192.168.2.3, 04:43:55, FastEthernet0/1
O IA 192.168.4.0/24 [110/21] via 192.168.2.3, 04:44:05, FastEthernet0/1
O E2 192.168.5.0/24 [110/20] via 192.168.2.3, 04:43:55, FastEthernet0/1
O E2 192.168.1.0/24 [110/1] via 192.168.2.3, 04:44:05, FastEthernet0/1
C    192.168.2.0/24 is directly connected, FastEthernet0/1
O IA 192.168.3.0/24 [110/11] via 192.168.2.3, 05:06:49, FastEthernet0/1

查看R5路由的信息:

R5#   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 192.168.5.6 to network 0.0.0.0
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/11] via 192.168.4.4, 00:09:53, Ethernet1/0
     5.0.0.0/24 is subnetted, 1 subnets
C       5.5.5.0 is directly connected, Loopback5
C    192.168.4.0/24 is directly connected, Ethernet1/0
C    192.168.5.0/24 is directly connected, Ethernet1/2
S*   0.0.0.0/0 [1/0] via 192.168.5.6

R5的LSDB信息:

R5#show ip ospf database
            OSPF Router with ID (5.5.5.5) (Process ID 1)
                Router Link States (Area 1)
Link ID         ADV Router      Age         Seq#       Checksum Link count
4.4.4.4         4.4.4.4         618         0x80000007 0x00A253 2
5.5.5.5         5.5.5.5         601         0x80000006 0x003ED1 1
                Net Link States (Area 1)
Link ID         ADV Router      Age         Seq#       Checksum
192.168.4.5     5.5.5.5         627         0x80000001 0x001277
                Summary Net Link States (Area 1)
Link ID         ADV Router      Age         Seq#       Checksum
0.0.0.0         4.4.4.4         473         0x80000001 0x00C065
                Type-7 AS External Link States (Area 1)
Link ID         ADV Router      Age         Seq#       Checksum Tag
0.0.0.0         4.4.4.4         482         0x80000001 0x005D34 0
5.5.5.0         5.5.5.5         715         0x80000001 0x00B24E 0
192.168.5.0     5.5.5.5         715         0x80000001 0x007E23 0

查看到R1上的LSDB也會產生相應的7類0.0.0.0的默認路由LSA,但是查看路由表中只有一條去往internet的默認路由;爲什麼沒有產生一條去往R2的默認路由呢?

是由於路由的管理距離起的作用,默認路由的管理距離是1 ,ospf的管理距離是110,管理距離是越小越優先,所以就沒有產生ospf的默認路由

解決方案:1、要麼修改Area 1的屬性,nssa區域修改成普通的area區域並要在邊界路由器的上注入默認路由(命令:default-information originate),保證內部網絡能夠正常訪問internet網絡

修改後:查看到的R1/R2上路由信息都能夠學習到一條外部引入的默認路由信息

具體的修改信息如下:

修改後R5的配置如下:

 log-adjacency-changes
 redistribute connected subnets
 redistribute static subnets
 network 192.168.4.0 0.0.0.255 area 1
 default-information originate
!
ip route 0.0.0.0 0.0.0.0 192.168.5.6

R4的配置信息:

router ospf 1
 log-adjacency-changes
 network 4.4.4.0 0.0.0.255 area 1
 network 192.168.3.0 0.0.0.255 area 0
 network 192.168.4.0 0.0.0.255 area 1
!
查看R1的路由信息:

R1#            show ip ro
R1#            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 192.168.1.3 to network 0.0.0.0
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback1
     2.0.0.0/32 is subnetted, 1 subnets
R       2.2.2.2 [120/2] via 192.168.1.3, 00:00:13, FastEthernet0/0
     3.0.0.0/24 is subnetted, 1 subnets
R       3.3.3.0 [120/2] via 192.168.1.3, 00:00:13, FastEthernet0/0
     4.0.0.0/32 is subnetted, 1 subnets
R       4.4.4.4 [120/2] via 192.168.1.3, 00:00:13, FastEthernet0/0
     5.0.0.0/24 is subnetted, 1 subnets
R       5.5.5.0 [120/2] via 192.168.1.3, 00:00:13, FastEthernet0/0
R    192.168.4.0/24 [120/2] via 192.168.1.3, 00:00:13, FastEthernet0/0
R    192.168.5.0/24 [120/2] via 192.168.1.3, 00:00:13, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Loopback10
C    192.168.1.0/24 is directly connected, FastEthernet0/0
R    192.168.2.0/24 [120/2] via 192.168.1.3, 00:00:14, FastEthernet0/0
R    192.168.3.0/24 [120/2] via 192.168.1.3, 00:00:14, FastEthernet0/0
R*   0.0.0.0/0 [120/2] via 192.168.1.3, 00:00:14, FastEthernet0/0

查看R2的路由信息:

R2#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 192.168.2.3 to network 0.0.0.0

     1.0.0.0/24 is subnetted, 1 subnets
O E2    1.1.1.0 [110/1] via 192.168.2.3, 00:04:04, FastEthernet0/1
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback2
     3.0.0.0/32 is subnetted, 1 subnets
O IA    3.3.3.3 [110/2] via 192.168.2.3, 05:25:49, FastEthernet0/1
     4.0.0.0/32 is subnetted, 1 subnets
O IA    4.4.4.4 [110/12] via 192.168.2.3, 05:25:49, FastEthernet0/1
     5.0.0.0/24 is subnetted, 1 subnets
O E2    5.5.5.0 [110/20] via 192.168.2.3, 00:04:04, FastEthernet0/1
O IA 192.168.4.0/24 [110/21] via 192.168.2.3, 00:04:19, FastEthernet0/1
O E2 192.168.5.0/24 [110/20] via 192.168.2.3, 00:04:04, FastEthernet0/1
O E2 192.168.1.0/24 [110/1] via 192.168.2.3, 00:04:04, FastEthernet0/1
C    192.168.2.0/24 is directly connected, FastEthernet0/1
O IA 192.168.3.0/24 [110/11] via 192.168.2.3, 05:25:49, FastEthernet0/1
O*E2 0.0.0.0/0 [110/1] via 192.168.2.3, 00:03:40, FastEthernet0/1

查看R2的LSDB信息:

R2#show ip ospf database
            OSPF Router with ID (2.2.2.2) (Process ID 1)
                Router Link States (Area 3)
Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         602         0x8000000D 0x005AC8 2
3.3.3.3         3.3.3.3         1666        0x8000000C 0x001F12 1
                Net Link States (Area 3)
Link ID         ADV Router      Age         Seq#       Checksum
192.168.2.2     2.2.2.2         602         0x8000000B 0x004E58
                Summary Net Link States (Area 3)
Link ID         ADV Router      Age         Seq#       Checksum
3.3.3.3         3.3.3.3         682         0x8000000B 0x009A7F
4.4.4.4         3.3.3.3         682         0x8000000B 0x00D03B
192.168.3.0     3.3.3.3         682         0x8000000D 0x00A806
192.168.4.0     3.3.3.3         396         0x80000001 0x001A95
                Summary ASB Link States (Area 3)
Link ID         ADV Router      Age         Seq#       Checksum
5.5.5.5         3.3.3.3         391         0x80000001 0x000305
                Type-5 AS External Link States
Link ID         ADV Router      Age         Seq#       Checksum Tag
0.0.0.0         5.5.5.5         359         0x80000001 0x00A4F9 1
1.1.1.0         3.3.3.3         1667        0x8000000A 0x009803 0
5.5.5.0         5.5.5.5         433         0x80000001 0x009CE0 0
192.168.1.0     3.3.3.3         1667        0x8000000A 0x00FF34 0
192.168.5.0     5.5.5.5         433         0x80000001 0x0068B5 0
網絡測試:
R2# ping 6.6.6.6   模擬的外部internet網絡
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/73/104 ms
R2#tracerou 6.6.6.6
Type escape sequence to abort.
Tracing the route to 6.6.6.6
  1 192.168.2.3 28 msec 12 msec 20 msec
  2 192.168.3.4 8 msec 24 msec 32 msec
  3 192.168.4.5 32 msec 40 msec 80 msec
  4 192.168.5.6 104 msec 60 msec 72 msec

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章