Router Interface Configuration

简介:
Objective :
- Building a topology 
- Configuring FastEthernet and Serial interfaces.
 
Scenario :
This topology represents the simplest possible two router network.
 
如上图进行简单的配置
首先配置ROUTER0:
刚打开路由器:

Self decompressing the image :
########################################################################## [OK]
              Restricted Rights Legend
Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.
           cisco Systems, Inc.
           170 West Tasman Drive
           San Jose, California 95134-1706
 
Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-I-M), Version 12.2(28), RELEASE SOFTWARE (fc5)
Technical Support:  [url]http://www.cisco.com/techsupport[/url]
Copyright (c) 1986-2005 by cisco Systems, Inc.
Compiled Wed 27-Apr-04 19:01 by miwang
cisco 2621 (MPC860) processor (revision 0x200) with 60416K/5120K bytes of memory
.
Processor board ID JAD05190MTZ (4292891495)
M860 processor: part number 0, mask 49
Bridging software.
X.25 software, Version 3.0.0.
2 FastEthernet/IEEE 802.3 interface(s)
2 Low-speed serial(sync/async) network interface(s)
32K bytes of non-volatile configuration memory.
16384K bytes of processor board System flash (Read/Write)

         --- System Configuration Dialog ---
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]: router0
  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: 123456
  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: 8241825
  The virtual terminal password is used to protect
  access to the router over a network interface.
   Enter virtual terminal password: 456789
Current interface summary
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        unassigned      YES manual administratively down down
FastEthernet0/1        unassigned      YES manual administratively down down
Serial0/0              unassigned      YES manual administratively down down
Serial0/1              unassigned      YES manual administratively down down
Enter interface name used to connect to the
management network from the above interface summary: Serial0/0
Configuring interface Serial0/0:
   Configure IP on this interface? [yes]: y
    IP address for this interface: 192.168.2.1
    Subnet mask for this interface [255.255.255.0] : 255.255.255.0
The following configuration command script was created:
!
hostname router0
enable secret 5 $1$mERr$H7PDxl7VYMqaD3id4jJVK/
enable password 8241825
line vty 0 4
password 456789
!
interface FastEthernet0/0
shutdown
no ip address
!
interface FastEthernet0/1
shutdown
no ip address
!
interface Serial0/0
no shutdown
ip address 192.168.2.1 255.255.255.0
!
interface Serial0/1
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]: 2
Building configuration...
[OK]
Use the enabled mode 'configure' command to modify this configuration.
这些都是刚开机的的基本配置。红体字是加入的配置,看粉红的字便知这个路由器有哪些接口。
 下面接着配置:
router0>enable
Password: 
router0#config t
Enter configuration commands, one per line.  End with CNTL/Z.
router0(config)#interface s0/0
router0(config-if)# clock rate 64000
router0(config-if)#no shutdown
router0(config-if)#exit
router0(config)#interface f0/0
router0(config-if)#ip address 192.168.1.1 255.255.255.0
router0(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
这些都是基本配置,注意下就是这里得配置时钟进行同步。
 
下面在ROUTER1上进行类似的配置:
Self decompressing the image :
########################################################################## [OK]
              Restricted Rights Legend
Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.
           cisco Systems, Inc.
           170 West Tasman Drive
           San Jose, California 95134-1706
 
Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-I-M), Version 12.2(28), RELEASE SOFTWARE (fc5)
Technical Support:  [url]http://www.cisco.com/techsupport[/url]
Copyright (c) 1986-2005 by cisco Systems, Inc.
Compiled Wed 27-Apr-04 19:01 by miwang
cisco 2621 (MPC860) processor (revision 0x200) with 60416K/5120K bytes of memory
.
Processor board ID JAD05190MTZ (4292891495)
M860 processor: part number 0, mask 49
Bridging software.
X.25 software, Version 3.0.0.
2 FastEthernet/IEEE 802.3 interface(s)
2 Low-speed serial(sync/async) network interface(s)
32K bytes of non-volatile configuration memory.
16384K bytes of processor board System flash (Read/Write)

         --- System Configuration Dialog ---
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]: router1
  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: 123456
  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: 8241825
  The virtual terminal password is used to protect
  access to the router over a network interface.
   Enter virtual terminal password: 456789
Current interface summary
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        unassigned      YES manual administratively down down
FastEthernet0/1        unassigned      YES manual administratively down down
Serial0/0              unassigned      YES manual administratively down down
Serial0/1              unassigned      YES manual administratively down down
Enter interface name used to connect to the
management network from the above interface summary: Serial0/0
Configuring interface Serial0/0:
  Configure IP on this interface? [yes]: y
    IP address for this interface: 192.168.2.2
    Subnet mask for this interface [255.255.255.0] : 255.255.255.0
