ospf配置:(Open Shortest Path First)
PC0 and PC1 via Ospf to communicate. Network map as below.
Environment:Cisco Packet Tracer
Set pc0 and pc1 static ip
PC0: 192.168.1.2
255.255.255.0
gw: 192.168.1.1
PC1: 192.168.2.2
255.255.255.0
gw: 192.168.2.1
Router0 (interface fa 0/0 and Se 0/1/0 ip config)
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int f0/0
Router(config-if)#ip add 192.168.1.1 255.255.255.0
Router(config-if)#no shu #端口开启
Router(config-if)#exit
Router(config)#int s0/0/0
Router(config-if)#ip add 192.168.3.1 255.255.255.0 #添加ip地址
Router(config-if)#no shu
Router1 (interface fa 0/0 and Se 0/1/0 ip config)
Router>en
Router#conf t
Router(config)#int f0/0
Router(config-if)#ip add 192.168.2.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#int s0/0/0
Router(config-if)#ip add 192.168.3.2 255.255.255.0
Router(config-if)#no shu
OSPF route config
Router0 OSPF Route config
Router(config-if)#exit
Router(config)#route ospf 10 #10是id进程号,可以随意定。范围为1-65535
Router(config-router)#network 192.168.1.0 0.0.0.255 area 0 #宣告1.0网段到区域0中
Router(config-router)#network 192.168.3.0 0.0.0.255 area 0
Router1 OSPF Route config
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#route ospf 10
Router(config-router)#network 192.168.2.0 0.0.0.255 area 0
Router(config-router)#network 192.168.3.0 0.0.0.255 area 0
Router(config-if)#no shu
test