PACKET TRACTHER 4.1
做WAN
实验
实验前的思考与准备:
首先画好
TOP
图
给
ROUTER
安模板的时候要把电源关掉
然后连线
注意哪头是
DCE
,哪头是
DTE
,因为
DCE
要配时钟
连线规则:同类设备用交叉线
COPPER CROSS-OVER
,不同类设备之间用直连线
COPPER STRAIGHT-STROUGH.
要搞清楚实验的目的
:做不同网络之间的通信,
ROUTER
连接的两个不同的网络。
然后要注意哪个接口连接的是哪里。
(绿色的点代表网络是通的,此图为配置好
ROUTER0
的
F0/0
后的截图)
PC0 IP:192.168.1.111 PC1 IP: 10.0.0 .111
ROUTER0(DCE) F0/0:192.168.1.1 S0/0: 1.1.1 .1
ROUTER 1 F 0/0: 10.0.0 .1 S0/0:1.1.1.254
配置
PC0
的
IP
和子网掩码
配置
PC1
的
IP
和子网掩码
Router>en
Router#setup
--- System Configuration Dialog ---
Continue with configuration dialog? [yes/no]:
% Please answer 'yes' or 'no'.
Continue with configuration dialog? [yes/no]: y
At any point you may enter a question mark '?' for help.
Use ctrl-c to abort configuration dialog at any prompt.
Default settings are in square brackets '[]'.
Basic management setup configures only enough connectivity
for management of the system, extended setup will ask you
to configure each interface on the system
Would you like to enter basic management setup? [yes/no]: y
Configuring global parameters:
Enter host name [Router]: R1
The enable secret is a password used to protect access to
privileged EXEC and configuration modes. This password, after
entered, becomes encrypted in the configuration.
Enter enable secret: 123
The enable password is used when you do not specify an
enable secret password, with some older software versions, and
some boot images.
Enter enable password: 234
The virtual terminal password is used to protect
access to the router over a network interface.
Enter virtual terminal password: 123
Current interface summary
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES manual administratively down down
Serial0/0 unassigned YES manual administratively down down
Serial0/1 unassigned YES manual administratively down down
Serial0/2 unassigned YES manual administratively down down
Enter interface name used to connect to the
management network from the above interface summary: fastethernet0/0
Configuring interface FastEthernet0/0:
Configure IP on this interface? [yes]: n
The following configuration command script was created:
!
hostname R1
enable secret 5 $1$rBp.$.1kGR 1m3 xoMR0FufFawe..
enable password 234
line vty 0 4
password 123
!
interface FastEthernet0/0
no shutdown
no ip address
!
interface Serial0/0
shutdown
no ip address
!
interface Serial0/1
shutdown
no ip address
!
interface Serial0/2
shutdown
no ip address
!
end
[0] Go to the IOS command prompt without saving this config.
[1] Return back to the setup without saving this config.
[2] Save this configuration to nvram and exit.
Enter your selection [2]: o
% A decimal number between 0 and 2.
Enter your selection [2]: 0
% You can enter the setup, by typing setup at IOS command prompt
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int
Router(config)#interface fastethernet0/0
Router(config-if)#ip add 192.168.1.1 255.255.255.0
Router(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#exit
Router(config)#end
%SYS-5-CONFIG_I: Configured from console by console
Router#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
Router#sh ip int brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.1.1 YES manual up up
Serial0/0 unassigned YES manual administratively down down
Serial0/1 unassigned YES manual administratively down down
Serial0/2 unassigned YES manual administratively down down
(打开
S0/0
端口并配置
IP
)
注意:其余端口的打开和配置也是基本相同的!!!!!!!!!!!!!
端口配置好之后就可以配置缺省路由了:
R1>en
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip route 0.0.0 .0 0.0.0.0 1.1.1.254
R1(config)#no shut
^
% Invalid input detected at '^' marker.
R1(config)#end
%SYS-5-CONFIG_I: Configured from console by console
R1#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
(这是在
ROUTER1
中配置缺省路由,最后一个
IP
是
1.1.1
.254
,指向下一个
ROUTER
的
S0/0
端口)
当我们把端口配好之后,我们来看看各个端口的情况。
R1>
R1>en
R1#sh ip int brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.1.1 YES manual up up
Serial0/0 1.1.1 .1 YES manual up down
Serial0/1 unassigned YES manual administratively down down
Serial0/2 unassigned YES manual administratively down down
R1#
很奇怪,我们发现已经配置好了的
S0/0
端口是
DOWN
!然后再看看
ROUTER2
R2>
R2>en
R2#sh ip int brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 10.0.0 .1 YES manual up up
FastEthernet0/1 unassigned YES manual administratively down down
Serial0/0 1.1.1 .254 YES manual up down
Serial0/1 unassigned YES manual administratively down down
R2#
显然,
ROUTER2
的
S0/0
端口也是
DOWN
。而且现在不管你怎么进入
S0/0
端口,你都无法让
DOWN
变成
UP.
为什么呢?
因为我们还没有配置时钟
!!!!!!!DCE
默认是要配置时钟的。
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int
R1(config)#interface S0/0
R1(config-if)#CLOCK RATE ?
Speed (bits per second
1200
2400
4800
9600
19200
38400
56000
64000
72000
125000
128000
148000
250000
500000
800000
1000000
1300000
2000000
4000000
<300-4000000> Choose clockrate from list above
R1(config-if)#CLOCK RATE 128000
R1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
R1(config-if)#no shut
R1(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#config
R1(config)#config-register 0x2102
R1(config)#end
%SYS-5-CONFIG_I: Configured from console by console
R1#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
(时钟的配置要进入
S0/0
端口,配置好了,看一下)
R1#sh ip int brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.1.1 YES manual up up
Serial0/0 1.1.1 .1 YES manual up up
Serial0/1 unassigned YES manual administratively down down
Serial0/2 unassigned YES manual administratively down down
R1#
(可以看见刚才
DOWN
的端口打开了!!!!再打开
ROUTER2
看看)
R2#
R2#sh ip int brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 10.0.0 .1 YES manual up up
FastEthernet0/1 unassigned YES manual administratively down down
Serial0/0 1.1.1 .254 YES manual up up
Serial0/1 unassigned YES manual administratively down down
同样也是由
DOWN
变成了
UP.
现在我们来打开
PC0
做一下实验看看两个路由之间的网络是不是可以相互通信:
PC0
的
IP
是
192.168.1.111
指向路由的网关
192.168.1
如图,可以
PING
通自己。
如图:可以
PING
通指向路由的网关和路由的
S0/0
端口。
如图:可以
PING
通
ROUTER1
的
S0/0
端口和
F0/0
端口,说明两个路由之间是可以通信的。
如图:成功
PING
通
PC1
指向
ROUTER1
网关,并且成功
PING
通
PC1
(
10.0.0
.111
)
反之也是一样的,我就不再打开
PC1
再
PING PC0
了。至此实验完成!
注意事项总结如下:
一.
先画拓扑图便于实验配置,不至于将
IP
搞混。
二.
注意实验时设备间的线缆连接要选择正确。
三.
端口配置好了以后要配置
DCE
的时钟和缺省路由两个网络的计算机才可以完成通信。