The following configuration command script was created:
!
hostname router1
enable secret 5 $1$mERr$H7PDxl7VYMqaD3id4jJVK/
enable password 8241825
line vty 0 4
password 456789
!
interface FastEthernet0/0
shutdown
no ip address
!
interface FastEthernet0/1
shutdown
no ip address
!
interface Serial0/0
no shutdown
ip address 192.168.2.2 255.255.255.0
!
interface Serial0/1
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]: 2
Building configuration...
%LINK-5-CHANGED: Interface Serial0/0, changed state to up[OK]
Use the enabled mode 'configure' command to modify this configuration.
 
下面来看基本的接口配置:

Press RETURN to get started!
 
router1>e
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to upn
Password: 
router1#config t
Enter configuration commands, one per line.  End with CNTL/Z.
router1(config)#interface s0/0
router1(config-if)#no shutdown
router1(config-if)#exit
router1(config)#interface f0/0
router1(config-if)#ip address 192.168.3.1 255.255.255.0
router1(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
 
进行到这一步。基本的配置完成。现在在ROUTER0上进行测试一下:
router0#ping 192.168.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 34/42/55 ms
可以看到这两台路由器配置没有问题,即可以互通了。
 
下面来配置PC0:
IP地址:192.168.1.2/24
网关:192.168.1.1
 
配置PC0:
IP地址:192.168.3.2/24
网关:192.168.3.1
 
下面来进行测试:
在PC0上:
Packet Tracer PC Command Line 1.0
PC> ping 192.168.2.1
Pinging 192.168.2.1 with 32 bytes of data:
Reply from 192.168.2.1: bytes=32 time=98ms TTL=255
Reply from 192.168.2.1: bytes=32 time=35ms TTL=255
Reply from 192.168.2.1: bytes=32 time=46ms TTL=255
Reply from 192.168.2.1: bytes=32 time=41ms TTL=255
Ping statistics for 192.168.2.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 35ms, Maximum = 98ms, Average = 55ms
PC> ping 192.168.2.2
Pinging 192.168.2.2 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.2.2:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
可看到PING不通对方路由器。
原因就是没有设置路由协议或添加静态路由。由于这里网络拓扑比较简单,就配置静态路由:
router0#config t
Enter configuration commands, one per line.  End with CNTL/Z.
router0(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2
这是在ROUTER0上的。
router1(config-if)#exit
router1(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1
这是在ROUTER1上配置。
 
下面来看看是不是可以互通了:
在PC0上:
PC> ping 192.168.2.2
Pinging 192.168.2.2 with 32 bytes of data:
Reply from 192.168.2.2: bytes=32 time=89ms TTL=254
Reply from 192.168.2.2: bytes=32 time=72ms TTL=254
Reply from 192.168.2.2: bytes=32 time=52ms TTL=254
Reply from 192.168.2.2: bytes=32 time=89ms TTL=254
Ping statistics for 192.168.2.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 52ms, Maximum = 89ms, Average = 75ms
PC> ping 192.168.3.2
Pinging 192.168.3.2 with 32 bytes of data:
Request timed out.
Reply from 192.168.3.2: bytes=32 time=114ms TTL=126
Reply from 192.168.3.2: bytes=32 time=125ms TTL=126
Reply from 192.168.3.2: bytes=32 time=118ms TTL=126
Ping statistics for 192.168.3.2:
    Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
    Minimum = 114ms, Maximum = 125ms, Average = 119ms
可看到可以通了。
在PC1上进行测试:
Packet Tracer PC Command Line 1.0
PC> ping 192.168.1.2
Pinging 192.168.1.2 with 32 bytes of data:
Reply from 192.168.1.2: bytes=32 time=117ms TTL=126
Reply from 192.168.1.2: bytes=32 time=113ms TTL=126
Reply from 192.168.1.2: bytes=32 time=118ms TTL=126
Reply from 192.168.1.2: bytes=32 time=125ms TTL=126
Ping statistics for 192.168.1.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 113ms, Maximum = 125ms, Average = 118ms
同样可以通。
完成。
 
此实验得注意的是:1、PC的网关必须设置为路由口FastEthernet的IP地址
2、路由器之间的接线必须是Serial DCE
3、特别值得注意和思考的是:PC和路由器的接线必须是交叉线!!!



     本文转自yangming1052 51CTO博客,原文链接:http://blog.51cto.com/ming228/100345,如需转载请自行联系原作者



相关文章
|
网络虚拟化 网络协议 ARouter
|
网络虚拟化