开发者社区> 技术小胖子> 正文

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,如需转载请自行联系原作者



版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
6. Git 补充内容
提交 ID 显式引用和隐式引用用来指代每一次提交。尽管有时两种引用都不方便,但是幸运的是, Git 提供了许多不同的机制来为提交命名,这些机制有各自的优势,需要根据上下文来选择。
6 0
Python web服务器4: 网络通信
Python web服务器4: 网络通信
4 0
Google Java编程风格规范(2020年4月原版翻译)
Google Java Style Guide 这份文档是Google Java编程风格规范的完整定义。当且仅当一个Java源文件符合此文档中的规则, 我们才认为它符合Google的Java编程风格。 与其它的编程风格指南一样,这里所讨论的不仅仅是编码格式美不美观的问题, 同时也讨论一些约定及编码标准。然而,这份文档主要侧重于我们所普遍遵循的规则,
8 0
Android 打包AAB+PAD(java篇)(上)
AAB Play Asset Delivery 分发模式 资源更新 纹理压缩格式定位 应用版本更新 下载大小上限 针对Java 代码构建
8 0
Swift5.1—两段式构造过程
Swift5.1—两段式构造过程
5 0
人人都能做游戏系列教程3(视频+图文版)
这是“人人都能做游戏”系列视频教程的第3节。这一节我将会带大家了熟悉一下将会使用的游戏制作工具,然后制作出第一个“你好,小游戏。”的事例,向小游戏开发世界问好。
8 0
iOS逆向 01:初识汇编
iOS逆向 01:初识汇编
5 0
21117
文章
0
问答
文章排行榜
最热
最新
相关电子书
更多
OceanBase 入门到实战教程
立即下载
阿里云图数据库GDB,加速开启“图智”未来.ppt
立即下载
实时数仓Hologres技术实战一本通2.0版(下)
立即下载