频 道 直 达 - 新闻 - 读书 - 培训 - 教程 - 前沿 - 组网 - 系统应用 - 安全 - 编程 - 存储 - 操作系统 - 数据库 - 服务器 - 专题 - 产品 - 案例库 - 技术圈 - 博客 - BBS
51CTO.COM_中国领先的IT技术网站
找资料:

实例讲解广域网路由基础

作者: 出处:51cto.com整理  (  ) 砖  (  ) 好  评论 ( ) 条  进入论坛
更新时间:2005-11-10 14:30
关 键 词:
阅读提示:引用实例讲解广域网路由基础

网络实例
- -
- - - -
- - ------------ ------------- - -
- A network - router-a ============== router-b - B network -
- - ------------ ------------- - -
- - - -
- -
|←----局域网----→|←---广域互联子网---→|←----局域网-----→|

网络中的只有一块网卡(一个IP地址)任何一台主机只能直接访问本子网内的机器。而路由器相当于一台由多个网卡的主机,每一块网卡可以直接与一个子网通信。根据上图我们知道,两个网络相连主要是通过在其间建立一个广域网互联子网来进行。这个子网中只有两台机器,即两边的路由器,当然它的子网掩码就是255.255.255.252。只要路由器A、B的Seiral口在同一个子网,由于它们的Ethernet口分别属于A、B两网,我们就在A、B网之间建立了一条通道。网络A中的主机只要将网关设为路由器A,其信息即可通过路由器A、B转发到B网。
我们在例子中使用的是应用最广泛的Cisco 2501路由器,这种路由器物理结构简单,网络接口只有两个Serial口和一个Ethernet口,却支持完整的路由功能。采用的协议为TCP/IP,因为现在使用其他诸如IPX、Netbeui之类的协议已经是非常的不合时宜。
实例1:通过Cisco 2501连接A局域网与B局域网

假设实验条件如下:
A网:202.96.199.0--202.96.199.255
B网:202.97.76.0--202.97.76.31
DNS Server:202.96.199.2(主),202.96.199.3(备)
所属域:xxx.com
广域网互联:需要一个包含4个IP地址(2个可用IP)的子网,
定为:202.98.0.0--202.98.0.3,其中202.98.0.1给A网,202.98.0.2给B网
互联专线速率:128kbps

具体网络参数分配表如下:
项目 A网 B网
网络号 202.96.199.0 202.97.76.0
子网掩码 255.255.255.0 255.255.255.224
所属域 xxx.com yyy.com
以太网地址 202.96.199.1 202.97.76.1
互联地址 202.98.0.1 202.98.0.2
专线速率 128kbps 同左
域名服务器 主:202.96.199.2
备:202.96.199.3 同左
首先进入路由器:将你的计算机串行口连接到路由器的Console口,使用Netterm或者超级终端之类的软件登录。

Router>en:
passwd:******(输入超级口令)

全局配置:(A、B网相同)

Router#conf terminal(切换到配置状态)
Router(config)#enable secret my-root-password(定义超级口令)
Router(config)#ip host Router-A(定义路由器名,B网为Router-B)
Router(config)#ip domain-name xxx.com(定义所属域名称,B网为yyy.com)
Router(config)#nameserver 202.96.199.2(定义主域名服务器)
Router(config)#nameserver 202.96.199.3(定义备域名服务器)
Router(config)#ip classless
Router(config)#line vty 0 4
(定义5个telnet虚终端,即可以同时有5个人登录本路由器)
Router(config-line)#password my-telnet-password(定义telnet口令)
Router(config-line)#exit
Router(config)#exit

地址和路由配置:
/****** A网路由器 ******/
Router-A#conf t(切换到配置状态)
Router-A(config)#int e0(配置Ethernet 0口)
Router-A(config-if)#description the LAN port link to my local network(端口说明)
Router-A(config-if)#ip add 202.96.199.1 255.255.255.0
(定义以太网IP地址,子网掩码表示为C类网络)
Router-A(config-if)#no shutdown(激活端口)
Router-A(config-if)#exit
Router-A(config)#int s0(配置Serial 0口)
Router-A(config-if)#description the WAN port link to Router-B(端口说明)
Router-A(config-if)#ip add 202.98.0.1 255.255.255.252(定义互联广域网IP地址)
Router-A(config-if)#bandwidth 128(定义端口速率,单位:kbps)
Router-A(config-if)#no shutdown(激活端口)
Router-A(config-if)#exit
Router-A(config)#ip route 202.97.76.0 255.255.255.224 202.98.0.2
(定义静态路由,通过网关到达对端局域网络,IP为对端广域网IP地址)
Router-A(config)#exit
Router-A#wr m(保存配置)

