conf t int f0/0 ip ospf priority 2 /改接口的优先级用来改变DR或者BDR exit clear ip ospf process? yes /改完接口的优先级必须要清理ospf的进程 必须要做的 R1 conf t int lo 0 /router ID,环回接口 ip add 1.1.1.1 255.255.255.255 exit int f0/1 ip add 172.16.20.1 255.255.255.0 exit router ospf 100 network 1.1.1.1 0.0.0.0 area 0 /router ID,反掩码,区域 network 172.16.20.1 0.0.0.0 area 0 end write R2 conf t int lo 0 ip add 2.2.2.2 255.255.255.255 exit int f0/0 ip add 172.16.20.2 255.255.255.0 exit int f0/1 ip add 172.16.30.1 255.255.255.0 exit router ospf 100 network 2.2.2.2 0.0.0.0 areao network 172.16.20.2 0.0.0.0 area 0 network 172.16.30.1 0.0.0.0 area 1 end write R3 conf t int lo 0 ip add 3.3.3.3 255.255.255.255 exit int f0/0 ip add 172.16.30.2 exit router ospf 101 network 3.3.3.3 0.0.0.0 area 1 network 172.16.30.2 0.0.0.0 area 1 end write 验证:R1 ping通3.3.3.3,也可以ping通172.16.30.2