PACKET TRACTHER 4.1WAN实验<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

实验前的思考与准备:

首先画好TOP
ROUTER安模板的时候要把电源关掉
然后连线 注意哪头是DCE,哪头是 DTE,因为DCE要配时钟
连线规则:同类设备用交叉线COPPER CROSS-OVER,不同类设备之间用直连线COPPER STRAIGHT-STROUGH.
要搞清楚实验的目的:做不同网络之间的通信,ROUTER连接的两个不同的网络。
然后要注意哪个接口连接的是哪里。
<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />
(绿色的点代表网络是通的,此图为配置好ROUTER0F0/0后的截图)
PC0  IP:192.168.1.111          PC1  IP:<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />10.0.0.111
ROUTER0(DCE)   F0/0:192.168.1.1   S0/0:1.1.1.1
ROUTER1   F0/0:10.0.0.1      S0/0:1.1.1.254
配置PC0IP 和子网掩码
配置PC1IP 和子网掩码
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 p_w_picpaths.
  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.$.1kGR1m3xoMR0FufFawe..
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中配置缺省路由,最后一个IP1.1.1.254,指向下一个ROUTERS0/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#
显然,ROUTER2S0/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做一下实验看看两个路由之间的网络是不是可以相互通信:
       PC0IP192.168.1.111 指向路由的网关192.168.1 如图,可以PING通自己。
如图:可以PING通指向路由的网关和路由的S0/0端口。
如图:可以PING ROUTER1S0/0端口和F0/0端口,说明两个路由之间是可以通信的。
如图:成功PINGPC1指向ROUTER1网关,并且成功PINGPC110.0.0.111
   反之也是一样的,我就不再打开PC1PING PC0了。至此实验完成!
注意事项总结如下:
一.先画拓扑图便于实验配置,不至于将IP搞混。
二.注意实验时设备间的线缆连接要选择正确。
三.端口配置好了以后要配置DCE的时钟和缺省路由两个网络的计算机才可以完成通信。