CISCO路由器基础配置

CISCO路由器基础配置
CISCO路由器基础配置

第一章基础篇

实验一路由器基本设置

Lab Exercise 1.1

目标:

熟练掌握如何进入路由器各种模式并设置主机名.

语法:

1.从路由器用户模式进入特权模式:

MetarR1>enable

2.从特权模式进入全局配置模式:

MetarR1#configure terminal

3.为路由器设置主机名:

MetarR1(config)#hostname {hostname}

4.退出到特权模式:

MetarR1(config)#end

5.退出到用户模式:

MetarR1#disable

6.退出控制台线路:

MetarR1>quit

解释:

路由器的模式大致可分为:

1.用户模式:权限最低,通常只能使用少量查看性质的命令.

2.特权模式:可以使用更多查看性质的命令和一些少量修改路由器参数的命令.

3.全局配置模式:不能使用查看性质的命令,但是确实做全局性修改和设置的模式,它还可以向下分为一些子模式,比如接口配置模式,线路配置模式,路由进程配置模式等等.

配置实例一:

Router>enable

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname MetarR1

MetarR1(config)#exit

MetarR1#

*Mar 1 00:04:30.815: %SYS-5-CONFIG_I: Configured from console by console MetarR1#disable

MetarR1>

Lab Exercise 1.2

目标:

熟练掌握如何为路由器设置时间.

语法:

在特权模式下设置路由器时间:

MetarR1#clock set {hh:mm:ss day month year}

解释:

路由器本地的时间标识.

配置实例一:

MetarR1#clock set 16:16:16 25 September 2005

MetarR1#show clock

16:16:24.503 UTC Sun Sep 25 2005

MetarR1#

Lab Exercise 1.3

目标:

熟练掌握如何设置空闲超时时间.

语法:

1.从全局配置模式进入线路配置模式,进入控制台口线路:

MetarR1(config)#line console {number}

2.启用光标跟随:

MetarR1(config-line)#logging synchronous

3.设置当键盘多少时间内无动作,自动被路由器弹出到用户模式以外,即退出.如果设置为0 分0 秒代表永不

超时:

MetarR1(config-line)#exec-timeout {minute} {second}

解释:

所谓光标跟随,是指当我们在输入命令的时候,不会被一些日志信息或debug 命令产生的调试命令所冲断.

模式该特性是没有启用的.

配置实例一:

MetarR1(config)#exit

MetarR1#

*Mar 1 00:20:11.231: %SYS-5-CONFIG_I: Configured from console by console configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR1(config)#line console 0

MetarR1(config-line)#logging synchronous

MetarR1(config-line)#end

MetarR1#

*Mar 1 00:20:38.123: %SYS-5-CONFIG_I: Configured from console by console

MetarR1#configure terminal

MetarR1(config)#

配置实例二:

MetarR1#show clock

*15:32:12.747 UTC Mon Jul 28 2005

MetarR1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR1(config)#line console 0

MetarR1(config-line)#exec-timeout 20 0

MetarR1(config)#end

MetarR1#exit

*Mar 1 00:24:33.643: %SYS-5-CONFIG_I: Configured from console by console MetarR1#

MetarR1#show clock

*15:52:12.747 UTC Mon Jul 28 2005

MetarR1#

MetarR1 con0 is now available

Press RETURN to get started.

MetarR1>

Lab Exercise 1.4

目标:

熟练掌握如何为路由器设置标语信息和描述信息.

语法:

1.进入全局配置模式,设置标语信息:

MetarR1(config)#banner motd # {text} #

2.进入接口配置模式:

MetarR1(config-if)#interface {type} {number}

3.为路由器接口设置描述信息:

MetarR1(config-if)#description {text}

解释:

在设置标语信息的时候,以#号做为分隔符,并按下回车键.描述语句的本地的一个标识,它只在本地可见,并且Cisco IOS 执行命令的时候会跳过它.

配置实例一:

MetarR1(config)#banner motd #

Enter TEXT message. End with the character '#'.

hello!

#

MetarR1(config)#end

MetarR1#exit

MetarR1 con0 is now available

Press RETURN to get started.

hello!

MetarR1>

配置实例二:

MetarR1(config-if)#description to PC

MetarR1(config-if)#end

MetarR1#

*Mar 1 02:05:48.919: %SYS-5-CONFIG_I: Configured from console by console MetarR1#show running-config interface FastEthernet1/0

Building configuration...

Current configuration : 102 bytes

!

interface FastEthernet0/0

description to PC

no ip address

shutdown

duplex auto

speed auto

end

MetarR1#

Lab Exercise 1.5

目标:

熟练掌握如何为路由器特权模式设置密码.

语法:

进入全局配置模式,设置密码:

MetarR1(config)#enable {password|secret} {password}

解释:

两种密码的区别在于,前者是一些低版本Cisco IOS 软件的认证方式,并且密码是基于明文的;后者是目前Cisco IOS 软件最常用的认证方式,它是基于MD5 加密的.如果同时设置了这两种认证方式,他们的口令必须不一样.但是,我们推荐使用后者进行认证,并且如果同时设置了两种认证方式,只有后者生效.密码区分大

小写.

配置实例一:

MetarR1(config)#enable password metarnet

MetarR1(config)#enable secret metarnet

The enable secret you have chosen is the same as your enable password.

This is not recommended. Re-enter the enable secret.

MetarR1(config)#enable secret admin

MetarR1(config)#exit

MetarR1#

*Mar 1 02:16:48.067: %SYS-5-CONFIG_I: Configured from console by console MetarR1#exit

MetarR1 con0 is now available

Press RETURN to get started.

MetarR1>enable

Password:admin

MetarR1#show running-config

Building configuration...

Current configuration : 609 bytes

!

version 12.2

service timestamps debug datetime msec

service timestamps log datetime msec

no service password-encryption

!

hostname MetarR1

!

logging queue-limit 100

enable secret 5 $1$aW/a$MuoX8LloVrd84kF7QzT6m1

enable password metarnet

!

--More--

Lab Exercise 1.6

目标:

熟练掌握如何为路由器各个配置模式设置密码.

语法:

1.从全局配置模式进入线路配置模式,进入控制台口线路:

MetarR1(config)#line {console|aux|vty} {start-number} [end-number]

2.设置密码:

MetarR1(config-line)#password {password}

3.启用登陆:

MetarR1(config-line)#login

解释:

当设置密码之后,如果不启用登陆命令,退出之后,路由器是不会提示输入密码的.

控制台线路密码为控制台线路所用;辅助接口(AUX)线路密码为辅助接口线路所用;虚拟终端线路(VTY)是为telnet 会话所用,路由器根据Cisco IOS 软件版本不同,支持多条VTY 会话数目也不同.

所有密码是以明文方式保存在DRAM(running-config)文件里的.

配置实例一:

MetarR1(config)#line console 0

MetarR1(config-line)#password admin

MetarR1(config-line)#login

MetarR1(config-line)#line aux 0

MetarR1(config-line)#password admin

MetarR1(config-line)#login

MetarR1(config-line)#exit

MetarR1(config)#line vty 0 4

MetarR1(config-line)#password admin

MetarR1(config-line)#login

MetarR1(config-line)#end

*Mar 1 03:04:43.491: %SYS-5-CONFIG_I: Configured from console by console MetarR1#exit

MetarR1 con0 is now available

Press RETURN to get started.

