网站首页|中心简介|课程详解|师资力量|新闻动态|招生问答|就业广场|在线报名|学员天地|网络学院|在线留言|证书查询
大兴北大青鸟logo
北大青鸟教程网
学院首页|网络安全|操作系统|服务器|数据库|编程开发|组网建网|网络应用|网页设计|办公软件|注册表|黑客攻防
WIN XP  |  WIN 2000/2003  |  LINUX/UNIX  |  TCP/IP  |  IPV6  |  APACHE  |  DHCP  |  SENDMAIL  |  WLAN
局域网  |  广域网  |  综合布线  |  网络存储  |  入侵检测  |  防火墙  |  交换机  |  病毒防治
北大青鸟大兴中心QQ在线咨询 北大青鸟大兴中心QQ在线咨询 北大青鸟大兴中心QQ在线咨询 北大青鸟大兴中心QQ在线咨询 北大青鸟大兴中心QQ在线咨询
田老师
李老师
王老师
谈老师
臧老师
   当前位置:主页>网络学院>组网建网 >广域网>> 结合实例讲解广域网路由基本技术



  结合实例讲解广域网路由基本技术

文章来源:http://www.bdqnht.com/ 文章作者:北大青鸟 发布时间:2007-12-15

我们假定读者对IP协议有一定程度的了解(不了解IP协议永远无法维护一个IP 网络),比如至少懂得IP地址的结构、类别和子网、子网掩码的概念,并且具有一定的计算机基础知识。在配置路由器时,只要将计算机的串口通过路由器自带的专用电缆接到Console口,使用诸如超级终端或者Netterm之类的软件即可。

字串6

字串4

网络中的只有一块网卡(一个IP地址)任何一台主机只能直接访问本子网内的机器。而路由器相当于一台由多个网卡的主机,每一块网卡可以直接与一个子网通信。根据上图我们知道,两个网络相连主要是通过在其间建立一个广域网互联子网来进行。这个子网中只有两台机器,即两边的路由器,当然它的子网掩码就是255.255.255.252。只要路由器A、B的Seiral口在同一个子网,由于它们的Ethernet口分别属于A、B两网,我们就在A、B网之间建立了一条通道。网络A中的主机只要将网关设为路由器A,其信息即可通过路由器 A、B转发到B网。

字串2

我们在例子中使用的是应用最广泛的Cisco 2501路由器,这种路由器物理结构简单,网络接口只有两个Serial口和一个Ethernet口,却支持完整的路由功能。采用的协议为TCP/IP,因为现在使用其他诸如IPX、Netbeui之类的协议已经是非常的不合时宜。

字串1

实例1:通过Cisco 2501连接A局域网与B局域网 字串1


假设实验条件如下: 字串2

    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

    字串1

具体网络参数分配表如下: 字串5

    项目 字串5

    A网 字串4

    B网 字串3

    网络号

    字串6

    202.96.199.0 字串6

    202.97.76.0

    字串3

    子网掩码 字串6

    255.255.255.0 字串1

    255.255.255.224

    字串2

    所属域 字串8

    xxx.com 字串7

    yyy.com

    字串1

    以太网地址

    字串4

    202.96.199.1

    字串3

    202.97.76.1 字串6

    互联地址

    字串9

    202.98.0.1

    字串7

    202.98.0.2

    字串3

    专线速率 字串8

    128kbps

    字串8

    同左 字串7

    域名服务器 字串6

    主:202.96.199.2
    备:202.96.199.3

    字串3

    同左

    字串4

