找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
楼主: SteveVai

★路由器配置大全★(附图)

[复制链接]

334

主题

5624

回帖

6万

积分

新手上路

积分
67090
QQ
 楼主| 发表于 2005-4-9 07:13:24 | 显示全部楼层
八、常见问题<BR><BR>8.1如何检测网络是否通畅?<BR><BR>在网络主机上采用命令ping &lt;ip地址&gt; 来逐端检测网端。 <BR><BR>8.2如何查看路由器配置信息?<BR><BR>在EXEC模式下用show config命令。 <BR><BR>8.3如何查看路由器路由信息?<BR><BR>在EXEC模式下用show ip route 命令。 <BR><BR>8.4如何查看路由器端口信息?<BR><BR>EXEX模式下用show int &lt;端口号&gt; 命令。 <BR><BR>8.5为什么端口协议已经配置,状态仍然是down?<BR><BR>在CONFIG模式下,选择该端口,执行no shutdwon命令。 <BR><BR>8.6 config模式有几种状态,对应那些操作? <BR><BR>config模式有以下几种状态: <BR><BR>· globle config 全局配置操作 exec模式键入config t <BR><BR>· interface config 端口配置操作 config模式键入int &lt;端口号&gt; <BR><BR>· line config 线路配置操作 config模式键入line &lt;线路号&gt; <BR><BR>· router config 路由配置操作 config模式键入router&lt;路由协议&gt; <BR>
土豆网音色试听:
http://www.tudou.com/home/item_u13382671s0p1.html

334

主题

5624

回帖

6万

积分

新手上路

积分
67090
QQ
 楼主| 发表于 2005-4-9 07:13:42 | 显示全部楼层
结合实例讲解广域网路由基本技术 <BR>                      <BR>我们假定读者对IP协议有一定程度的了解(不了解IP协议永远无法维护一个IP网络),比如至少懂得IP地址的结构、类别和子网、子网掩码的概念,并且具有一定的计算机基础知识。在配置路由器时,只要将计算机的串口通过路由器自带的专用电缆接到Console口,使用诸如超级终端或者Netterm之类的软件即可。<BR><BR><BR>网络中的只有一块网卡(一个IP地址)任何一台主机只能直接访问本子网内的机器。而路由器相当于一台由多个网卡的主机,每一块网卡可以直接与一个子网通信。根据上图我们知道,两个网络相连主要是通过在其间建立一个广域网互联子网来进行。这个子网中只有两台机器,即两边的路由器,当然它的子网掩码就是255.255.255.252。只要路由器A、B的Seiral口在同一个子网,由于它们的Ethernet口分别属于A、B两网,我们就在A、B网之间建立了一条通道。网络A中的主机只要将网关设为路由器A,其信息即可通过路由器A、B转发到B网。 <BR><BR>  我们在例子中使用的是应用最广泛的Cisco 2501路由器,这种路由器物理结构简单,网络接口只有两个Serial口和一个Ethernet口,却支持完整的路由功能。采用的协议为TCP/IP,因为现在使用其他诸如IPX、Netbeui之类的协议已经是非常的不合时宜。 <BR><BR>实例1:通过Cisco 2501连接A局域网与B局域网<BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>假设实验条件如下: <BR><BR>A网:202.96.199.0——202.96.199.255<BR>B网:202.97.76.0——202.97.76.31<BR>DNS Server:202.96.199.2(主),202.96.199.3(备)<BR>所属域:xxx.com<BR>广域网互联:需要一个包含4个IP地址(2个可用IP)的子网,<BR>定为:202.98.0.0——202.98.0.3,其中202.98.0.1给A网,202.98.0.2给B网<BR>互联专线速率:128kbps<BR><BR><BR>具体网络参数分配表如下: <BR><BR>项目 A网 B网 <BR>网络号 202.96.199.0 202.97.76.0 <BR>子网掩码 255.255.255.0 255.255.255.224 <BR>所属域 xxx.com yyy.com <BR>以太网地址 202.96.199.1 202.97.76.1 <BR>互联地址 202.98.0.1 202.98.0.2 <BR>专线速率 128kbps 同左 <BR>域名服务器 主:202.96.199.2<BR>备:202.96.199.3 同左 <BR><BR> 首先进入路由器:将你的计算机串行口连接到路由器的Console口,使用Netterm或者超级终端之类的软件登录。<BR><BR><BR>Router&gt;en:<BR><BR>passwd:******(输入超级口令)<BR><BR><BR>全局配置:(A、B网相同) <BR><BR><BR>Router#conf terminal(切换到配置状态)<BR><BR>Router(config)#enable secret my-root-password(定义超级口令)<BR><BR>Router(config)#ip host Router-A(定义路由器名,B网为Router-B)<BR><BR>Router(config)#ip domain-name xxx.com(定义所属域名称,B网为yyy.com)<BR><BR>Router(config)#nameserver 202.96.199.2(定义主域名服务器)<BR><BR>Router(config)#nameserver 202.96.199.3(定义备域名服务器)<BR><BR>Router(config)#ip classless<BR><BR>Router(config)#line vty 0 4<BR><BR>(定义5个telnet虚终端,即可以同时有5个人登录本路由器)<BR><BR>Router(config-line)#password my-telnet-password(定义telnet口令)<BR><BR>Router(config-line)#exit<BR><BR>Router(config)#exit<BR>
土豆网音色试听:
http://www.tudou.com/home/item_u13382671s0p1.html

