用命令行配置OSPF路由协议

用命令行配置OSPF路由协议_第1张图片

拓扑图如上图所示,用命令行配置4台路由器的OSPF路由协议

打开命令行,输入下图所示的命令,保存退出后即配置成功

Router>enable
Router#config ter
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#router ospf 11                                //启动ID为11的ospf进程
Router(config-router)#network 192.1.1.0 0.0.0.255 area 1
Router(config-router)#network 192.1.2.0 0.0.0.255 area 1
Router(config-router)#network 192.1.4.0 0.0.0.255 area 1
Router(config-router)#network 192.1.6.0 0.0.0.255 area 1    //定义参与OSPF进程的接口或网络
Router(config-router)#exit
Router(config)#

 同理,配置其他三台路由器

Router>enable
Router#config ter
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#router ospf 22
OSPF process 22 cannot start. There must be at least one "up" IP interface
Router(config-router)#network 192.1.2.0 0.0.0.255 area 1
Router(config-router)#network 192.1.3.0 0.0.0.255 area 1
Router(config-router)#exit
Router(config)#
Router>enable
Router#config ter
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#router ospf 33
OSPF process 33 cannot start. There must be at least one "up" IP interface
Router(config-router)#network 192.1.4.0 0.0.0.255 area 1
Router(config-router)#network 192.1.5.0 0.0.0.255 area 1
Router(config-router)#exit
Router(config)#
Router>enable
Router#config ter
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#router ospf 44
OSPF process 33 cannot start. There must be at least one "up" IP interface
Router(config-router)#network 192.1.4.0 0.0.0.255 area 1
Router(config-router)#network 192.1.5.0 0.0.0.255 area 1
Router(config-router)#exit
Router(config)#

配置好后,在拓扑图上配置四台路由器的接口,然后配置好DNS服务器,填写两台PC的IP,就能用两台PC上服务器的网站

 

 

你可能感兴趣的:(p2p,网络,网络协议)