华为OSPF基础配置实验
【R1】 u t t #关闭系统提示 system-view #进入系统视图 sysname R1 #设备更名为R1 interface loopback 0 #创建loopback 0接口 ip add 1.1.1.1 32 #配置IP地址为1.1.1.1/32 int g0/0/0 #进入g0/0/0接口 ip add 192.168.1.254 24 #配置IP地址和掩码 int g0/0/1 ip add 192.168.100.2 30 int g0/0/2 ip add 192.168.100.5 30 quit ospf 1 router-id 1.1.1.1 #启动OSPF进程,进程号为1,同时指定router-id为该设备loopback接口地址 area 0 #进入区域0 network 192.168.100.2 0.0.0.0 #宣告接口g0/0/1 network 192.168.100.5 0.0.0.0 #宣告接口g0/0/2 network 192.168.1.254 0.0.0.0 #宣告接口g0/0/0 return save
【R2】 u t t system-view sysname R2 interface loopback 0 ip add 2.2.2.2 32 int g0/0/0 ip add 192.168.2.254 24 int g0/0/1 ip add 192.168.100.1 30 quit ospf 1 router-id 2.2.2.2 area 0 network 192.168.100.1 0.0.0.0 network 192.168.2.254 0.0.0.0 return save
【R3】 u t t system-view sysname R3 interface loopback 0 ip add 3.3.3.3 32 int g0/0/0 ip add 192.168.3.254 24 int g0/0/2 ip add 192.168.100.6 30 quit ospf 1 router-id 3.3.3.3 area 0 network 192.168.100.6 0.0.0.0 network 192.168.3.254 0.0.0.0 return save