334

主题

5624

回帖

6万

积分

新手上路

积分
67090
QQ
 楼主| 发表于 2005-4-9 07:13:59 | 显示全部楼层
地址和路由配置: <BR><BR>/****** A网路由器 ******/<BR><BR>Router-A#conf t(切换到配置状态)<BR><BR>Router-A(config)#int e0(配置Ethernet 0口)<BR><BR>Router-A(config-if)#description the LAN port link to my local network(端口说明)<BR><BR>Router-A(config-if)#ip add 202.96.199.1 255.255.255.0<BR><BR>(定义以太网IP地址,子网掩码表示为C类网络)<BR><BR>Router-A(config-if)#no shutdown(激活端口)<BR><BR>Router-A(config-if)#exit<BR><BR>Router-A(config)#int s0(配置Serial 0口)<BR><BR>Router-A(config-if)#description the WAN port link to Router-B(端口说明)<BR><BR>Router-A(config-if)#ip add 202.98.0.1 255.255.255.252(定义互联广域网IP地址)<BR><BR>Router-A(config-if)#bandwidth 128(定义端口速率,单位:kbps)<BR><BR>Router-A(config-if)#no shutdown(激活端口)<BR><BR>Router-A(config-if)#exit<BR><BR>Router-A(config)#ip route 202.97.76.0 255.255.255.224 202.98.0.2<BR><BR>(定义静态路由,通过网关到达对端局域网络,IP为对端广域网IP地址)<BR><BR>Router-A(config)#exit<BR><BR>Router-A#wr m(保存配置)<BR><BR><BR>/****** B网路由器 ******/<BR><BR>Router-B#conf t<BR><BR>Router-B(config)#int e0<BR><BR>Router-B(config-if)#description the LAN port link to my local network(端口说明)<BR><BR>Router-B(config-if)#ip add 202.97.76.1 255.255.255.224<BR><BR>(定义以太网IP地址,子网掩码表示为拥有32个地址的子网)<BR><BR>Router-B(config-if)#no shutdown<BR><BR>Router-B(config-if)#exit<BR><BR>Router-B(config)#int s0<BR><BR>Router-B(config-if)#description the WAN port link to Router-A(端口说明)<BR><BR>Router-B(config-if)#ip add 202.98.0.2 255.255.255.252<BR><BR>Router-B(config-if)#bandwidth 128<BR><BR>Router-B(config-if)#no shutdown<BR><BR>Router-B(config-if)#exit<BR><BR>Router-B(config)#ip route 202.96.199.0 255.255.255.0 202.98.0.1<BR><BR>(定义静态路由,通过网关到达对端局域网络,IP为对端广域网IP地址)<BR><BR>Router-B(config)#exit<BR><BR>Router-B#wr m(保存配置)<BR><BR><BR>  配置完成。<BR>
土豆网音色试听:
http://www.tudou.com/home/item_u13382671s0p1.html

334

主题

5624

回帖

6万

积分

新手上路

积分
67090
QQ
 楼主| 发表于 2005-4-9 07:14:19 | 显示全部楼层
