发布ospf的路由协议,实现企业级网络通信

简介:
                 发布ospf的路由协议,实现企业级网络通信
 
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。 [url]http://shenleigang.blog.51cto.com[/url]

路由器的配置思路:
1,应用性:
1)配置端口:
1>局域网端口:
(config)#interface  端口
(config-if)#ip  address  IP地址   掩码
//给端口配置IP地址,掩码
(config-if)#no shutdown
//激活端口
2>广域网端口
(config)#interface  端口
(config-if)#ip  address  IP地址   掩码
//给端口配置IP地址,掩码
(config-if)#encapsulation   广域网协议
//封装协议
(config-if)# clock  rate   56000/64000
// 可选项,指定时钟频率
(config-if)#no shutdown
 
 
(config-router)#router   ospf   区域号
(config-router)#net   网络号/子网号/具体IP    匹配码  area  区域号
 
                              试验环境:PC1  192.168.10.2   网关192.168.10.1
          PC2: 192.168.20.2   网关192.168.20.1
   路由器A  S0:202.110.100.1
   路由器B,  S0:202.110.100.2
路由器A和PC1是公司的总部,路由器B和PC2是公司的分支机构,现在要实现总部和分支机构的通信,在中间的干线上采用DDN干线。

利用动态路由配置企业级环境需求:
 
路由器A上的操作。
Router>
Router>
Router>en
Router#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#host A
A(config)#int e0
A(config-if)#ip addr 192.168.10.1 255.255.255.0
A(config-if)#no shut
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up
A(config-if)#int s0
A(config-if)#ip addr 202.110.100.1 255.255.255.0
A(config-if)#encap hdlc
A(config-if)#clock rate 56000
A(config-if)#no shut
%LINK-3-UPDOWN: Interface Serial0, changed state to up
A(config-if)#exit
%LINK-3-UPDOWN: Interface Serial0, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to down
A(config)#router ospf 100
A(config-router)#net 192.168.10.0 0.0.0.255 area 0
A(config-router)#net 202.110.100.1 0.0.0.0 area 0
%LINK-3-UPDOWN: Interface Serial0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to up

A#
A#show ip ro
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
       U - per-user static route
Gateway of last resort is not set
C    192.168.10.0 is directly connected, Ethernet0
C    202.110.100.0 is directly connected, Serial0
O    192.168.20.0 [110/64] via 192.168.20.1, 00:02:10, Serial0
 
 
在路由器B上的操作:
Router>
Router>
Router>en
Router#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#host B
B(config)#int e0
B(config-if)#ip addr 192.168.20.1 255.255.255.0
B(config-if)#no shut
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up
B(config-if)#int s0
B(config-if)#ip addr 202.110.100.2 255.255.255.0
B(config-if)#encap hdlc
B(config-if)#no shut
%LINK-3-UPDOWN: Interface Serial0, changed state to up
B(config-if)#exit
B(config)#router ospf 100
B(config-router)#net 192.168.20.0 0.0.0.255 area 0
B(config-router)#net 202.110.100.2 0.0.0.0 area 0
 
B#
B#show ip ro
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
       U - per-user static route
Gateway of last resort is not set
C    192.168.20.0 is directly connected, Ethernet0
C    202.110.100.0 is directly connected, Serial0
O    192.168.10.0 [110/64] via 192.168.10.1, 00:04:36, Serial0
 

     本文转自shenleigang 51CTO博客,原文链接:http://blog.51cto.com/shenleigang/148790 ,如需转载请自行联系原作者

相关文章
|
1天前
|
缓存 网络协议 网络架构
【计算机网络】第三章 数据链路层(MAC地址 IP地址 ARP协议)
【计算机网络】第三章 数据链路层(MAC地址 IP地址 ARP协议)
|
4天前
|
Ubuntu 网络协议 Linux
Linux(20) Ubuntu 20.04 网络接口自动切换路由配置
Linux(20) Ubuntu 20.04 网络接口自动切换路由配置
27 0
|
9天前
|
网络协议 Java API
深度剖析:Java网络编程中的TCP/IP与HTTP协议实践
【4月更文挑战第17天】Java网络编程重在TCP/IP和HTTP协议的应用。TCP提供可靠数据传输,通过Socket和ServerSocket实现;HTTP用于Web服务,常借助HttpURLConnection或Apache HttpClient。两者结合,构成网络服务基础。Java有多种高级API和框架(如Netty、Spring Boot)简化开发,助力高效、高并发的网络通信。
|
10天前
|
存储 网络协议 安全
15.网络协议-Radius协议
15.网络协议-Radius协议
|
10天前
|
存储 网络协议 网络安全
14.网络协议-邮件协议
14.网络协议-邮件协议
|
14天前
|
存储 JSON 前端开发
网络原理(4)HTTP协议(下)
网络原理(4)HTTP协议
25 0
|
17天前
|
存储 网络协议 Linux
|
1月前
|
机器学习/深度学习 数据采集 人工智能
m基于深度学习网络的手势识别系统matlab仿真,包含GUI界面
m基于深度学习网络的手势识别系统matlab仿真,包含GUI界面
41 0
|
1月前
|
机器学习/深度学习 算法 计算机视觉
基于yolov2深度学习网络的火焰烟雾检测系统matlab仿真
基于yolov2深度学习网络的火焰烟雾检测系统matlab仿真
|
1月前
|
机器学习/深度学习 算法 计算机视觉
m基于深度学习网络的性别识别系统matlab仿真,带GUI界面
m基于深度学习网络的性别识别系统matlab仿真,带GUI界面
29 2