/****** B网路由器 ******/
Router-B#conf t
Router-B(config)#int e0
Router-B(config-if)#description the LAN port link to my local network(端口说明)
Router-B(config-if)#ip add 202.97.76.1 255.255.255.224
(定义以太网IP地址,子网掩码表示为拥有32个地址的子网)
Router-B(config-if )#no shutdown
Router-B(config-if)#exit
Router-B(config)#int s0
Router-B(config-if)#description the WAN port link to Router-A(端口说明)
Router-B(config-if)#ip add 202.98.0.2 255.255.255.252
Router-B(config-if)#bandwidth 128
Router-B(config-if)#no shutdown
Router-B(config-if)#exit
Router-B(config)#ip route 202.96.199.0 255.255.255.0 202.98.0.1
(定义静态路由,通过网关到达对端局域网络,IP为对端广域网IP地址)
Router-B(config)#exit
Router-B#wr m(保存配置)

配置完成。

这里是A网、B网路由器配置清单。
Router A:
Router-A#sh run
Building Configuration...
Current configuration
version 11.2
service udp-small-servers
service tcp-small-servers
hostname Router-A
enable secret test-a
ip subnet-zero
interface Ethernet0
description the LAN port link to my local network
ip address 202.96.199.1 255.255.255.0
interface Serial0
description the WAN port link to Router-B
ip address 202.98.0.1 255.255.255.252
bandwidth 128
interface Serial1
no ip address
shutdown
ip domain-name xxx.com
ip name-server 202.96.199.2
ip name-server 202.96.199.3
ip classless
ip route 202.97.76.0 255.255.255.224 202.98.0.2
line con 0
line aux 0
line vty 0 4
password telnet-a
login
end
Router-A#
Rouer B:
Router-B#sh run
Building Configuration...
Current configuration
version 11.2
service udp-small-servers
service tcp-small-servers
hostname Router-B
enable secret test-b
ip subnet-zero
interface Ethernet0
description the LAN port link to my local network
ip address 202.97.76.1 255.255.255.224
interface Serial0
description the WAN port link to Router-A
ip address 202.98.0.2 255.255.255.252
bandwidth 128
interface Serial1
no ip address
shutdown
ip domain-name yyy.com
ip name-server 202.96.199.2
ip name-server 202.96.199.3
ip classless
ip route 202.96.199.0 255.255.255.0 202.98.0.1
line con 0
line aux 0
line vty 0 4
password telnet-b
login
end
Router-B#


发表
查看
我也说两句

匿名发表

(如果看不清请点击图片进行更换)


中 国 领 先 的 IT 技 术 网 站 ·
技 术 成 就 梦 想
·路由器设置与口令恢复 (查看59341次)
·常用交换机典型配置 (查看35691次)
·网络管理员考试全真模拟试题(八.. (查看32408次)
·三层交换技术专题 (查看28285次)
·子网掩码教程 (查看25417次)
订阅技术快讯
电子杂志下载
名称:网络安全精品应用黄皮书
简介:《2007精品网络安全黄皮书》包括了9个大类24个小类, 800余篇文章,内容包含了熊猫烧香病毒、DDOS攻击、ARP病等热点问题的介绍及解决方案。从病毒查杀、防范、系统、数据等各方面的安全设置到黑客技术的了解、防范,涉及到了安全应用的全部领域, 由浅至深内容全面。
名称:Vista精品应用黄皮书
简介:《Vista精品应用黄皮书》囊括了Vista的各方面内容。此次的精简版,是将里面的内容做了提取,便于用户下载和使用。内容包含了各种Vista的安装与实施、技巧与解析以及各种Vista相关学习文档和相关软件的安全下载。该电子书是了解和应用Vista人员必备的工具手册,并且也是第一本
名称:2006中国IT论坛精品集合
简介:本书由“51CTO论坛推广联盟”制作完成。书中所有内容均来自各联盟成员的论坛(网站)。制作本书的目的是为了集中大家的优势资源,将更多更精彩的内容带给广大技术爱好者。本书是联盟成立以来制作的第一本书。
关键字阅读
频道精选
主编信箱 热线:010-66476606 告诉我们您想看的:专题 文章
关于我们 | 诚聘英才 | 联系我们 | 网站大事 | 意见反馈 | 网站地图
Copyright©2005-2007 51CTO.COM 版权所有