首先进入路由器:将你的计算机串行口连接到路由器的Console口,使用Netterm或者超级终端之类的软件登录。 字串8

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

    字串3

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

    字串1

    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 字串9 

    地址和路由配置: 字串8

    /****** 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(保存配置)
     
    字串8

配置完成。

字串6

这里是A网、B网路由器配置清单。
Router A:

字串7

        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: 字串8 
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# 字串1 


字串9

实例2:通过Cisco 2501将你的局域网接入Internet 字串3


假设实验条件如下:

字串7

    本网IP地址为:202.96.199.0——202.96.199.255
    DNS Server:202.96.202.96(主),202.96.96.202(备)
    ISP分配的广域网互联IP地址为202.98.0.2

    字串1

具体网络参数分配表如下: 字串5

    项目

    字串3

    用户网络

    字串3

    ISP网络

    字串6

    网络号

    字串7

    202.96.199.0

    字串9

      字串8

    子网掩码 字串7

    255.255.255.0

    字串6

      字串4

    所属域 字串3

    xxx.com

    字串8

     

    字串4

    以太网地址

    字串4

    202.96.199.1 字串2

      字串9

    互联地址 字串9

    202.98.0.2

    字串9

    202.98.0.1 字串4

    专线速率 字串5

    128kbps

    字串3

    同左

    字串9

    域名服务器

    字串2

    主:202.96.202.96
    备:202.96.96.202
    字串1

     

    字串4

我们已经有了上例的经验,则很容易根据相同的原理配置这个路由器。
字串1

首先进入路由器: 字串2

    Router>en:
    
    passwd:
    
     
    字串2

    全局配置:

    字串5

    Router#conf t
    
    Router(config)#ip host Router
    
    Router(config)#nameserver 202.96.202.96
    
    Router(config)#nameserver 202.96.96.202
    
    Router(config)#exit
    
    其他项目同“例一”。
    
     

    字串2

    地址配置:

    字串9

    Router#conf t
    
    Router(config)#int e0
    
    Router(config-if)#description the  LAN port link to my local network(端口说明)
    
    Router(config-if)#ip add 202.96.199.1 255.255.255.0
    
    Router(config-if)#no shutdown(激活端口)
    
    Router(config-if)#exit
    
    Router(config)#int s0
    
    Router(config-if)#description the  WAN port link to Internet(端口说明)
    
    Router(config-if)#ip add 202.98.0.2 255.255.255.252
    
    Router(config-if)#no shutdown(激活端口)
    
    Router(config-if)#exit
    
     字串9 

    路由配置: 字串8

    Router(config)#ip route 0.0.0.0 0.0.0.0 202.98.0.1
    
    (定义默认静态路由,所有的远程访问通过网关,IP为对端广域网IP地址)
    
    Router(config)#exit
    
    Router#wr m
    
     字串4 

配置完成。

字串8

这里是本网路由器配置清单。
Router#sh run 
Building Configuration...
Current configuration
version 11.2
service udp-small-servers
service tcp-small-servers
hostname Router
enable secret test
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 Internet
ip address 202.98.0.2 255.255.255.252
bandwidth 128
interface Serial1
no ip address
shutdown
ip domain-name xxx.com
ip name-server 202.96.202.96
ip name-server 202.96.96.202
ip classless
ip route 0.0.0.0 0.0.0.0 202.98.0.1
line con 0
line aux 0
line vty 0 4
password telnet
login
end
Router# 

字串3

实例3:使用Cisco路由器对大型网络(例如ISP网络)进行扩容 字串2


当然,设计管理大型网络的路由非常复杂,一般都是由经过高级培训的专业人士进行。而且,大型网络一般都采用像Cisco 7507这样的高档路由器。在这里顺便简单讲述,主要是让大家开阔一下视野,了解一下其他的路由协议。 字串9

这时,与例2唯一的不同就是路由配置,不能采用静态路由协议而应该相应地采用非常优秀的OSPF动态路由协议并结合RIP协议。

字串8

假设具体网络参数如下: 字串5

    项目

    字串4

    本地网络 字串3

    网络号 字串8

    202.96.199.0 字串7

    子网掩码 字串2

    255.255.255.0

    字串9

    OSPF编号 字串4

    100 字串9

    OSPF域

    字串4

    202.96.192.0——202.96.207.255,16个C

    字串9

那么应该这样配置:

字串4

    Router(config)#router ospf 100(配置OSPF路由)
    
    Router(config-router)#summary-address 202.96.199.0 255.255.255.0
    
    Router(config-router)#redistribute connnected metric-type 1 subnets
    
    Router(config-router)#redistribute static(通过OSPF协议广播静态路由)
    
    Router(config-router)#network 202.96.192.0 0.0.15.255 area 0.0.0.0
    
    Router(config-router)#area 0.0.0.0 authentiication message-digest
    
    Router(config-router)#exit
    
    Router(config)#router rip(配置RIP路由)
    
    Router(config-router)#redistribute ospf 100 metric 1(通过RIP协议广播OSPF路由)
    
    Router(config-router)#passive-interface Serial 0(不在Serial 0上使用)
    
    Router(config-router)#network 202.101.199.0(定义本网络)
    
    Router(config-router)#exit
    
    Router(config)exit
    
     

    字串9

    同时,采用OSPF协议时应该在广域网端口上加入授权机制: 字串7

    Router(config)#int s0
    
    Router(config-if)#ip ospf message-digest-key keyword
    
    Router(config-if)#exit
    
    Router(config)#exit
    
    Router#wr m
    
     字串2 

更大型的网络会采用BGP边缘路由协议,假设具体网络参数如下: 字串8

    项目

    字串9

    本地网络

    字串9

    远程网络 字串3

    AS(自治域)

    字串3

    20000

    字串6

    4000

    字串9

    本地BGP网络 字串3

    202.96.192.0——202.96.207.255,16个C
    202.97.0.0——202.97.15.255,16个C
    202.98.128.0——202.98.159.255,32个C
    字串1

     

    字串5

    互联地址

    字串7

    202.100.4.2

    字串5

    202.100.4.1 字串2

则本地路由器配置方法为:

字串6

    Router(config)#router bgp 20000(定义本BGP管理的AS--自治域编号)
    
    Router(config-router)#no synchronization
    
    Router(config-router)#network 202.96.192.0 mask 255.255.240.0
    
    (定义本AS--自治域包含的网络)
    
    Router(config-router)#network 202.97.0.0 mask 255.255.240.0
    
    Router(config-router)#network 202.98.128.0 mask 255.255.224.0
    
    Router(config-router)#neighbor 202.100.4.1 remote-as 4000
    
    (定义到远端AS--自治域的网关IP)
    
    Router(config-router)#exit
    
    Router(config)#exit
    
    Router#wr m
    
     字串8 

配置完成。


字串1

实用技术

字串2


一、使用口令加密机制: 字串6

    Router(config)#service password-encryption(路由器密码将以暗码显示) 字串2

二、配置http server,以便从浏览器访问路由器:

字串1

    Router(config)#ip http server 字串7

三、访问控制:

字串8

    Router(config)#access-list 101 permit ip 10.150.0.0 0.0.255.255 any
    (允许10.150.0.0——10.150.255.255访问)
    字串4

    Router(config)#access-list 101 deny ip 10.151.0.0 0.0.255.255 any
    (禁止10.151.0.0——10.150.255.255访问)

    字串5

四、负载分担:
字串7

    要实现负载分担必须使用动态路由协议,以OSPF为例,只要将两条路由的代价(cost)设为相等,即可自动实现。
    字串6

    默认的OSPF代价为广域网线路64,局域网线路30,设置路径代价的命令为:
    Router(config-if)#ip ospf cost xx。
    字串4

五、常用命令:

字串7

    Router#help/?(获得帮助)
    Router#sh run(显示路由器当前配置)
    Router#sh int Xn(接口名称,例如Ethernet 0、Serial 1等,显示接口状态)
    Router#sh ip route(显示当前路由)
    Router#wr m(储存配置,以便下次重启时使用)
    Router#reload(重启路由器)
    Router#ping ip-address(测试与其他主机的连接)
    Router#telnet host(登录其它主机)
    字串4

intext>Router(config)#router bgp 20000(定义本BGP管理的AS--自治域编号) Router(config-router)#no synchronization Router(config-router)#network 202.96.192.0 mask 255.255.240.0 (定义本AS--自治域包含的网络) Router(config-router)#network 202.97.0.0 mask 255.255.240.0 Router(config-router)#network 202.98.128.0 mask 255.255.224.0 Router(config-router)#neighbor 202.100.4.1 remote-as 4000 (定义到远端AS--自治域的网关IP) Router(config-router)#exit Router(config)#exit Router#wr m
  
字串5
     

配置完成。


字串5

实用技术 字串7


一、使用口令加密机制:

字串3

    Router(config)#service password-encryption(路由器密码将以暗码显示) 字串5

二、 字串5




  注:本站资源收集均来子互联网,如有侵权请告知,我们将第一时间删除.
  
上一篇: 结合实例讲解广域网路由基本技术   下一篇: 基于广域网的三种信息交换模型分析

::免费IT讲座::

时间:周六、日 下午14:00
地点:北大青鸟大兴校区
讲座内容:
     1、职业规划篇。
     2、日常实用技术讲座

主讲师:
     高级金牌讲师
 
大兴校区电话:69203100
 马甸校区电话:82011433
 
             免费订座报名

::免费讲座报名::
姓  名:
性  别:
学  历:
Q  Q:
电  话:
我是从:
知道的



北大青鸟|网络工程师|北京北大青鸟
  友情链接:北大青鸟集团 印度APTECH公司 北大青鸟APTECH公司 北京大学 北大青鸟马甸校区 上海北大青鸟 深圳北大青鸟 无锡北大青鸟 厦门北大青鸟 深圳北大青鸟 邵阳北大青鸟 北大青鸟镇江学府 深圳北大青鸟 徐州北大青鸟
中心图片
中心外景 前台接待区 网络教学区 路由及交换设备 机房环境 项目实践 职业规划师为同学解惑 学员积极回答问题 学员合影 学生宿舍 全国十佳中心奖杯 全国十佳中心奖牌 杰出贡献中心奖杯
  网站地图 | 联系我们 | 诚聘英才 | 在线留言 | 加入收藏 | 设为首页
 

版权所有 © 2004-2008 北京网络时尚信息技术有限公司
北大青鸟双合华腾网络工程师培训中心
大兴校区:大兴黄村长途汽车站东北角
招生热线:010-69203100/01 邮政编码:102600
马甸校区:北三环中路马甸桥东北角商房大厦(国美电器)626
招生热线:010-82011433/32 邮政编码:100029

网络工程师培训 网络工程师 北大青鸟培训 北大青鸟培训中心 网络培训
北大青鸟 北大青鸟网络工程师 北京北大青鸟 电脑培训 计算机培训
北大青鸟图标