User Access Verification

Password:admin

MetarR1>

Lab Exercise 1.7

目标:

熟练掌握如何为路由器关闭DNS 查询功能.

语法:

全局配置模式下,关闭DNS 查询功能:

MetarR1(config)#no ip domain lookup

解释:

默认情况下,路由器的DNS 查询是启用的,即当你错误的输入一条Cisco IOS 软件无法识别的命令的时候,

路由器会把这个命令当成主机名,然后向DNS服务器进行查询.一般实验性的环境中,如果我们没有DNS服

务器,因为输入错误的命令而造成无用的查询,是非常耗时的.因此我们可以关闭这一功能. 配置实例一:

MetarR1#MetarR1

Translating "MetarR1"...domain server (255.255.255.255)

Translating "MetarR1"...domain server (255.255.255.255)

Translating "MetarR1"...domain server (255.255.255.255)

% Unknown command or computer name, or unable to find computer address

MetarR1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR1(config)#no ip domain lookup

MetarR1(config)#end

MetarR1#

*Mar 1 03:13:12.371: %SYS-5-CONFIG_I: Configured from console by console MetarR1#MetarR1

Translating "MetarR1"

% Unknown command or computer name, or unable to find computer address

MetarR1#

实验二- 路由器连通性设置

Lab Exercise 2.1

目标:

熟练掌握如何连通路由器并进行相互间ping 和telnet 的测试.

语法:

1.进入接口配置模式:

MetarR1(config)#interface {type} {number}

2.为接口设置IP 地址信息:

MetarR1(config-if)#ip address {ip-address} {mask}

3.开启接口:

MetarR1(config-if)#no shutdown

解释:

默认所有接口都是处于关闭状态的,对于一般的以太网接口,设置了IP 地址信息之后,只需要开启该接口即可.另外要注意的是,端到端(end-to-end)的连接,直连的接口必须处于同一子网.

配置实例一:

路由器 MetarR1 配置如下:

MetarR1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR1(config)#interface serial 0

MetarR1(config-if)#ip address 10.0.0.1 255.255.255.252

MetarR1(config-if)#no shutdown

*Mar 1 00:13:45.839: %LINK-3-UPDOWN: Interface Serial0, changed state to down MetarR1(config-if)#end

MetarR1#

*Mar 1 00:14:24.511: %LINK-3-UPDOWN: Interface Serial0, changed state to up MetarR1#

*Mar 1 00:14:25.515: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to up

MetarR1#

路由器 MetarR2 配置如下:

MetarR2#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR2(config)#interface serial 0

MetarR2(config-if)#ip address 10.0.0.2 255.255.255.252

MetarR2(config-if)#no shutdown

MetarR2(config-if)#end

MetarR2#

Sep 25 16:24:25.347: %SYS-5-CONFIG_I: Configured from console by console MetarR2#

Sep 25 16:24:25.787: %LINK-3-UPDOWN: Interface Serial0, changed state to up

MetarR2#

Sep 25 16:24:26.791: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to up

MetarR2#

测试一:

MetarR1#ping 10.0.0.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/40 ms MetarR1#

MetarR2#ping 10.0.0.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/40 ms MetarR2#

测试二:

MetarR1#telnet 10.0.0.2

Trying 10.0.0.2 ... Open

Password required, but none set

[Connection to 10.0.0.2 closed by foreign host]

MetarR1#

解释:

在telnet 到远端路由器的时候,如果对方的VTY 线路没有设置密码和启用登陆,将拒绝本地路由器telnet.

解决方案:

是在远端路由器设置VTY 线路的密码和启用登陆.路由器MetarR2 配置如下:

MetarR2#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR2(config)#line vty 0 4

MetarR2(config-line)#password admin

MetarR2(config-line)#login

MetarR2(config-line)#end

MetarR2#

MetarR1#telnet 10.0.0.2

Trying 10.0.0.2 ... Open

User Access Verification

Password:admin

MetarR2>exit

[Connection to 10.0.0.2 closed by foreign host]

MetarR1#

测试三:

MetarR2#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR2(config)#username admin password 0 admin

MetarR2(config)#line vty 0 4

MetarR2(config-line)#login local

MetarR2(config-line)#end

MetarR2#

MetarR1#telnet 10.0.0.2

Trying 10.0.0.2 ... Open

User Access Verification

Username: admin

Password:admin

MetarR2>exit

[Connection to 10.0.0.2 closed by foreign host]

MetarR1#

第二章交换篇

实验一- VLAN 基本配置

Lab Exercise 2.1

目标:

熟练掌握如何创建VLAN.

语法:

1.全局配置模式下,输入VLAN ID,进入VLAN 配置模式:

MetarR1(config)#vlan {vlan-id}

2.为VLAN 设置名字.可选:

MetarR1(config-vlan)#name {vlan-name}

3.创建了以太网VLAN 之后,接下来把交换机端口分配到特定的VLAN 里.假如你把端口分配进了不存在的

VLAN 里,那么新的VLAN 将自动被创建.进入接口配置模式:

MetarR1(config)#interface {interface}

4.定义VLAN 端口的成员关系,把它定义为层2 接入端口:

MetarR1(config-if)#switchport mode access

5.把端口分配进特定的VLAN 里:

MetarR1(config-if)#switchport access vlan {vlan-id}

6.配置中继端口,定义中继模式:

MetarR1(config-if)#switchport trunk encapsulation {isl|dot1q|negotiate}

7.定义端口为层2 的中继端口:

MetarR1(config-if)#switchport mode {dynamic auto|dynamic desirable|trunk}

解释:

一般当VLAN 跨交换机划分,通常要配置中继链路.

配置实例一:

交换机 MetarR2 配置如下:

MetarR1#vlan database

MetarR1 (vlan)#vlan 10

VLAN 10 added:

Name: VLAN0010

MetarR1(vlan)#vlan 20

VLAN 20 added:

Name: VLAN0020

MetarR1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR1(config-vlan)#interface fastEthernet 1/0

MetarR1(config-if)#switchport mode access

MetarR1(config-if)#switchport access vlan 10

MetarR1(config-if)#no shutdown

MetarR1(config-if)#exit

MetarR1(config-if)#interface fastEthernet 1/1

MetarR1(config-if)#switchport mode access

MetarR1(config-if)#switchport access vlan 20

MetarR1(config-if)#no shutdown

MetarR1(config-if)#exit

MetarR1(config-if)#interface vlan 10

MetarR1(config-if)#ip address 192.168.1.1 255.255.255.0

MetarR1(config-if)#exit

MetarR1(config-if)#interface vlan 20

MetarR1(config-if)#ip address 192.168.2.1 255.255.255.0

end

MetarR1#

测试:

MetarR1#show vlan-switch

VLAN Name Status Ports

---- -------------------------------- --------- ------------------------------- 1 default active Fa1/2, Fa1/3, Fa1/4, Fa1/5

Fa1/6, Fa1/7, Fa1/8, Fa1/9

Fa1/10, Fa1/11, Fa1/12, Fa1/13 Fa1/14, Fa1/15

10 VLAN0010 active Fa1/0

20 VLAN0020 active Fa1/1

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 1002 1003

10 enet 100010 1500 - - - - - 0 0

20 enet 100020 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 1 1003 1003 tr 101003 1500 1005 0 - - srb 1 1002 1004 fdnet 101004 1500 - - 1 ibm - 0 0 1005 trnet 101005 1500 - - 1 ibm - 0 0 MetarR1#