这里是A网、B网路由器配置清单。<BR>Router A:<BR><BR>Router-A#sh run <BR><BR>Building Configuration...<BR>Current configuration<BR>version 11.2<BR>service udp-small-servers<BR>service tcp-small-servers<BR>hostname Router-A<BR>enable secret test-a<BR>ip subnet-zero<BR>interface Ethernet0<BR>description the LAN port link to my local network<BR>ip address 202.96.199.1 255.255.255.0<BR>interface Serial0<BR>description the WAN port link to Router-B<BR>ip address 202.98.0.1 255.255.255.252<BR>bandwidth 128<BR>interface Serial1<BR>no ip address<BR>shutdown<BR>ip domain-name xxx.com<BR>ip name-server 202.96.199.2<BR>ip name-server 202.96.199.3<BR>ip classless<BR>ip route 202.97.76.0 255.255.255.224 202.98.0.2<BR>line con 0<BR>line aux 0<BR>line vty 0 4<BR>password telnet-a<BR>login<BR>end<BR>Router-A# <BR>Rouer B:<BR>Router-B#sh run <BR><BR>Building Configuration...<BR>Current configuration<BR>version 11.2<BR>service udp-small-servers<BR>service tcp-small-servers<BR>hostname Router-B<BR>enable secret test-b<BR>ip subnet-zero<BR>interface Ethernet0<BR>description the LAN port link to my local network<BR>ip address 202.97.76.1 255.255.255.224<BR>interface Serial0<BR>description the WAN port link to Router-A<BR>ip address 202.98.0.2 255.255.255.252<BR>bandwidth 128<BR>interface Serial1<BR>no ip address<BR>shutdown<BR>ip domain-name yyy.com<BR>ip name-server 202.96.199.2<BR>ip name-server 202.96.199.3<BR>ip classless<BR>ip route 202.96.199.0 255.255.255.0 202.98.0.1<BR>line con 0<BR>line aux 0<BR>line vty 0 4<BR>password telnet-b<BR>login<BR>end<BR>Router-B#<BR><BR><BR>实例2:通过Cisco 2501将你的局域网接入Internet <BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>假设实验条件如下: <BR><BR>本网IP地址为:202.96.199.0——202.96.199.255<BR>DNS Server:202.96.202.96(主),202.96.96.202(备)<BR>ISP分配的广域网互联IP地址为202.98.0.2<BR><BR><BR>具体网络参数分配表如下: <BR><BR>项目 用户网络 ISP网络 <BR>网络号 202.96.199.0 <BR>子网掩码 255.255.255.0 <BR>所属域 xxx.com <BR>以太网地址 202.96.199.1 <BR>互联地址 202.98.0.2 202.98.0.1 <BR>专线速率 128kbps 同左 <BR>域名服务器 主:202.96.202.96<BR>备:202.96.96.202 <BR><BR>我们已经有了上例的经验,则很容易根据相同的原理配置这个路由器。<BR>
土豆网音色试听:
http://www.tudou.com/home/item_u13382671s0p1.html

334

主题

5624

回帖

6万

积分

新手上路

积分
67090
QQ
 楼主| 发表于 2005-4-9 07:14:35 | 显示全部楼层
首先进入路由器: <BR><BR>Router&gt;en:<BR><BR>passwd:<BR><BR><BR>全局配置: <BR><BR>Router#conf t<BR><BR>Router(config)#ip host Router<BR><BR>Router(config)#nameserver 202.96.202.96<BR><BR>Router(config)#nameserver 202.96.96.202<BR><BR>Router(config)#exit<BR><BR>其他项目同“例一”。<BR><BR><BR>地址配置: <BR><BR>Router#conf t<BR><BR>Router(config)#int e0<BR><BR>Router(config-if)#description the LAN port link to my local network(端口说明)<BR><BR>Router(config-if)#ip add 202.96.199.1 255.255.255.0<BR><BR>Router(config-if)#no shutdown(激活端口)<BR><BR>Router(config-if)#exit<BR><BR>Router(config)#int s0<BR><BR>Router(config-if)#description the WAN port link to Internet(端口说明)<BR><BR>Router(config-if)#ip add 202.98.0.2 255.255.255.252<BR><BR>Router(config-if)#no shutdown(激活端口)<BR><BR>Router(config-if)#exit<BR><BR><BR>路由配置: <BR><BR>Router(config)#ip route 0.0.0.0 0.0.0.0 202.98.0.1<BR><BR>(定义默认静态路由,所有的远程访问通过网关,IP为对端广域网IP地址)<BR><BR>Router(config)#exit<BR><BR>Router#wr m<BR><BR><BR>  配置完成。<BR>
土豆网音色试听:
http://www.tudou.com/home/item_u13382671s0p1.html

334

主题

5624

回帖

6万

积分

新手上路

积分
67090
QQ
 楼主| 发表于 2005-4-9 07:14:53 | 显示全部楼层
