拓扑图
计算开销值
经过计算,R1到4.4.4.4的Cost值为49
R4 S2/0/0的开销 = 100 / 2.048 ≈ 48
R1 G0/0/0的开销 = 1
验证:display ip routing-table protocol ospf
各个路由器配置命令
sys
sysname R1
int g0/0/0
ip add 192.168.0.1 24
ospf dr-pri 200
ospf 1 router-id 1.1.1.1
area 0
network 192.168.0.0 0.0.0.255
int g0/0/0
ospf authentication-mode md5 1 cipher huawei
sys
sysn R2
int g0/0/0
ip add 192.168.0.2 24
ospf dr-pri 100
ospf 1 router-id 2.2.2.2
area 0
network 192.168.0.0 0.0.0.255
int g0/0/0
ospf authentication-mode md5 1 cipher huawei
sys
sysn R3
int g0/0/0
ip add 192.168.0.3 24
int s2/0/0
ip add 34.0.0.3 8
ospf 1 router-id 3.3.3.3
area 0
network 192.168.0.0 0.0.0.255
network 34.0.0.0 0.255.255.255
int g0/0/0
ospf authentication-mode md5 1 cipher huawei
sys
sysname R4
ip route-static 0.0.0.0 0 48.0.0.8
int s2/0/0
ip add 34.0.0.4 8
int g0/0/0
ip add 48.0.0.4 8
int lo 1
ip add 4.4.4.4 32
ospf 1 router-id 4.4.4.4
default-route-advertise
area 0
network 34.0.0.0 0.255.255.255
network 4.4.4.4 0.0.0.0
sys
sysn R6
int g0/0/0
ip add 192.168.0.6 24
ospf 1 router-id 6.6.6.6
area 0
network 192.168.0.0 0.0.0.255
int g0/0/0
ospf authentication-mode md5 1 cipher huawei
sys
sysn R8
int g0/0/0
ip add 48.0.0.8 8
ip route-s 0.0.0.0 0 48.0.0.4
int lo 1
ip add 8.8.8.8 32
标签:g0,int,0.0,缺省,add,Demo1,BR,ip,ospf From: https://www.cnblogs.com/zx654042919/p/18088434