天天看點

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)

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

interface Serial0/0

no shutdown

ip address 192.168.2.1 255.255.255.0

interface Serial0/1

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

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

這些都是基本配置,注意下就是這裡得配置時鐘進行同步。

下面在ROUTER1上進行類似的配置:

  Enter host name [Router]: router1

  Configure IP on this interface? [yes]: y

    IP address for this interface: 192.168.2.2

hostname router1

ip address 192.168.2.2 255.255.255.0

%LINK-5-CHANGED: Interface Serial0/0, changed state to up[OK]

下面來看基本的接口配置:

Press RETURN to get started!

router1>e

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to upn

router1#config t

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

進行到這一步。基本的配置完成。現在在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.

Ping statistics for 192.168.2.2:

    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

可看到PING不通對方路由器。

原因就是沒有設定路由協定或添加靜态路由。由于這裡網絡拓撲比較簡單,就配置靜态路由:

router0(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2

這是在ROUTER0上的。

router1(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1

這是在ROUTER1上配置。

下面來看看是不是可以互通了:

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

    Minimum = 52ms, Maximum = 89ms, Average = 75ms

PC>ping 192.168.3.2

Pinging 192.168.3.2 with 32 bytes of data:

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),

    Minimum = 114ms, Maximum = 125ms, Average = 119ms

可看到可以通了。

在PC1上進行測試:

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:

    Minimum = 113ms, Maximum = 125ms, Average = 118ms

同樣可以通。

完成。

此實驗得注意的是:1、PC的網關必須設定為路由口FastEthernet的IP位址

2、路由器之間的接線必須是Serial DCE

3、特别值得注意和思考的是:PC和路由器的接線必須是交叉線!!!

     本文轉自yangming1052 51CTO部落格,原文連結:http://blog.51cto.com/ming228/100345,如需轉載請自行聯系原作者

繼續閱讀