这里是本网路由器配置清单。<BR>Router#sh run <BR>Building Configuration...<BR>Current configuration<BR>version 11.2<BR>service udp-small-servers<BR>service tcp-small-servers<BR>hostname Router<BR>enable secret test<BR>ip subnet-zero<BR>interface Ethernet0<BR>description the LAN port link to my local network<BR>ip address 202.96.199.1 255.255.255.0<BR>interface Serial0<BR>description the WAN port link to Internet<BR>ip address 202.98.0.2 255.255.255.252<BR>bandwidth 128<BR>interface Serial1<BR>no ip address<BR>shutdown<BR>ip domain-name xxx.com<BR>ip name-server 202.96.202.96<BR>ip name-server 202.96.96.202<BR>ip classless<BR>ip route 0.0.0.0 0.0.0.0 202.98.0.1<BR>line con 0<BR>line aux 0<BR>line vty 0 4<BR>password telnet<BR>login<BR>end<BR>Router# <BR>
土豆网音色试听:
http://www.tudou.com/home/item_u13382671s0p1.html

334

主题

5624

回帖

6万

积分

新手上路

积分
67090
QQ
 楼主| 发表于 2005-4-9 07:15:11 | 显示全部楼层
实例3:使用Cisco路由器对大型网络(例如ISP网络)进行扩容 <BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>  当然,设计管理大型网络的路由非常复杂,一般都是由经过高级培训的专业人士进行。而且,大型网络一般都采用像Cisco 7507这样的高档路由器。在这里顺便简单讲述,主要是让大家开阔一下视野,了解一下其他的路由协议。 <BR><BR>  这时,与例2唯一的不同就是路由配置,不能采用静态路由协议而应该相应地采用非常优秀的OSPF动态路由协议并结合RIP协议。 <BR><BR>假设具体网络参数如下: <BR><BR>项目 本地网络 <BR>网络号 202.96.199.0 <BR>子网掩码 255.255.255.0 <BR>OSPF编号 100 <BR>OSPF域 202.96.192.0——202.96.207.255,16个C <BR><BR>那么应该这样配置: <BR><BR>Router(config)#router ospf 100(配置OSPF路由)<BR><BR>Router(config-router)#summary-address 202.96.199.0 255.255.255.0<BR><BR>Router(config-router)#redistribute connnected metric-type 1 subnets<BR><BR>Router(config-router)#redistribute static(通过OSPF协议广播静态路由)<BR><BR>Router(config-router)#network 202.96.192.0 0.0.15.255 area 0.0.0.0<BR><BR>Router(config-router)#area 0.0.0.0 authentiication message-digest<BR><BR>Router(config-router)#exit<BR><BR>Router(config)#router rip(配置RIP路由)<BR><BR>Router(config-router)#redistribute ospf 100 metric 1(通过RIP协议广播OSPF路由)<BR><BR>Router(config-router)#passive-interface Serial 0(不在Serial 0上使用)<BR><BR>Router(config-router)#network 202.101.199.0(定义本网络)<BR><BR>Router(config-router)#exit<BR><BR>Router(config)exit<BR><BR><BR>同时,采用OSPF协议时应该在广域网端口上加入授权机制: <BR><BR>Router(config)#int s0<BR><BR>Router(config-if)#ip ospf message-digest-key keyword<BR><BR>Router(config-if)#exit<BR><BR>Router(config)#exit<BR><BR>Router#wr m<BR>
土豆网音色试听:
http://www.tudou.com/home/item_u13382671s0p1.html

334

主题

5624

回帖

6万

积分

新手上路

积分
67090
QQ
 楼主| 发表于 2005-4-9 07:15:28 | 显示全部楼层
更大型的网络会采用BGP边缘路由协议,假设具体网络参数如下: <BR><BR><BR>项目 本地网络 远程网络 <BR>AS(自治域) 20000 4000 <BR>本地BGP网络 202.96.192.0——202.96.207.255,16个C<BR>202.97.0.0——202.97.15.255,16个C<BR>202.98.128.0——202.98.159.255,32个C<BR>  <BR>互联地址 202.100.4.2 202.100.4.1 <BR><BR>则本地路由器配置方法为: <BR><BR>Router(config)#router bgp 20000(定义本BGP管理的AS--自治域编号)<BR><BR>Router(config-router)#no synchronization<BR><BR>Router(config-router)#network 202.96.192.0 mask 255.255.240.0<BR><BR>(定义本AS--自治域包含的网络)<BR><BR>Router(config-router)#network 202.97.0.0 mask 255.255.240.0<BR><BR>Router(config-router)#network 202.98.128.0 mask 255.255.224.0<BR><BR>Router(config-router)#neighbor 202.100.4.1 remote-as 4000<BR><BR>(定义到远端AS--自治域的网关IP)<BR><BR>Router(config-router)#exit<BR><BR>Router(config)#exit<BR><BR>Router#wr m<BR><BR><BR>  配置完成。<BR>
土豆网音色试听:
http://www.tudou.com/home/item_u13382671s0p1.html