第三章路由篇

实验一- 静态路由基本配置

Lab Exercise 1.1

目标:

熟练掌握如何配置静态路由.

准备工作:

确保路由器之间接口IP 地址信息已经设置好,能够端到端的ping 通.

语法:

进入全局配置模式,定义目标网络号,目标网络的子网掩码和下一跳地址或接口:

MetarR1(config)#ip route {network} {mask} {next-hop-address|exit-interface} [distance]

解释:

选用下一跳地址和选择下一跳路由器的接口做为到达目标网络的出口的区别在于管理距离.选择前者,管理距离为1;选择后者,管理距离为0 还可以在定义静态路由的时候指定管理距离.

配置实例一:

路由器 MetarR2 配置如下:

MetarR2#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR2(config)#ip route 221.101.1.0 255.255.255.0 10.0.0.2

MetarR2(config)#end

MetarR2#

路由器 MetarR1 配置如下:

MetarR1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR1(config)#ip route 202.10.20.0 255.255.255.0 serial 0

MetarR1(config)#end

测试:

MetarR2#show ip route static

S 221.101.1.0/24 [1/0] via 10.0.0.2

MetarR2#ping 221.101.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 221.101.1.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 32/35/36 ms

MetarR2#

MetarR1#show ip route static

S 202.10.20.0/24 is directly connected, Serial0

MetarR1#ping 202.10.20.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 202.10.20.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/36 ms

MetarR1#

Lab Exercise 1.2

目标:

熟练掌握如何配置默认路由.

准备工作:

确保路由器之间接口IP 地址信息已经设置好,能够端到端的ping 通.

语法:

进入全局配置模式,定义目标网络号,目标网络的子网掩码分别为0.0.0.0,并定义下一跳地址或接口:

MetarR1(config)#ip route 0.0.0.0 0.0.0.0 {next-hop-address|exit-interface} [distance]

解释:

0.0.0.0 0.0.0.0 代表所有网络.选用下一跳地址和选择下一跳路由器的接口做为到达目标网络的出口的区别在于管理距离.选择前者,管理距离为1;选择后者,管理距离为0 还可以在定义静态路由的时候指定管理距离.

配置实例一:

路由器 MetarR1 配置如下:

