ospf的路由汇总:通过LoopBack逻辑接口的一直处于up的状态并且属于直连、稳定。除设备坏了
路由汇总:就是把相同的网络位放一起,主机位用0表示或者是用二进制表示出相同的网络位
如:
1、192.168.1.0/24
2、192.168.2.0/24
3、192.168.3.0/24
汇总起来:192.168.0.0/16
精确的汇总则为:192.168.0000000100000000
192.168.0000001000000000
192.168.0000001100000000
192.168.0000010000000000
汇总为:192.168.00000 192.168.0.0 /21
脚本
AR1
system-view
sysname AR1
undo info-center enable
interface GigabitEthernet 0/0/0
ip address 192.168.12.1 24
quit
ospf 1 router-id 1.1.1.1
area 12
network 192.168.12.0 0.0.0.255
quit
quit
interface LoopBack1
IP address 172.110.30.1 24
quit
interface LoopBack2
IP address 172.110.40.1 24
quit
ospf 1
area 12
network 172.110.30.0 0.0.0.255
network 172.110.40.0 0.0.0.255
quit
quit
AR2
system-view
sysname AR2
undo info-center enable
interface GigabitEthernet 0/0/1
ip address 192.168.12.2 24
quit
interface GigabitEthernet 0/0/0
ip address 192.168.23.1 24
quit
ospf 1 router-id 2.2.2.2
area 12
network 192.168.12.0 0.0.0.255
quit
area 0
network 192.168.23.0 0.0.0.255
quit
quit
ospf 1
area 12
abr-summary 172.110.0.0 255.255.0.0
quit
quit
AR3
system-view
sysname AR3
undo info-center enable
interface GigabitEthernet 0/0/1
ip address 192.168.23.2 24
quit
interface GigabitEthernet 0/0/0
ip address 192.168.34.1 24
quit
ospf 1 router-id 3.3.3.3
area 0
network 192.168.23.0 0.0.0.255
network 192.168.34.0 0.0.0.255
quit
quit
AR4
system-view
sysname AR4
undo info-center enable
interface GigabitEthernet 0/0/1
ip address 192.168.34.2 24
quit
interface GigabitEthernet 0/0/0
ip address 192.168.45.1 24
quit
ospf 1 router-id 4.4.4.4
area 0
network 192.168.34.0 0.0.0.255
network 192.168.45.0 0.0.0.255
quit
quit
AR5
system-view
sysname AR5
undo info-center enable
interface GigabitEthernet 0/0/1
ip address 192.168.45.2 24
quit
ip address 192.168.56.1 24
quit
ospf 1 router-id 5.5.5.5
area 0
network 192.168.45.0 0.0.0.255
quit
area 56
network 192.168.56.0 0.0.0.255
quit
quit
AR6
system-view
sysname AR6
undo info-center enable
interface GigabitEthernet 0/0/1
ip address 192.168.56.2 24
quit
area 56
network 192.168.56.0 0.0.0.255
quit
quit
interface LoopBack1
IP address 129.11.166.1 24
quit
interface LoopBack2
IP address 129.11.188.1 24
quit
ospf 1
import-route direct
asbr-summary 129.11.0.0 255.255.0.0
quit
quit