334

主题

5624

回帖

6万

积分

新手上路

积分
67090
QQ
 楼主| 发表于 2005-4-9 07:15:44 | 显示全部楼层
用技术 <BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>一、使用口令加密机制: <BR><BR>Router(config)#service password-encryption(路由器密码将以暗码显示)<BR>二、配置http server,以便从浏览器访问路由器: <BR><BR>Router(config)#ip http server<BR>三、访问控制:<BR><BR><BR>Router(config)#access-list 101 permit ip 10.150.0.0 0.0.255.255 any<BR>  (允许10.150.0.0——10.150.255.255访问)<BR><BR><BR>Router(config)#access-list 101 deny ip 10.151.0.0 0.0.255.255 any<BR>  (禁止10.151.0.0——10.150.255.255访问)<BR><BR><BR>四、负载分担:<BR><BR><BR>要实现负载分担必须使用动态路由协议,以OSPF为例,只要将两条路由的代价(cost)设为相等,即可自动实现。<BR><BR><BR>默认的OSPF代价为广域网线路64,局域网线路30,设置路径代价的命令为:<BR>  Router(config-if)#ip ospf cost xx。<BR><BR><BR>五、常用命令: <BR><BR>Router#help/?(获得帮助)<BR>Router#sh run(显示路由器当前配置)<BR>Router#sh int Xn(接口名称,例如Ethernet 0、Serial 1等,显示接口状态)<BR>Router#sh ip route(显示当前路由)<BR>Router#wr m(储存配置,以便下次重启时使用)<BR>Router#reload(重启路由器)<BR>Router#ping ip-address(测试与其他主机的连接)<BR>Router#telnet host(登录其它主机)<BR>
土豆网音色试听:
http://www.tudou.com/home/item_u13382671s0p1.html

334

主题

5624

回帖

6万

积分

新手上路

积分
67090
QQ
 楼主| 发表于 2005-4-9 07:16:04 | 显示全部楼层
配置IP路由协议<BR>这一章我们主要介绍怎样配置各种各样的IP(Internet IP)路由协议.IP路由协议分成两大类:内部网关协议IGPs(Interior Gateway Protocols)和外部网关协议EGPs(Exterior Gateway Protocols).<BR><BR>选择路由协议的原则 配置IGRP Cisco's IGRP 的实现 IGRP的路由交换 IGRP的配置 配置Enhanced IGRP Cisco's Enhanced IGRP的实现 EIGRP的配置 IGRP到EIGRP的迁移 <BR>置RIP RIP的配置 RIP与IGRP,EIGRP的迁移 配置静态路由 IP路由协议的配置实例<BR>Cisco IOS支持的协议有:<BR><BR>内部网关协议(它是在一个自治系统内部交换路由信息的路由协议)----- IGRP, EIGRP, OSPF, RIP 和 IS-IS等等.<BR><BR>外部网关协议(它是为连接两个或多个自治系统的路由协议)----- BGP 和 EGP等等.<BR><BR>选择路由协议的原则<BR><BR>选择一个路由协议是一个非常复杂的工作.当选择路由协议,参考以下几点:<BR><BR>网络的大小和复杂性 <BR>支持可变长掩码(VLSM).Enhanced IGRP,IS-IS,OSPF和静态路由支持可变长掩码 <BR>网络流量大小 <BR>安全需要 <BR>网络延迟特性 <BR>下面就分别介绍各种路由协议的特点和配置.<BR><BR>配置IGRP<BR><BR>内部网关路由协议(Interior Gateway Routing Protocol---- IGRP)是一个动态的,长跨度的路由协议,它是Cisco公司八十年代中期设计实现的,在一个自治系统内具有高跨度,适合复杂网络的特点.<BR><BR>Cisco's IGRP的实现<BR><BR>IGRP的网络延迟,带宽,可靠性和负载都是可由用户配置决定的.<BR><BR>IGRP广播三种类型的路由:内部的,系统的和外部的.如图所示.内部的路由是在一台路由器的端口上连接子网的路由.如果一台路由器连接的网络是非子网的,IGRP就不广播内部路由.<BR>
土豆网音色试听:
http://www.tudou.com/home/item_u13382671s0p1.html
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Discuz! X

GMT+8, 2026-12-1 20:33 , Processed in 0.022544 second(s), 19 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表