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


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#
实例2:通过Cisco 2501将你的局域网接入Internet
假设实验条件如下:
本网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
具体网络参数分配表如下:
项目 用户网络 ISP网络
网络号 202.96.199.0
子网掩码 255.255.255.0
所属域 xxx.com
以太网地址 202.96.199.1
互联地址 202.98.0.2 202.98.0.1
专线速率 128kbps 同左
域名服务器 主:202.96.202.96
备:202.96.96.202
我们已经有了上例的经验 , 则很轻易根据相同的原理配置这个路由器 。
首先进入路由器:
Router>en:
passwd:
全局配置:
Router#conf t
Router(config)#ip host Router
Router(config)#nameserver 202.96.202.96
Router(config)#nameserver 202.96.96.202

推荐阅读