MetarR1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR1(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.1

MetarR1(config)#end

MetarR1#

MetarR1#show ip route static

S* 0.0.0.0/0 [1/0] via 10.0.0.1

MetarR1#

实验二- 距离矢量路由协议基本配置

Lab Exercise 2.1

目标:

熟练掌握如何配置RIP.

准备工作:

确保路由器之间接口IP 地址信息已经设置好,能够端到端的ping 通.

语法:

1.进入全局配置模式,启用RIP:

MetarR1(config)#router rip

2.定义要宣告的直连主类网络号:

MetarR1(config-router)#network {network-number}

解释:

启用了RIP 路由协议之后,只需要宣告主类直连网络号,即可完成RIP 的配置. 配置实例一:

路由器 MetarR2 配置如下:

MetarR2#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR2(config)#router rip

MetarR2(config-router)#network 202.10.20.0

MetarR2(config-router)#network 10.0.0.0

MetarR2(config-router)#end

MetarR2#

路由器 MetarR1 配置如下:

MetarR1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR1(config)#router rip

MetarR1(config-router)#network 221.101.1.0

MetarR1(config-router)#network 10.0.0.0

MetarR1(config-router)#end

MetarR1#

测试:

MetarR2#show ip route rip

R 221.101.1.0/24 [120/1] via 10.0.0.2, 00:00:21, Serial0

MetarR2#ping 221.101.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 221.101.1.1, timeout is 2 seconds:

Success rate is 100 percent (5/5), round-trip min/avg/max = 32/35/36 ms MetarR2#

MetarR1#show ip route rip

R 202.10.20.0/24 [120/1] via 10.0.0.1, 00:00:02, Serial0

MetarR1#ping 202.10.20.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 202.10.20.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 32/35/36 ms MetarR1#

Lab Exercise 2.2

目标:

熟练掌握如何配置RIPv2.

准备工作:

确保路由器之间接口IP 地址信息已经设置好,能够端到端的ping 通.

语法:

1.进入全局配置模式,启用RIP:

MetarR1(config)#router rip

2.启用RIP 版本2(RIPv2):

MetarR1(config-router)#version 2

3.定义要宣告的直连主类网络号:

MetarR1(config-router)#network {network-number}

解释:

启用了RIPv2 路由协议之后,只需要宣告主类直连网络号,即可完成RIPv2 的配置. 配置实例一:

路由器 MetarR2 配置如下:

MetarR2#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR2(config)#router rip

MetarR2(config-router)#version 2

MetarR2(config-router)#network 202.10.20.0

MetarR2(config-router)#network 10.0.0.0

MetarR2(config-router)#end

MetarR2#

路由器 MetarR1 配置如下:

MetarR1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR1(config)#router rip

MetarR1(config-router)#version 2

MetarR1(config-router)#network 221.101.1.0

MetarR1(config-router)#network 10.0.0.0

MetarR1(config-router)#end

MetarR1#

测试:

MetarR2#show ip route rip

R 221.101.1.0/24 [120/1] via 10.0.0.2, 00:00:21, Serial0

MetarR2#ping 221.101.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 221.101.1.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 32/35/36 ms MetarR2#

MetarR1#show ip route rip

R 202.10.20.0/24 [120/1] via 10.0.0.1, 00:00:02, Serial0

MetarR1#ping 202.10.20.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 202.10.20.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 32/35/36 ms MetarR1#

实验三- 链路状态路由协议基本配置

Lab Exercise 3.1

目标:

熟练掌握如何配置单区域的OSPF.

设备需求:

Cisco 2501 路由器两台.

准备工作:

确保路由器之间接口IP 地址信息已经设置好,能够端到端的ping 通.

语法:

1.启用OSPF 进程:

MetarR1(config)#router ospf {process-id}

2.定义参与OSPF 进程的接口和网络:

MetarR1(config-router)#network {ip-address} {wildcard-mask} area {area-id}

解释:

OSPF 进程ID 可以使用1 到65535 中任何一个整数,该ID 只是本地的一个标识,即一个OSPF 网络,每台OSPF 路由器的进程ID 是否一样,和OSPF 网络能否正常运行无关.在定义OSPF 路由器要宣告的区域的时候,反掩码用来控制要宣告的范围,0 表示精确匹配,255 表示任意匹配.OSPF 网络中骨干区域为区域0,因此必须要有区域0.

配置实例一:

路由器 MetarR2 配置如下:

MetarR2#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR2(config)#router ospf 100

MetarR2(config-router)#network 192.168.2.2 0.0.0.0 area 0

MetarR2(config-router)#network 192.168.4.0 0.0.0.255 area 0

MetarR2(config-router)#end

MetarR2#

路由器 MetarR1 配置如下:

MetarR1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR1(config)#router ospf 50

MetarR1(config-router)#network 192.168.1.0 0.0.0.255 area 0

MetarR1(config-router)#network 192.168.2.1 0.0.0.0 area 0

MetarR1(config-router)#end

MetarR1#

测试:

MetarR2#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface 192.168.3.1 1 FULL/DR 00:00:35 192.168.2.1 Vlan10 MetarR2#show ip route ospf

O 192.168.1.0/24 [110/2] via 192.168.2.1, 00:31:31, Vlan10

MetarR2#ping 192.168.1.101

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.1.101, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 20/98/172 ms MetarR2#

Lab Exercise 3.2

目标:

熟练掌握如何配置多区域的OSPF.

准备工作:

确保路由器之间接口IP 地址信息已经设置好,能够端到端的ping 通.

语法:

1.启用OSPF 进程:

MetarR1(config)#router ospf {process-id}

2.定义参与OSPF 进程的接口和网络:

MetarR1(config-router)#network {ip-address} {wildcard-mask} area {area-id}

解释:

OSPF 进程ID 可以使用1 到65535 中任何一个整数,该ID 只是本地的一个标识,即一个OSPF 网络,每台OSPF 路由器的进程ID 是否一样,和OSPF 网络能否正常运行无关.在定义OSPF 路由器要宣告的区域的时候,反掩码用来控制要宣告的范围,0 表示精确匹配,255 表示任意匹配.OSPF 网络中骨干区域为区域0,因此必须要有区域0.多区域的设计,才是OSPF

网络的精髓.

配置实例一:

路由器 MetarR2 配置如下:

MetarR2#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR2(config)#router ospf 1

MetarR2(config-router)#network 10.0.0.1 0.0.0.0 area 0

MetarR2(config-router)#network 202.10.20.0 0.0.0.255 area 1

MetarR2(config-router)#end

MetarR2#

路由器 MetarR1 配置如下:

MetarR1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

MetarR1(config)#router ospf 65535

MetarR1(config-router)#network 10.0.0.0 0.0.0.3 area 0

MetarR1(config-router)#network 221.101.1.1 0.0.0.0 area 2

MetarR1(config-router)#end

MetarR1#

测试:

MetarR2#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

221.101.1.1 1 FULL/ - 00:00:37 10.0.0.2 Serial0

MetarR2#show ip route ospf

O IA 221.101.1.0/24 [110/74] via 10.0.0.2, 00:00:22, Serial0

MetarR2#ping 221.101.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 221.101.1.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/36 ms MetarR2#

MetarR1#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

202.10.20.1 1 FULL/ - 00:00:31 10.0.0.1 Serial0

MetarR1#show ip route ospf

O IA 202.10.20.0/24 [110/74] via 10.0.0.1, 00:01:03, Serial0

MetarR1#ping 202.10.20.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 202.10.20.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/36 ms MetarR1#

Cisco路由器SNMP及Syslog设置使用以下配置命令前,均需要执行以下步骤:

1.登陆路由器。(可以使用串口线直接连接,如果交换机配置有管理IP并且允许telnet 登陆,则也可以通过telnet进行登陆。)

2.输入enable命令进入特权模式。

3.输入config terminal进行配置模式。

使用完配置命令后,均需要执行以下步骤进行保存:

1.输入end命令退出配置模式。

2.copy running start保存配置文件。

SNMP配置

1.配置snmp 只读community

snmp-server community public ro

配置路由器的只读community为public

2.配置snmp 读写community

snmp-server community public rw

配置路由器的读写community为public

TRAP配置

1.配置路由器允许发送trap

snmp-server enable traps

2.配置路由器接收trap的主机

snmp-server host10.238.18.17traps public

指定路由器SNMP Trap的接收者为10.238.18.17,发送Trap时采用public作为字串Syslog配置

1.打开路由器的syslog功能

logging on

2. 直接配置相应的syslog发送到的接收主机,10.90.200.93为该主机的ip地址。

logging 10.90.200.93

3.配置发送syslog的主机格式类型。

logging facility local4

4.选择发送warning以上级别的log信息。

logging trap warnings

cisco路由器配置及维护手册

cisco路由器配置及维护手册 作者:pixfire 一、路由器简单配置 1. 用串行电缆将PC机串口与路由器CONSOLE口连接,用WIN95的超级终端或NETTERM 软件进行配置。PC机串口设置为波特率9600 数据位8 停止位1。 2. 新出厂的路由器启动后会进入自动配置状态。可按提示对相应端口进行配置。 3 . 命令行状态。若不采用自动配置,可在自动配置完成后,题问是否采用以上配置时,回答N。此时进入命令行状态。 4 进入CONFIG模式。在router>键入enable , 进入router # ,再键入config t ,进入 router(config)# 。 5 配置广域端口。在正确连接好与E1端口的电缆线后,在router # 下键入sh controller cbus 。检验端口物理特性,及连线是否正确。之后,进入config模式。 进行以下配置。 int serial <端口号> E1端口号。 ip address <掩码> 广域网地址 bandwidth 2000 传输带宽 clock source line 时钟设定。 6 检验配置。设置完成后,按ctrl Z退出配置状态。键入write mem 保存配置。 用sh conf 检查配置信息。用sh int 检查端口状态。 二、路由器常用命令 2.1 Exec commands: <1-99> 恢复一个会话 bfe 手工应急模式设置 clear 复位功能

clock 管理系统时钟 configure 进入设置模式 connect 打开一个终端 copy 从tftp服务器拷贝设置文件或把设置文件拷贝到tftp服务器上 debug 调试功能 disable 退出优先命令状态 disconnect 断开一个网络连接 enable 进入优先命令状态 erase 擦除快闪内存 exit 退出exce模式 help 交互帮助系统的描述 lat 打开一个本地传输连接 lock 锁定终端 login 以一个用户名登录 logout

Cisco设备的基本配置命令

switch> 用户模式 1:进入特权模式 enable switch> enable switch# 2:进入全局配置模式 configure terminal switch> enable switch#c onfigure terminal switch(conf)# 3:交换机命名 hostname aptech2950 以aptech2950为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch-2950 aptech2950(conf)# 4:配置使能口令 enable password cisco 以cisco为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable password cisco 5:配置使能密码 enable secret ciscolab 以cicsolab为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable secret ciscolab 6:设置虚拟局域网vlan 1 interface vlan 1 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface vlan 1 aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 配置交换机端口ip 和子网掩码 aptech2950(conf-if)#no shut 是配置处于运行中aptech2950(conf-if)#exit aptech2950(conf)#ip default-gateway 192.168.254 设置网关地址 7:进入交换机某一端口 interface fastehernet 0/17 以17端口为例switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface fastehernet 0/17 aptech2950(conf-if)#

Cisco路由器的基本配置命令

Cisco路由器的基本配置命令 Cisco 路由器的基本配置命令 一(实训目的 1(掌握路由器的连接方式和使用基本规则。 2(掌握路由器的基本配置命令。 二(实训器材及环境 1(安装 Windows 2000 Server 系统的计算机一台。 2(安装模拟软件 Boson Netsim 5.31。 3(模拟环境如下: 图 11-1 实验拓扑环境 三(实训理论基础 1(路由器的基本配置语句 (1)配置路由器名字和特权密码: Router1> enable Router1# conf t Router1(config)# hostname R1 R1(config)# enable secret 123456
b5E2RGbCAP
(2)配置路由器的 Ethernet 端口:
R1(config)# interface e0 R1(config-if)# ip address 192.168.1.1 255.255.255.0 p1EanqFDPw R1(config-if)# no shutdown (3)配置路由器的 Serial 端口(DTE 端):DXDiTa9E3d R1(config)# interface s0 R1(config-if)# ip address 10.0.0.1 255.0.0.0 R1(config-if)# no shutdown (4)配置路由器的 Serial 端口(DCE 端):
RTCrpUDGiT
R2(config)# interface s0 R2(config-if)# ip address 10.0.0.2 255.0.0.0 R2(config-if)# clock rate 64000 R2(config-if)# no shutdown 2(路由器可以有多种类型的端口,用于连接 不同的网络,常用的有以太网端口(Ethernet)、快速以太网端口 (FastEthernet)、高速同步串口(Serial)等。有的端口是固定端口,有的端
5PCzVD7HxA
- 1 -

思科交换机实用配置步骤详解

1.交换机支持的命令: 交换机基本状态: switch: ;ROM状态,路由器是rommon> hostname> ;用户模式 hostname# ;特权模式 hostname(config)# ;全局配置模式 hostname(config-if)# ;接口状态交换机口令设置: switch>enable ;进入特权模式 switch#config terminal ;进入全局配置模式 switch(config)#hostname ;设置交换机的主机名 switch(config)#enable secret xxx ;设置特权加密口令 switch(config)#enable password xxa ;设置特权非密口令switch(config)#line console 0 ;进入控制台口 switch(config-line)#line vty 0 4 ;进入虚拟终端 switch(config-line)#login ;允许登录 switch(config-line)#password xx ;设置登录口令xx switch#exit ;返回命令

交换机VLAN设置: switch#vlan database ;进入VLAN设置 switch(vlan)#vlan 2 ;建VLAN 2 switch(vlan)#no vlan 2 ;删vlan 2 switch(config)#int f0/1 ;进入端口1 switch(config-if)#switchportaccess vlan 2 ;当前端口加入vlan 2 switch(config-if)#switchport mode trunk ;设置为干线 switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain ;设置发vtp域名 switch(config)#vtp password ;设置发vtp密码 switch(config)#vtp mode server ;设置发vtp模式 switch(config)#vtp mode client ;设置发vtp模式 交换机设置IP地址: switch(config)#interface vlan 1 ;进入vlan 1 switch(config-if)#ipaddress ;设置IP地址 switch(config)#ip default-gateway ;设置默认网关

最新思科CISCO路由器配置步骤

前思科路由器已经成为路由行业的领军人物,可能好多人还不了解Cisco路由器配置的步骤,没有关系,看完本文你肯定有不少收获,希望本文能教会你更多东西,该单位公司总部在北京,全国有3个分支机构。 要求做到在4个地点的数据能够实时查询,便于业务员根据具体情况作出正确决策。早期方案是使用路由器,通过速率为256Kbps的DDN专网连接北京总部。但技术人员通过市场调研,发现该网络运营成本过高。通过进一步的咨询和调整,最终方案是分支机构使用DDN在本地接入Internet,总部使用以太网就近接入Internet。并对互联的Cisco路由器配置,使用VPN技术,保证内部数据通过Internet安全传输。该企业的网络分布见附图。 配置过程及测试步骤 在实施配置前,需要检查硬件和软件是否支持VPN。对于Cisco路由器配置,要求IOS 版本高于12.0.6(5)T,且带IPSec功能。本配置在Cisco路由器配置通过。以下是分支网络1的路由器实际配置过程,其他路由器的配置方法与此基本一致,只需修改具体的环境参数(IP 地址和接口名称)即可。 配置路由器的基本参数,并测试网络的连通性 (1) 进入Cisco路由器配置模式 将计算机串口与路由器console口连接,并按照路由器说明书配置“终端仿真”程序。执行下述命令进入配置模式。 Router>en Router#config terminal Router(config)# (2)配置路由器的基本安全参数 主要是设置特权口令、远程访问口令和路由器名称,方便远程调试。 Router(config)#enable secret xxxxxxx Router(config)#line vty 0 4 Router(config-line)#password xxxxxx Router(config-line)#exit Router(config)#hostname huadong

CISCO路由器配置基础

路由器是计算机网络的桥梁,是连接IP网的核心设备。通过它不仅可以连通不同的网络,还能选择数据传送的路经,并能阻隔非法访问。路由器的配置对初学者来说,并不是件容易的事。现以CISCO路由器为例,将路由器的一般常识和配置介绍给大家,供朋友们在配置路由器时参考。 一、路由器的一般常识 路由器具有创建路由、执行命令以及在网络接口上使用路由协议对数据包进行路由等功能。它的是接口、CPU和存在器,软件基础是网络互联操作系 统IOS。 1、路由器接口 ·路由器接口用作将路由器连接到网络,可以分为局域网接口和广域网接口两种。由于路由器型号的不同,接口数目和类型也不尽一样。常见的接口主要有以下几种: ·高速同步串口,可连接DDN,帧中继(Frame Relay),X.25,PSTN(模拟线路)。 ·同步/异步串口,可用软件将端口设置为同步工作方式。 ·AUI端口,即粗缆口。一般需要外接转换器(AUI-RJ45),连接10Base-T以太网络。 ·ISDN端口,可以连接ISDN网络(2B+D),可作为局域网接入Inter 之用。·AUX端口,该端口为异步端口,主要用于远程配置,也可用于拔号备份,可 与MODEM连接。支持硬件流控制(Hardware Flow Ctrol)。 ·Console端口,该端口为异步端口,主要连接终端或运行终端仿真程序的计算机,在本地配置路由器。不支持硬件流控制。 2、路由器的CPU 路由器和PC机一样,有中央处理单元CPU,而且不同的路由器,其CPU一般也不相同,CPU是路由器的处理中心。 3、路由器的内存组件 内存是路由器存储信息和数据的地方,CISCO路由器有以下几种内存组件:·ROM(Read Only Memory) ·ROM中存储路由器加电自检(POST:Power-On Self-Test)、启动程序(Bootstrap Program)和部分或全部的IOS。路由器中的ROM是可擦写的,所以IOS是可以升级的。 ·NVRAM(Nonvolatile Random Memory)

(完整版)思科路由器查看配置命令.doc

思科路由器查看配置命令 show run// 看运行状况 show ip route// 看路由表 show int// 看断口 * show ip int br// 看端口 ip 地址 show cdp nei// 察看 cdp 邻居 show ip pro// 察看 ip 协议 查看配置信息用 show 命令,该命令可以在用户模式和特权模式下执行,且在特权模式下看 到的信息比用户模式多。 show 命令很多,常用的有: 1、查看运行配置文件: Router#show running-config 运行配置文件 running-config 位于路由器的 RAM 中,存放的是路由器当前使用的配置信息。 2、查看启动配置文件: Router#show startup-config 启动配置文件 startup-config 位于路由器的 NVRAM 中,可以长期保存。它在启动路由器时装入 RAM ,成为 running-config 。 3、查看路由器的版本信息: Router#show version' 4、查看路由器的接口状态: Router#show ip interface brief 如果接口状态标识为“ Down ”,表示此接口未激活,如果标识为“ Up”,表示此接口已经激活。 5、查看路由表:

Router#show ip route 通过路由表可以看出该路由器已经识别的网络。 6、查看 NAT 翻译情况: Router#show ip nat translation 应该先进行内网与外网的通讯(如:用 ping 命令 ),然后再查看,才能看到翻译情况。

1-cisco路由器基本配置及远程登录

实训目的: (1)学习和掌握科路由器的配置方式和要求。 (2)学习和掌握科路由器的工作模式分类、提示符、进入方式。1、路由器的配置方式 ①超级终端方式。该方式主要用于路由器的初始配置,路由器不需要IP地址。基本方法是:计算机通过COM1/COM2口和路由器的Console口连接,在计算机上启用“超级终端”程序,设置“波特率:9600 ,数据位:8,停止位:1,奇偶校验: 无,校验:无”即可。常用 ②Telnet方式。该方式配置要求路由器必须配置了IP地址。基本方法是:计算机通过网卡和路由器的以太网接口相连,计算机的网卡和路由器的以太网接口的IP地址必须在同一网段。常用 ③其他方式:AUX口接MODEM,通过电话线与远方运行终端仿真软件的微机;通过Ethernet上的TFTP服务器;通过Ethernet上的SNMP网管工作站。 2、路由器的工作模式 在命令行状态下,主要有以下几种工作模式: ①一般用户模式。主要用于查看路由器的基本信息,只能执行少数命令,不能对路由 器进行配置。提示符为:Router>;进入方式为:Telnet或Console ②使能(特权)模式。主要用于查看、测试、检查路由器或网络,不能对接口、路由 协议进行配置。提示符为:Router#;进入方式为:Router>enable。 ③全局配置模式。主要用于配置路由器的全局性参数。提示符为:Router(config)#; 进入方式为:Router#config ter。 ④全局模式下的子模式。包括:接口、路由协议、线路等。其进入方式和提示符如下: Router(config)#ineterface e0 //进入接口模式 Router(config-if)#//接口模式提示符 Router(config)#rip //进入路由协议模式 Router(config-router)# //路由协议模式 Router(config)#line con 0 //进入线路模式

思科路由器基本配置与常用配置命令

思科路由器基本配置与常用配置命令(simple for CCNA) 启动接口,分配IP地址: router> router> enable router# router# configure terminal router(config)# router(config)# interface Type Port router(config-if)# no shutdown router(config-if)# ip address IP-Address Subnet-Mask router(config-if)# ^z 配置RIP路由协议:30秒更新一次 router(config)# router rip router(config-if)# network Network-Number router(config-if)# ^z 配置IGRP路由协议:90秒更新一次 router(config)# router igrp AS-Number router(config-if)# network Network-Number router(config-if)# ^z配置Novell IPX路由协议:Novell RIP 60秒更新一次 router(config)# ipx routing [node address] router(config)# ipx maximum-paths Paths router(config)# interface Type Port router(config-if)# ipx network Network-Number [encapsulation encapsulation-type] [secondary] router(config-if)# ^z配置DDR: router(config)# dialer-list Group-Number protocol Protocol-Type permit [list ACL-Number] router(config)# interface bri 0 router(config-if)# dialer-group Group-Number router(config-if)# dialer map Protocol-Type Next-Hop-Address name Hostname Telphone-Number router(config-if)# ^z配置ISDN: router(config)# isdn swith-type Swith-Type router(config-if)# ^z 配置Frame Relay: router(config-if)# encapsulation frame-relay [cisco | ietf ] router(config-if)# frame-relay lmi-type [ansi | cisco | q933a ] router(config-if)# bandwidth kilobits router(config-if)# frame-relay invers-arp [ Protocol ] [dlci ] router(config-if)# ^z配置标准ACL: router(config)# access-list Access-List-Number [ permit | deny ] source [ source-mask ] router(config)# interface Type Port router(config-if)# ip access-group Access-List-Number [ in | out ] router(config-if)# ^z配置扩展ACL: router(config)# access-list Access-List-Number [ permit | deny ] [ Protocol | Protocol-Number ] source source-wildcard [ Source-Port ] destination destination-wildcard [ Destination-Port ] [ established ]

Cisco路由器的SSH配置详解

C i s c o路由器的S S H配 置详解 The document was finally revised on 2021

Cisco路由器的SSH配置详解 2008-06-18 13:04 如果你一直利用Telnet控制网络设备,你可以考虑采用其他更安全的方式。 本文告诉你如何用SSH替换Telnet. 使用Telnet这个用来访问远程计算机的TCP/IP协议以控制你的网络设备相当于在离开某个建筑时大喊你的用户名和口令。很快地,会有人进行监听,并且他们会利用你安全意识的缺乏。 SSH是替代Telnet和其他远程控制台管理应用程序的行业标准。SSH命令是加密的并以几种方式进行保密。 在使用SSH的时候,一个数字证书将认证客户端(你的工作站)和服务器(你的网络设备)之间的连接,并加密受保护的口令。SSH1使用RSA加密密钥,SSH2使用数字签名算法(DSA)密钥保护连接和认证。 加密算法包括Blowfish,数据加密标准(DES),以及三重DES (3DES)。SSH保护并且有助于防止欺骗,“中间人”攻击,以及数据包监听。 实施SSH的第一步是验证你的设备支持SSH.请登录你的路由器或交换机,并确定你是否加载了一个支持SSH的IPSec IOS镜像。 在我们的例子中,我们将使用Cisco IOS命令。运行下面的命令: 该命令显示已加载的IOS镜像名称。你可以用结果对比你的供应商的支持特性列表。 在你验证了你的设备支持SSH之后,请确保设备拥有一个主机名和配置正确的主机域,就像下面的一样: 在这个时候,你就可以启用路由器上的SSH服务器。要启用SSH服务器,你首先必须利用下面的命令产生一对RSA密钥:

思科中路由器的基础配置命令

思科中路由器的基础配置命令。 Cd 更改路径 Cdp enable 允许接口运行CDP协议 Clear 复位功能 Clear counters 清除接口计数器 Clear interface 重新启动接口上的件逻辑 Clockrate 设置串口硬件连接的时钟速率,如网络接口模块和接口处理器能接受的速率Cmt 开启/关闭FDDI连接管理功能 Config-register 修改配置寄存器设置 Configure 允许进入存在的配置模式,在中心站点上维护并保存配置信息 Configure memory 从NVRAM加载配置信息 Configure terminal 从终端进行手动配置 Connect 打开一个终端连接 Copy 复制配置或映像数据 Copy flash tftp 备份系统映像文件到TFTP服务器 Copy running-config startup-config 将RAM中的当前配置存储到NVRAM Copy running-config tftp 将RAM中的当前配置存储到网络TFTP服务器上 Copy tftp flash 从TFTP服务器上下载新映像到Flash Copy tftp running-config 从TFTP服务器上下载配置文件 Debug 使用调试功能 Debug dialer 显示接口在拨什么号及诸如此类的信息 Debug ip rip 显示RIP路由选择更新数据

Debug ipx routing activity 显示关于路由选择协议(RIP)更新数据包的信息 Debug ipx sap 显示关于SAP(业务通告协议)更新数据包信息 Debug isdn q921 显示在路由器D通道ISDN接口上发生的数据链路层(第2层)的访问过程 Debug ppp 显示在实施PPP中发生的业务和交换信息 Delete 删除文件 Deny 为一个已命名的IP ACL设置条件 Dialer idle-timeout 规定线路断开前的空闲时间的长度 Dialer map 设置一个串行接口来呼叫一个或多个地点 Dialer wait-for-carrier-time 规定花多长时间等待一个载体 Dialer-group 通过对属于一个特定拨号组的接口进行配置来访问控制 Dialer-list protocol 定义一个数字数据接受器(DDR)拨号表以通过协议或ACL与协议的组合来控制控制拨号 Dir 显示给定设备上的文件 Disable 关闭特许模式 Disconnect 断开已建立的连接 Enable 打开特许模式 Enable password 确定一个密码以防止对路由器非授权的访问 Enable password 设置本地口令控制不同特权级别的访问 Enable secret 为enable password命令定义额外一层安全性(强制安全,密码非明文显示) Encapsulation frame-relay 启动帧中继封装 Encapsulation novell-ether 规定在网络段上使用的Novell独一无二的格式 Encapsulation PPP 把PPP设置为由串口或ISDN接口使用的封装方法

CISCO路由器简要配置手册

CISCO路由器简要配置手册 编者: 审核: 中兴通讯网络事业部南京用服部

修订记录

目录 第1章路由器配置基础 (1) 1.1IP地址概览 (1) 1.1.1 IP地址的类别 (1) 1.1.2 子网掩码 (2) 1.2路由器基本知识介绍 (2) 1.2.1 路由器物理端口介绍 (2) 1.2.2 路由器型号 (2) 1.2.3 内存体系结构介绍 (3) 1.3基本设置方式 (4) 1.4命令状态 (5) 1.5设置对话过程 (5) 1.6常用命令 (9) 1.7配置IP寻址 (11) 1.8配置静态路由 (14) 第2章广域网协议设置 (16) 2.1HDLC (16) 2.2PPP (21) 2.3 X.25 (23) 2.4F RAME R ELAY (29) 2.5ISDN (34) 2.6PSTN (47) 第3章路由协议设置 (68) 3.1RIP协议 (68) 3.2IGRP协议 (69) 3.3OSPF协议 (70) 3.4重新分配路由 (76) 3.5IPX协议设置 (79) 第4章访问控制 (83) 4.1标准IP访问列表 (83) 4.2扩展IP访问列表 (87) 第5章配置举例 (89)

5.1组网描述 (89) 5.2路由器配置举例 (89)

第1章路由器配置基础 摘要: 路由器是处于网络层的设备,它负责把IP数据包从一个网络中的主机转发到另一个网络上的主机(中间可能用到多个路由器的转发)。路由器可以有多个接口连接局域网络和广域网络。 它有两个基本的功能:路径判断和交换。交换功能让路由器从一个接口接收数据包并转发到其它的接口。路径判断功能使得路由器能选择最合适的接口来转发数据包,即选择最佳的路径到达目的网络。下图中蓝线表示两台计算机IP数据包的传输最佳路径。 1.1 IP地址概览 1.1.1 IP地址的类别 为了同时容纳大型网络和小型网络,网络信息中心(NIC)将32比特IP地址分为A类、B类、C类、D类和E类。每种地址类别分别允许在其网络中有某一数量的网络地址和某一数量的主机地址。 类别地址范围网络数主机数 A类 1.0.0.0到126.0.0.0128(27)16777214 B类128.0.0.0 到191.255.0.016386(214)65532 C类192.0.0.0 到 223.255.255.0大约200万(221)254 D类224.0.0.0 到 239.255.255.254为多组播地址保留 E类240.0.0.0 到 254.255.255.255为研究保留

图解思科路由器配置教程

cisco路由器配置教程 手把手教你配置cisco路由器 经过几十年的发展,从最初的只有四个节点的ARPANET发展到现今无处不在的Internet,计算机网络已经深入到了我们生活当中。随着计算机网络规模的爆炸性增长,作为连接设备的路由器也变得更加重要。 公司在构建网络时,如何对路由器进行合理的配置管理成为网络管理者的重要任务之一。本专题就为读者从最简单的配置开始为大家介绍如何配置cisco路由器。 很多读者都对路由器的概念非常模糊,其实在很多文献中都提到,路由器就是一种具有多个网络接口的计算机。这种特殊的计算机内部也有CPU、内存、系统总线、输入输出接口等等和PC相似的硬件,只不过它所提供的功能与普通计算机不同而已。 和普通计算机一样,路由器也需要一个软件操作系统,在cisco 路由器中,这个操作系统叫做互联网络操作系统,这就是我们最常听到的IOS 软件了。下面就请读者跟着我们来一步步的学习最基本的路由器配置方法。 cisco路由器基本配置: √ cisco IOS软件简介: 大家其实没必要把路由器想的那么复杂,其实路由器就是一个具有多个端口的计算机,只不过它在网络中起到的作用与一般的PC不同而已。和普通计算机一样,路由器也需要一个操作系统,cisco把这个操作系统叫作cisco互联网络操作系统,也就是我们知道的IOS,所有cisco路由器的IOS都是一个嵌入式软件体系结构。

cisco IOS软件提供以下网络服务: 基本的路由和交换功能。 可靠和安全的访问网络资源。 可扩展的网络结构。 cisco命令行界面(CLI)用一个分等级的结构,这个结构需要在不同的模式下来完成特定的任务。例如配置一个路由器的接口,用户就必须进入到路由器的接口配置模式下,所有的配置都只会应用到这个接口上。每一个不同的配置模式都会有特定的命令提示符。EXEC为IOS软件提供一个命令解释服务,当每一个命令键入后EXEC便会执行该命令。 √第一次配置Cisco路由器: 在第一次配置cisco路由器的时候,我们需要从console端口来进行配置。以下,我们就为大家介绍如何连接到控制端口及设置虚拟终端程序。 1、使用rollover线和一个RJ45和DB9或者DB25的转换适配器连接路由器控制端口和终端计算机。

思科路由器配置命令和方法

第一章:路由器配置基础 一、基本设置方式 一般来说,可以用5种方式来设置路由器: 1.Console口接终端或运行终端仿真软件的微机; 2.AUX口接MODEM,通过电话线与远方的终端或运行终端仿真软件的微机相连;3.通过Ethernet上的TFTP服务器; 4.通过Ethernet上的TELNET程序; 5.通过Ethernet上的SNMP网管工作站。 但路由器的第一次设置必须通过第一种方式进行,此时终端的硬件设置如下: 波特率:9600 数据位:8 停止位:1 奇偶校验: 无 二、命令状态 1. router> 路由器处于用户命令状态,这时用户可以看路由器的连接状态,访问其它网络和主机,但不能看到和更改路由器的设置内容。 2. router# 在router>提示符下键入enable,路由器进入特权命令状态router#,这时不但可以执行所有的用户命令,还可以看到和更改路由器的设置内容。 3. router(config)# 在router#提示符下键入configure terminal,出现提示符router(config)#,此时路由器处于全局设置状态,这时可以设置路由器的全局参数。 4. router(config-if)#; router(config-line)#; router(config-router)#;… 路由器处于局部设置状态,这时可以设置路由器某个局部的参数。 5. > 路由器处于RXBOOT状态,在开机后60秒内按ctrl-break可进入此状态,这时路由器不能完成正常的功能,只能进行软件升级和手工引导。 设置对话状态 这是一台新路由器开机时自动进入的状态,在特权命令状态使用SETUP命令也可进入此状态,这时可通过对话方式对路由器进行设置。 三、设置对话过程 显示提示信息 全局参数的设置 接口参数的设置 显示结果 利用设置对话过程可以避免手工输入命令的烦琐,但它还不能完全代替手工设置,一些特殊的设置还必须通过手工输入的方式完成。 进入设置对话过程后,路由器首先会显示一些提示信息: --- System Configuration Dialog --- 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 '[]'. 这是告诉你在设置对话过程中的任何地方都可以键入“?”得到系统的帮助,按ctrl-c可以退

cisco路由器配置教程

Cisco路由器配置教程 翻译:何高卓(2001-04-19 14:28:01) Josh Gentry, 1999年9月6日,v.99 翻译:何高卓1999.12.10 -------------------------------------------------------------------------------- 本人声明:本人本着“我为人人,人人为我”的宗旨翻译了此文。本文仅为阁下提供参考。 如果由于本人在翻译过程中的疏忽和错误造成阁下经济上或精神上的损失,本人 只能深表遗憾而拒绝承担一切责任。 -------------------------------------------------------------------------------- 本文覆盖了使用命令行界面的基本的Cisco路由器IP地址配置 -------------------------------------------------------------------------------- 感谢 以下的资源非常有用: Leinwand、Pinsky和Culpepper。Cisco路由器的配置。印第安纳州印第安纳波利斯:Cisco公司出版,1998。Cisco系统公司, 感谢Newman给我上了配置Cisco路由器的第一节课。 本文的信息原先搜集于,或者说得自于James Hart先生所完成的计划。他在Albuquerque,NM(美国新墨西哥州)的技术/职业学院教师。非常感谢他允许我参加该计划的工作。 弃权书 本文的传播无须明确或含蓄的授权,对本文包含的信息的正确性亦不作任何担保。本文仅提供给需要帮助的人使用,但使用者必须自己承担风险。如果使用者由于使用本文而造成的任何损失作者和TVI(技术/职业学院)概不负责。 约定

CISCO路由器入门配置手册

CISCO路由器配置手册 第一章路由器配置基础 一、基本设置方式 一般来说,可以用5种方式来设置路由器: 1.Console口接终端或运行终端仿真软件的微机; 2.AUX口接MODEM,通过电话线与远方的终端或运行终端仿真软件的微机相连;3.通过Ethernet上的TFTP服务器; 4.通过Ethernet上的TELNET程序; 5.通过Ethernet上的SNMP网管工作站。 但路由器的第一次设置必须通过第一种方式进行,此时终端的硬件设置如下: 波特率:9600 数据位:8 停止位:1 奇偶校验: 无

二、命令状态 1.router> 路由器处于用户命令状态,这时用户可以看路由器的连接状态,访问其它网络和主机,但不能看到和更改路由器的设置内容。 2.router# 在router>提示符下键入enable,路由器进入特权命令状态router#,这时不但可以执行所有的用户命令,还可以看到和更改路由器的设置内容。 3.router(config)# 在router#提示符下键入configure terminal,出现提示符router(config)#,此时路由器处于全局设置状态,这时可以设置路由器的全局参数。 4.router(config-if)#; router(config-line)#; router(config-router)#;… 路由器处于局部设置状态,这时可以设置路由器某个局部的参数。 5.> 路由器处于RXBOOT状态,在开机后60秒内按ctrl-break可进入此状态,这时路由器不能完成正常的功能,只能进行软件升级和手工引导。 6.设置对话状态 这是一台新路由器开机时自动进入的状态,在特权命令状态使用SETUP命令也可进入此状态,这时可通过对话方式对路由器进行设置。 三、设置对话过程 1.显示提示信息 2.全局参数的设置 3.接口参数的设置 4.显示结果 利用设置对话过程可以避免手工输入命令的烦琐,但它还不能完全代替手工设置,一些特殊的设置还必须通过手工输入的方式完成。

路由基本配置命令

路由基础配置命令UTP双绞线类型: 直通线: 交叉线: 广域网线缆连接类型: DTE: DCE: 时钟速率: 路由器的接口:(作用) 1. 广域网接口: serial 2. 内网接口:fastethernet 3. 管理接口:console (控制台)AUX(备份) 连接两个设备: 1. 物理连接 2. 逻辑连接

配置网络设备: 1. 管理属性:用户名密码描述警告 2. 协议地址:IP IPX 3. 协议策略:vlan 静态访问控制 交换机直接可以应用 路由器需要初始配置才能应用 设备启动过程: 1. 加电自检 2. 查找加载操作系统 3. 查找加载配置文件 配置网络设备方式: 1. 初始配置:console 2. 初始配置后通过interface(拥有ip地址的接口): 1)telnet 2)TFTP 3)WEB 4)网络管理工具:SNA SDM 配置直接应用到内存 登陆路由器:

Router> Router>enable /*进入特权模式Router# Router#disable /*退出特权模式Router> Router>logout /*退出路由器Router>exit /*退出路由器 路由器IOS帮助功能:?的三个用法 1/ 直接问号 2/ Router#cl? clear clock Router#cl 3/ Router#clock % Incomplete command. Router#clock ?

set Set the time and date Router#clock 问号的帮助功能:(查找路由器设置时间的命令并设置时间) Router#cl? clear clock Router#clock % Incomplete command. Router#clock ? set Set the time and date Router#clock set % Incomplete command. Router#clock set ? hh:mm:ss Current Time Router#clock set 11:04:50 % Incomplete command. Router#clock set 11:04:50 ? <1-31> Day of the month MONTH Month of the year Router#clock set 11:04:50 15 % Incomplete command.

cisco 2800路由器配置过程

Cisco 2800路由器配置过程 实验说明:通过console口和交叉线连接路由器,用telnet远程登录路由器。 实验步骤: 1,配置pc机的IP地址为:192.168.1.2 子网掩码:255.255.255.0 默认网关:192.168.1.1 2,打开路由器的CIL: 3,router>enable :进入特权模式: 4,Router#config terminal :进入全局配置模式 5,Router(config)#hostname frank :设置路由器的主机名 6,frank(config)#enable secret 123 :设置特权加密口令 7,frank(config)#line console 0 :进入控制台口 8,frank(config-line)#line vty 0 4 :进入虚拟终端 9,frank(config-line)#password zijuan :设置虚拟终端登录口令 10,frank(config-line)#login :登录 11,frank(config-line)#exit :退出控制台 12,frank(config)#interface fa 0/0 :配置端口fa 0/0 13,frank(config-if)#ip address 192.168.1.1 2555.255.255.0 :配置路由器端口fa 0/0的IP及子网掩码 14,frank(config-if)#no shutdown 开启以太网fa 0/0端口 15,打开pc机的终端,先ping默认网关,看能否与路由器ping通,如下图: 16,输入命令:telnet 192.168.1.1 (默认网关)登录到路由器,如下:

思科路由器命令大全(完整版)

思科交换机路由器命令大全 交换机命令: switch> 用户模式 1:进入特权模式 enable switch> enable switch# 2:进入全局配置模式 configure terminal switch> enable switch#configure terminal switch(conf)# 3:交换机命名 hostname aptech2950 以aptech2950为例 switch> enable switch#configure terminal switch(conf)#hostname aptch-2950 aptech2950(conf)# 4:配置使能口令 enable password cisco 以cisco为例 switch> enable switch#configure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable password cisco 5:配置使能密码 enable secret ciscolab 以cicsolab为例--设置禁用IP地址解析特性,设置启用消息同步特性 switch> enable switch#configure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable secret ciscolab aptech2950(conf)#no ip domain-lookup -----设置禁用IP 地址解析特性 aptech2950(conf)#logging synchronous -----设置启用消息同步特性 aptech2950(conf)#interface range fastethernet0/1-20

相关文档
最新文档