当前位置:文档之家› 路由器、交换机配置命令及模拟软件中的实验内容

路由器、交换机配置命令及模拟软件中的实验内容

路由器、交换机配置命令及模拟软件中的实验内容
路由器、交换机配置命令及模拟软件中的实验内容

路由器、交换机配置命令

计算机命令:

PCA login: root ;使用root用户password: linux ;口令是linux

# shutdown -h now ;关机

# init 0 ;关机

# logout

# login

# ifconfig ;显示IP地址

# ifconfig eth0 netmask ;设置IP地址

# ifconfig eht0 netmask down ; 删除IP地址

# route add 0.0.0.0 gw

# route del 0.0.0.0 gw

# route add default gw ;设置网关

# route del default gw ;删除网关

# route ;显示网关

# ping

# telnet ;建立telnet之前先ping一下

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

交换机基本状态:

switch: ;ROM状态, 路由器是rommon>

hostname> ;用户模式hostname# ;特权模式

hostname(config)# ;全局配置模式hostname(config-if)# ; 接口状态

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

交换机口令设置:

switch>enable ;进入特权模式

switch#config terminal ;进入全局配置模式switch(config)#hostname ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令为xxx switch(config)#enable password xxx ;设置特权非密口令为xxx switch(config)#line console 0 ;进控制台口(Rs232)初始化switch(config-line)#line vty 0 4 ;进入虚拟终端virtual tty 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)#switchport access vlan 2 ;当前端口1加入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

switch(config)#vtp mode server

switch(config)#vtp mode client

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

交换机设置IP地址:

switch(config)#interface vlan 1 ;进入vlan 1

switch(config-if)#ip address ;添加远程登录IP

switch(config)#ip default-gateway ;添加默认网关

switch#dir flash: ;查看内存

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

交换机显示命令:

switch#write ;写入保存

switch#show vtp

switch#show run ;查看当前配置信息switch#show vlan ;看VLAN

switch#show interface ;显示所有端口信息switch#show int f0/0 ;显示端口0的信息

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

路由器显示命令:

router#show run ;显示接口

router#show interface ;显示接口

router#show ip route ;显示路由

router#show cdp nei ;看邻居

router#reload ;重新起动

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

设置口令:

router>enable ;进入特权模式

router#config terminal ;进入全局配置模式router(config)#hostname ;设置交换机的主机名router(config)#enable secret xxx ;设置特权加密口令为xxx router(config)#enable password xxx ;设置特权非密口令为xxx router(config)#line console 0 ;进控制台口(Rs232)初始化router(config-line)#line vty 0 4 ;进入虚拟终端virtual tty router(config-line)#login ;允许登录

router(config-line)#password xx ;设置登录口令xx

router(config)# (Ctrl+z) ; 返回特权模式

router#exit ;返回命令

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

配置IP地址:

router(config)#int s0/0 ;进行串Serail接口

router(config-if)#no shutdown ;起动接口

router(config-if)#clock rate 64000 ;设置时钟

router(config-if)#ip address 10.1.1.1 255.255.0.0 ;设置IP地址和子网掩码

router(config-if)#ip add 10.1.1.2 255.255.0.0 second;

router(config-if)#int f0/0.1 ; 进入子接口

router(config-subif.1)#ip address

router(config-subif.1)#encapsulation dot1q

router(config)#config-register 0x2142 ;跳过配置文件

router(config)#config-register 0x2102 ;正常使用配置文件

router#reload ;重新引导

复制操作:

router#copy running-config startup-config ;存配置

router#copy running-config tftp ;上载

router#copy startup-config tftp

router#copy tftp flash: ;特权模式下升级IOS

router#copy tftp startup-config;下载配置文件到nvram

ROM状态:

Ctrl+Break ;进入ROM监控状态rommon>confreg 0x2142 ;跳过配置,26 36 45xx rommon>confreg 0x2102 ;使用配置,恢复工作状态rommon>reset;重新引导,等效于重开机rommon>copy xmodem: flash: ;从console升级IOS

rommon>IP_ADDRESS=10.65.1.2 ;设置路由器IP rommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IP rommon>TFTP_FILE=c2600.bin ;所要下载的文件rommon>tftpdnld ;ROM监控状态下升级IOS rommon>dir flash: ;查看闪存中的内容rommon>boot ;引导IOS

静态路由:

ip route 例:

router(config)#ip route 10.1.0.0 255.255.0.0 10.2.1.1

router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2

动态路由:

router(config)#ip routing ;启动路由

router(config)#router rip ;启动RIP路由协议。router(config-router)#network ;配置范围,有的支持all。router(config-router)#negihbor ;点对点帧中继用。

帧中继命令:

router(config)# frame-relay switching ;使能帧中继交换

router(config-s0)# encapsulation frame-relay ;使能帧中继

router(config-s0)# frame-relay intf-type DCE ;DCE端(需要配虚电路) router(config-s0)# frame-relay local-dlci 20 ;配置虚电路号

基本访问控制列表:

router(config)#access-list permit|deny

router(config)#interface ;default: deny any

router(config-if)#ip access-group in|out ;default: out

例:

RB(config)#access-list 4 permit 10.8.1.1

RB(config)#access-list 4 deny 10.8.1.0 0.0.0.255

RB(config)#access-list 4 permit 10.8.0.0 0.0.255.255

RB(config)#access-list 4 deny 10.0.0.0 0.255.255.255

RB(config)#access-list 4 permit any

RB(config)#int f0/0

RB(config-if)#ip access-group 4 in

扩展访问控制列表:

access-list permit|deny icmp

wild>[type]

access-list permit|deny tcp

wild>[port]

例1:

router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo

router(config)#access-list 101 permit ip any any

router(config)#int s0/0

router(config-if)#ip access-group 101 in

例2:

router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80

router(config)#access-list 102 permit ip any any

router(config)#interface s0/1

router(config-if)#ip access-group 102 out

router(config)#no access-list 102

router(config-if)#no ip access-group 101 in

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

交换机路由器模拟软件中的实验

实验一

实验一口令和主机名设置

1. 口令和设备名设置

添加一个交换机或一个路由器,先对交换机进行操作,双击SwitchA

switch>en

password: ;第一次密码为空,直接回车

switch#conf t ;进入全局配置模式

switch(config)#hostname swa ;设置交换机名

swa(config)#enable secret aaa ;设置特权加密口令为aaa

swa(config)#enable password aax ;设置特权非密口令为aax

swa(config)#line console 0 ;进入控制台口(Rs232)状态

swa(config-line)#login ;允许登录

swa(config-line)#password aa ;设置登录口令aa

swa(config-line)#line vty 0 4 ;进入虚拟终端virtual tty

swa(config-line)#login ;允许登录

swa(config-line)#password a ;设置登录口令a

swa(config-line)#exit ;返回上一层

swa(config)#exit ;返回上一层

swa#sh run ;看配置信息

swa#exit ;返回命令

swa>en

password: ;哪一个口令可以通过

双击ROA对路由器进行与交换机类似的设置。

2. 清除口令

清除交换机口令,实际中是在开机时按住交换机上的mode钮,本模拟机按

Ctrl+Break。口令请除,可以重新配置口令了。

清除路由器口令,实际中是在开机时上电时,按Ctrl+Break,本模拟机按

Ctrl+Break。参考操作如下:双击RouterA 。

先配置路由的特权口令:

router>en

password: ;第一次密码为空,直接回车

router#conf t ;进入全局配置模式

router(config)#enable secret aaa ;设置特权加密口令为aaa

router(config)#exit ;返回

router#exit

router>en

password:aaa

router#

清除路由器的口令是在假设口令丢失情况下使用的方法,具体的操作是

开机进入rommon状态,打开寄存器配置开关:

router#reload ;重新启动,按Ctrl+Break

rommon>

rommon>confreg 0x2142 ;跳过配置,26xx 36xx 45xx

rommon>reset;重新引导,等效于重开机

router>en

password:

router#conf t

router(config)#enable secret bbb ;设置特权加密口令为aaa

router(config)#config-register 0x2102 ;正常使用配置文件

router(config)#exit

router#exit

router>en

password:bbb

router#

在实际工作中一般要备份路由器的配置文件,当系统有问题时将配置文件复原。

可以这样操作:

router#dir nvram:

router#copy nvram:startup-config tftp:

router#copy tftp:startup-config flash:

router#

实验二

实验二计算机与交换机IP地址设置

1. 双击PCA, 输入用户名和入口令,打“?”可以求

得帮助。

PCA login:root

Password:linux

设置IP :

[root#PCA root]# ifconfig eth0 10.65.1.1 netmask 255.255.0.0 查看IP :

[root#PCA root]# ifconfig

删除IP :

[root#PCA root]# ifconfig eth0 10.65.1.1 netamsk 255.255.0.0 down 设置网关:

[root#PCA root]# route add default gw 10.65.1.9

查看网关:

[root#PCA root]# route

删除网关:

[root#PCA root]# route del default gw 10.65.1.9

2. 双击PCB, 输入用户名和入口令,打“?”可以求得帮助。PCB login:root

Password:linux

设置IP :

[root#PCB root]# ifconfig eth0 10.65.1.2 netmask 255.255.0.0 [root#PCB root]# ifconfig

设置网关:

[root#PCB root]# route add default gw 10.65.1.9

[root#PCB root]# route

3. 双击SW A

进入特权模式:

switch>en

进入全局配置模式:

switch#conf t

进入默认VLAN状态:

switch(config)#int vlan 1

设置ip地址和掩码:

switch(config-if)#ip address 10.65.1.3 255.255.0.0

设置switch的网关:

switch(config)#ip defaule-gateway 10.65.1.9

查看当前配置:

switch#sh run

测试联通情况:

switch#ping 10.65.1.1

switch#ping 10.65.1.2

switch#ping 10.65.1.3

switch#ping 10.65.1.4 没有这个IP,所以不通。

4. 双击PCA

[root@PCA root]# ping 10.65.1.1

[root@PCA root]# ping 10.65.1.2

[root@PCA root]# ping 10.65.1.3

[root@PCA root]# ping 10.65.1.4 没有这个IP,所以不通。

5.修改PCB的ip地址

修改为不同网段的一个ip地址,为10.66.1.2,再从PCA Ping PCB。

[root#PCB root]# ifconfig eth0 10.66.1.2 netmask 255.255.0.0

[root@PCA root]# ping 10.66.1.2

修改为相同网段的一个ip地址,为10.65.1.4,再从PCA Ping PCB。

[root#PCB root]# ifconfig eth0 10.65.1.4 netmask 255.255.0.0

[root@PCA root]# ping 10.65.1.4

断开交换机与PCA计算机连线,理解如下操作:

[root@PCA root]# ping 10.65.1.4

[root@PCA root]# ping 10.65.1.1

[root@PCA root]# ping 127.0.0.1

实验三

实验三交换机VLAN实验

1. 规划ip地址

PCA的ip 地址: 10.65.1.1

PCB的ip 地址: 10.66.1.1

PCC的ip 地址: 10.65.1.3

PCD的ip 地址: 10.66.1.3

SW A的ip 地址: 10.65.1.7

SWB的ip 地址: 10.65.1.8

SW A的f0/5~f0/7 vlan 2 ,f0/8为trunk

SWB的f0/5~f0/7 valn 2 ,f0/1为trunk

用ping命令测试,从PCA和PCB到各点的连通情况。由于交换机初始化为vlan 1,

所以同网段的可以通。即PCA到PCC、SW A、SWB是通的,而PCB只与PCD通。

2.设置VLAN

双击SwitchA,改名SwitchA为SW A,建立2 个vlan,分别为2、3

switch>en

switch#sh vlan

switch#conf t

switch(config)#hosthame SWA

switch(config)#exit

SWA#vlan database

SWA(vlan)#vlan 2

SWA(vlan)#vlan 3

SWA(vlan)#exit

将SW A交换机的f0/5,f0/6,f0/7 加入到vlan 2

SWA(config)#int f0/5

SWA(config-if)#switchport access vlan 2

SWA(config-if)#int f0/6

SWA(config-if)#switchport access vlan 2

SWA(config-if)#int f0/7

SWA(config-if)#switchport access vlan 2

SWA(config-if)# end

SWA#sh vlan

在SWB上与SW A上类似,将SWB交换机f0/5,f0/6,f0/7 加入到vlan 2。

3.测试可通性

从PCA到PCC测试:

[root@PCA root]# ping 10.65.1.3 (通)

从PCA到PCB测试:

[root@PCA root]# ping 10.66.1.1 (不通,因为不同网段,不同VLAN) 从PCB到PCD测试:

[root@PCB root]# ping 10.66.1.3 (不通,要求trunk)

从PCA到SW A测试:

[root@PCA root]# ping 10.65.1.7(通,同一网段,同在vlan 1)

从PCA到SWB测试:

[root@PCA root]# ping 10.65.1.8(通,同一网段,同在vlan 1)

从SW A到PCA测试:

SWA#ping 10.65.1.1 (通)

从SW A到PCB测试:

SWA#ping 10.66.1.1 (不通,因为不同网段,不同VLAN)

从SW A到SWB测试:

SWA#ping 10.65.1.8 (通)

4. 设置干线trunk

将连接两个交换机的端口设置成trunk。

SWA(config)#int f0/8

SWA(config-if)#switchport mode trunk

SWA(config-if)#switchport trunk allowed vlan 1,2,3

SWA(config-if)#switchport trunk encap dot1q

SWA(config-if)#end

SWA#sh run

SWB(config)#int f0/1

SWB(config-if)#switchport mode trunk

SWB(config-if)#switchport trunk allowed vlan 1,2,3

SWB(config-if)#switchport trunk encap dot1q

SWB(config-if)#end

SWB#sh run

交换机创建trunk时默认allowed all,所以上面的trunk allowed 命令可以不用。

dot1q是vlan中继协议(802.1q),由于正确设置了trunk,两个交换机间可以多个vlan通过,所以PCA->PCC, PCB->PCD 可以通了。

[root@PCA root]# ping 10.65.1.3 (通,同在vlan 1)

[root@PCB root]# ping 10.66.1.3(通,同在vlan 2)

[root@PCA root]# ping 10.66.1.3 (不通,不同vlan需要路由)

5. 三个交换机的情况

再加入一个交换机switchC,将它串入switchA和switchB之间,连接方式:

switchA:F0/8-->switchC:F0/3; switchC:F0/6-->switchB:F0/1

(1) 新加入的SwitchC 默认状态时,测试连通性。

从PCA->PCC,从PCB->PCD 测试:

[root@PCA root]# ping 10.65.1.3 (不通)

[root@PCB root]# ping 10.66.1.3 (不通)

由于新加入的交换机没有设置trunk,所有接口默认vlan 1,对于交换机而言,trunk 要成对出现,如果dot1q不能和另一端交换信息会自动down掉。

(2) 将交换机之间的连线都设置成trunk时,再测试连通性。

SWC(config)#int f0/3

SWC(config-if)#switchport mode trunk

SWC(config-if)#switchport trunk encap dot1q

SWC(config-if)#int f0/6

SWC(config-if)#switchport mode trunk

SWC(config-if)#switchport trunk encap dot1q

SWC(config-if)#end

SWC#sh run

由于建立trunk时默认为trunk allowed vlan all,所以这里没设置。

现在有两条正确的trunk,再看一下联通情况:

[root@PCA root]# ping 10.65.1.3 (通)

[root@PCB root]# ping 10.66.1.3 (通)

(3) 设置vtp

VTP是vlan 传输协议,在VTP Server上配置的vlan 在条件允许条件下,可以

从VTP Client 端看到VTP Server上的vlan,并将自己端口加入到vlan中。

SWC(config)#vtp domain abc

SWC(config)#vtp mode server

SWC(config)#vtp password ok

SWB(config)#vtp domain abc

SWB(config)#vtp mode client

SWB(config)#vtp password ok

SWB#sh vlan

SWA#sh vlan

SWC#sh vlan

当口令和域名一致时,client端可以学习到server端的vlan,在VTP Server端还

可以有很多策略,这里只是说明最基本的问题。

VTP在企业、机关、学校的应用是很多的,在主交换机上设置好vlan以后,下级的交换机不用再设置vlan,可以将client的某些端口添加到VTP Server中定义的vlan中去,加强了管理。

实验四

实验四路由器的升级

1. 在ROM监控模式下,使用console口的升级。

这种情况的升级,要求路由器console与计算机

的rs232相连,在计算机上启动超级

终端。

真实情况下,要求在先启动计算机的超级终端,

还原为9600波特率,在路由器上电60

秒内按计算机的Ctrl+Break 键,你将会看到

rommon>

在模拟器上提示router>时,按[Ctrl]+[Break],进入ROM监控状态。

router>[Ctrl]+[Break]

rommon>copy xmodem:c2621.bin flash:c2621.bin ;从console升级IOS

真实情况时,要在超级终端中,选择传送选择发送文件,出现对话框,通过浏览指

定要发送的文件,选择xmohem->单击发送按扭,传送开始,模拟机下直接开始:copying

###############################################################

ok!

rommon>dir flash:

c2621.bin

这种方式传送的速度比较慢,RS232串行接口的波特率一般为9600,但这是一种最

基本的方式,不需要IOS的支持,在IOS损坏的情况下往往使用这种方式。

2. 在特权模式下的升级

升级IOS,一般在特权方式下通过tftp方式进行,要求进入特权模式,没有的支持不行的。

这种情况要求局网中有一个TFTP Server,模拟机上已经指定PCA是TFTP Server,所以要求将PCA 接入路由器的以太口,并且PCA的ip 地址与路由接口的ip地址在一个网络段。应该PCA可以ping 通PCB,即它们在网络上是通的。

设置TFTP Server(PCA)的ip地址为:10.65.1.1

双击HostA:

login: root

password: linux

[root#linux root]# ifconfig eth0 10.65.1.1 netmask 255.255.0.0

[root#linux root]# ifconfig (这是查看IP地址)

设置路由器与TFTP Server相联接口f0/0的ip地址为10.65.1.2

双击要升级的路由器:

router>en

password:

router#conf t

router(config)#int f0/0

router(config-if)#ip address 10.65.1.2 255.255.0.0

router(config-if)#no shut

router(config-if)#end

router#ping 10.65.1.1 (通)

router#copy tftp: flash:

tftp server ip address:10.65.1.1

flash file name:C2621.bin

Now updata IOS

###############################################################

ok!

router#dir flash:

c2621.bin

这种方式传输的速度较快,使用的是以太网的速率。但要求IOS是好的,所以升级IOS用这种方式较好。

3. 在rommon监控状态下用TFTP升级

在rommon 模式使用超级终端更新IOS的方法,不用IOS的支持,但速度很慢,在特权方式下升级,使用TFTP Server 速度快,但要求IOS的支持,能否集两者之优点,即在rommon模式下,使用TFTP方式呢,答案是肯定的。

这时要求路由器console与计算机( Host B)的rs232相连,路由器f0/0与TFTP Server(计算机Host A)的网卡相连。

路由器上电时,按计算机上的[Ctrl]+[Break],进入ROM监控状态:

router>Ctrl+Break

rommon>tftpdnld (没有设置时,显示系统信息,注意大小写)

IP_ADDRESS: 10.66.1.1

IP_SUBNET_MASK: 255.255.0.0

TFTP_SERVER: 10.65.0.46

TFTP_FILE: c2600.bin

rommon>IP_ADDRESS=10.65.1.2 ;设置路由器IP

rommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码

rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IP

rommon>TFTP_FILE=c2600.bin ;所要下载的文件

rommon>tftpdnld ;ROM监控状态升级IOS

loading

###############################################################

ok!

rommon>dir flash: ;查看闪存中的内容

c2600.bin

rommon>boot ;引导IOS router>

实验五

实验五路由器接口ip及直联路由

本实验配置路由器的IP地址,测试路由器

的直联路由和计算机网关的作用。

实验中有两个计算机,一个路由器。

1. 设置计算机ip地址

设置PCA 的IP地址为:10.65.1.1 255.255.0.0,

网关:10.65.1.2

设置PCB 的IP地址为:10.66.1.1 255.255.0.0 网关:10.65.1.2 设置ROA f0/0 IP 为:10.65.1.2 255.255.0.0

设置ROA f0/1 IP 为:10.66.1.2 255.255.0.0

设置计算机PCA的Ip地址和网关的操作:

[root#PCA root]# ifconfig eth0 10.65.1.1 netmask 255.255.0.0

[root#PCA root]# ifconfig

[root#PCA root]# route add default gw 10.65.1.2

[root#PCA root]# route

设置计算机PCB的Ip地址和网关的操作:

[root#PCB root]# ifconfig eth0 10.66.1.1 netmask 255.255.0.0

[root#PCB root]# ifconfig

[root#PCA root]# route add default gw 10.66.1.2

[root#PCA root]# route

2. 双击Router A,配置路由器的接口IP地址:

router>en

router#conf t

router(config)#hostname roa

roa(config)#ip routing (默认是关闭的)

roa(config)int f0/0

roa(config-if)#ip address 10.65.1.2 255.255.0.0

roa(config-if)#no shutdown (默认是shutdown)

roa(config)int f0/1

roa(config-if)#ip address 10.66.1.2 255.255.0.0

roa(config-if)#no shut

roa(config)int s0/0

roa(config-if)#clock rate 64000

roa(config-if)#ip address 10.67.1.2 255.255.0.0

roa(config-if)#no shut

roa(config)int s0/1

roa(config-if)#clock rate 64000

roa(config-if)#ip address 10.68.1.2 255.255.0.0

roa(config-if)#no shut

3.探测网络联通情况

[root#PCA root]# ping 10.65.1.2 (通)

[root#PCA root]# ping 10.66.1.2 (通)

[root#PCA root]# ping 10.66.1.1 (通)

[root#PCA root]# ping 10.67.1.2 (不通)

[root#PCA root]# ping 10.68.1.2 (不通)

[root#PCB root]# ping 10.65.1.2 (通)

[root#PCB root]# ping 10.65.1.1 (通)

[root#PCB root]# ping 10.66.1.2 (通)

[root#PCB root]# ping 10.67.1.2 (不通)

[root#PCB root]# ping 10.68.1.2 (不通)

roa#ping 10.65.1.1 (通)

roa#ping 10.65.1.2 (通)

roa#ping 10.66.1.1 (通)

roa#ping 10.66.1.2 (通)

roa#ping 10.67.1.2 (不通)(由于没有接线,空口会自动down掉) roa#ping 10.68.1.2 (不通)

下面我们做这个几个小实验:

(1) 将路由器的接口f0/0关闭,再复原

roa#conf t

roa(config)#int f0/0

roa(config-if)#shutdown

roa(config-if)#end

roa#ping 10.65.1.2 (不通)

[root#PCA root]# ping 10.65.1.2 (不通)

[root#PCA root]# ping 10.65.1.2 (不通)

roa(config)#int f0/0

roa(config-if)#end

roa#ping 10.65.1.2 (通)

(2) 关闭路由器的路由, 再复原

roa#conf t

roa(config)#no ip routing

[root#PCA root]# ping 10.65.1.2 (通)

[root#PCA root]# ping 10.66.1.2 (通)

[root#PCA root]# ping 10.66.1.1 (不通)

对于PCB是同样的道理,它可以ping通路由器的激活的物理接口,但不能ping通

下面的计算机,因为不能和下面交接信息了。

roa(config)#ip routing

(3) 去掉计算机PCA的网关

[root#PCA root]# route del default gw

PCA只能ping通直联口,没有网关不能和路由器交换信息。而其它的机器也不能

ping通PCA。

[root#PCA root]# ping 10.65.1.2 (通,因为与计算机直接相联的口)

[root#PCA root]# ping 10.66.1.1 (不通)

[root#PCB root]# ping 10.65.1.2 (通)

[root#PCB root]# ping 10.65.1.1 (不通)

实验六

实验六一个vlan下的单臂路由

在一个vlan下,可以通过设置计算机的secondary

ip实现在一个物理网络上两个

具有不同网段IP计算机的联通。

1.设置计算机PCA的Ip地址

[root#PCA root]# ifconfig eth0 10.65.1.1 netmask

255.255.0.0

[root#PCB root]# ifconfig eth0 10.66.1.1 netmask

255.255.0.0

[root#PCA root]# ping 10.66.1.1 (不通)

[root#PCB root]# ping 10.65.1.1 (不通)

PCA与PCB是不通的,因为它们在不同的网络段,一个是10.65.0.0/16网络,一个

是10.66.0.0/16网络,即netid不同,而不同网络的主机间访问必须通过路由实现。

2. 设置路由器接口f0/0有两个ip地址。

roa(config-if)#ip address 10.65.1.2 255.255.0.0

roa(config-if)#no shut

roa(config-if)#ip address 10.66.1.2 255.255.0.0 secondary

roa#sh run

在显示的信息当中,在FastEthernet0/0的位置,应该能够看到前面设置的两个IP

地址。

3. 测试可通性

[root#PCA root]# ping 10.66.1.1 (不通)

[root#PCA root]# ping 10.66.1.2 (通)

[root#PCB root]# ping 10.65.1.1 (不通)

[root#PCB root]# ping 10.65.1.3 (通)

为什么PCA和PCB还是不通呢?哦,还没有设置计算机的网关。

[root#PCA root]# route add default gw 10.65.1.2

[root#PCB root]# route add default gw 10.62.1.2

[root#PCA root]# ping 10.66.1.1 (通了)

[root#PCB root]# ping 10.65.1.1 (通了)

4. 去掉交换机与路由器的联接线

[root#PCA root]# ping 10.66.1.1 (不通了)

[root#PCB root]# ping 10.65.1.1 (不通了)

由此可以看出,PCA到PCB的发送的数据包是经过路由器的,从路由器f0/0入,再

从f0/0出,所以称之为单臂路由。

这种情况PCA和PCB在同一个广播域中,对网络带宽不利。如果划分VLAN可以隔离广播域。通过子接口可以实现对不同VLAN的路由。

5. 在交换机上的情况

双击交换机,进入交换机的终端模式:

switch>en

password:

switch#conf t

switch(config)#int vlan 1

switch(config-if)#ip address 10.65.1.8 255.255.0.0

switch(config-if)#exit

switch(config)#ip defaule-gateway 10.65.1.2

switch(config)#end

switch#ping 10.65.1.1 (通)

switch#ping 10.66.1.1 (通)

断开交换机与路由器的联线,再执行从交换机ping 命令:

switch#ping 10.65.1.1 (通)

switch#ping 10.66.1.1 (不通)

这说明不同网络段IP的联通是要通过路由器的。

实验七

实验七子接口单臂路由

子接口用于对不同vlan的路由,接上个实验,计

算机、交换机IP地址和网关不变,

但要求交换机工作在两个VLAN的情况下,新设置的

VLAN 2,含f0/6、f0/7。

当交换机有两个VLAN时,逻辑上成为两个网络,

隔离了广播域。两个vlan间的访问

必须通过路由器,如果接入路由器的一个物理接口,

要划分子接口分别与两个vlan对应

同时还要求与路由器相联的交换接口f0/1要划分为trunk,因为这个口要通过两个vlan

数据包。

对于secondary Ip的情况,从实质上是一个接口,不能实现对两个vlan的路由。

1. 设置交换机的vlan 2和trunk

switch#vlan database

switch(vlan)#vlan 2

switch(vlan)#exit

switch#conf t

switch(config)#hostname SWA

SWA(config)#int f0/6

SWA(config-if)#switchport access vlan 2

SWA(config-if)#int f0/7

SWA(config-if)#switchport access vlan 2

SWA(config-if)#int f0/1

SWA(config-if)#switchport mode trunk

SWA(config-if)#switchport trunk allowed vlan 1,2,3

SWA(config-if)#switchport trunk encap dot1q

SWA(config-if)#end

SWA#sh vlan

SWA#sh run

检查设置情况,应该能正确的看到vlan和trunk等信息。

dot1q是vlan中继协议802.1q,有的设备上使用的是cisco的isl协议,它们的作用

是一样的。

计算机的ip地址分别为10.65.1.1、10.66.1.1,网关分别指向路由器的子接口

10.65.1.2、10.66.1.2。

现在从PCA向PCB发关Ping 的ICMP数据包肯定是不通的。即:

[root#PCA root]# ping 10.66.1.1 (不通)

2. 设置路由器f0/0 为两个子接口

roa(config)#int f0/0

roa(config-if)#no shut

roa(config-if)#int f0/0.1

roa(config-subif.1)#encapsulation dot1q 1

roa(config-subif.1)#ip address 10.65.1.2 255.255.0.0

roa(config-subif.1)#int f0/0.2

roa(config-subif.2)#encapsulation dot1q 2

roa(config-subif.2)#ip address 10.66.1.2 255.255.0.0

roa(config-subif.2)#exit

roa(config)#ip routing

roa#sh run

3. 测试可通性

[root#PCA root]# ping 10.66.1.1 (通)

[root#PCA root]# ping 10.66.1.2 (通)

[root#PCB root]# ping 10.65.1.1 (通)

[root#PCB root]# ping 10.65.1.2 (通)

如果去掉交换机与路由的连线,PCA和PCB还可以通吗?可见这也是一种单臂路由。

实验八

实验八静态路由

先实验有两个路由器,两个计算机的情况。

1. 设置计算机和路由器的IP地址

设置PCA、PCB的IP地址分别为:10.65.1.1和10.71.1.1。

[root#PCA root]# ifconfig eth0 10.65.1.1 netmask 255.255.0.0

[root#PCB root]# ifconfig eth0 10.71.1.1 netmask 255.255.0.0

[root#PCA root]# route add default gw 10.65.1.2

[root#PCA root]# route add default gw 10.71.1.2

规划路由器IP地址为:

RouterA f0/0: 10.65.1.2 --->接PCA: 10.65.1.1 (箭头表示连接)

RouterA f0/1: 10.66.1.2

RouterA s0/0: 10.67.1.2

RouterA s0/1: 10.68.1.2 ---> (RouterA s0/1接RouterB s0/0)

RouterB s0/0: 10.68.1.1 <---

RouterB s0/1: 10.69.1.2

RouterB f0/0: 10.70.1.2

RouterB f0/1: 10.71.1.2 --->接PCB: 10.71.1.1

2.设置路由器的静态路由:

路由器的IP地址和接口激活的设置请参与上边的有关操作,并正确设置路由器各接口如上所示的IP地址。下面设置静态路由:

RouterA#show ip route

设置路由器的IP地址(略)

RouterA#show ip route

RouterA(config)#ip route 10.71.0.0 255.255.0.0 10.68.1.1

RouterA(config)#ip routing

RouterA#show ip route

可以简写为:sh ip ro,这是一个很常用的命令,它可以看到直联网络,静态路

由和动态路由情况。

从PCA ping PCB :

[root@PCA root]# ping 10.71.1.1 (通)

从PCA ping RouterB f0/0:

[root@PCA root]# ping 10.70.1.2 (不通)

再设置一条静态路由:

RouterA(config)#ip route 10.70.0.0 255.255.0.0 10.68.1.1

RouterA(config)#end;

RouterA#show ip route

华三华为交换机路由器配置常用命令汇总定稿版

华三华为交换机路由器 配置常用命令汇总 HUA system office room 【HUA16H-TTMS2A-HUAS8Q8-HUAH1688】

H3C交换机配置命令大全1、system-view 进入系统视图模式 2、sysname 为设备命名 3、display current-configuration 当前配置情况 4、 language-mode Chinese|English 中英文切换 5、interface Ethernet 1/0/1 进入以太网端口视图 6、 port link-type Access|Trunk|Hybrid 设置端口访问模式 7、 undo shutdown 打开以太网端口 8、 shutdown 关闭以太网端口

9、 quit 退出当前视图模式 10、 vlan 10 创建VLAN 10并进入VLAN 10的视图模式 11、 port access vlan 10 在端口模式下将当前端口加入到vlan 10中 12、port E1/0/2 to E1/0/5 在VLAN模式下将指定端口加入到当前vlan中 13、port trunk permit vlan all 允许所有的vlan通过 H3C路由器配置命令大全华为交换机常用配置实例 H3C交换机路由器telnet和console口登录配置 2009年11月09日星期一 10:00

级别说明 Level 名称 命令 参观 ping、tracert、telnet 1 监控 display、debugging 2 配置 所有配置命令(管理级的命令除外)

华为交换机路由器常用命令

华为交换机路由器常用命令

华为交换机路由器常用命令 网络技术/wangzhijun1743 发表于2007-03-24, 12:25 交换机命令 [Quidway]dis cur ;显示当前配置 [Quidway]display current-configuration ;显示当前配置[Quidway]display interfaces ;显示接口信息[Quidway]display vlan all ;显示路由信息 [Quidway]display version ;显示版本信息[Quidway]super password ;修改特权用户密码[Quidway]sysname ;交换机命名 [Quidway]interface ethernet 0/1 ;进入接口视图[Quidway]interface vlan x ;进入接口视图 [Quidway-Vlan-interfacex]ip address 10.65.1.1 255.255.0.0 ;配置VLAN的I P地址 [Quidway]ip route-static 0.0.0.0 0.0.0.0 10.65.1.2 ;静态路由=网关[Quidway]rip ;三层交换支持 [Quidway]local-user ftp [Quidway]user-interface vty 0 4 ;进入虚拟终端 [S3026-ui-vty0-4]authentication-mode password ;设置口令模式 [S3026-ui-vty0-4]set authentication-mode password simple 222 ;设置口令[S3026-ui-vty0-4]user privilege level 3 ;用户级别 [Quidway]interface ethernet 0/1 ;进入端口模式[Quidway]int e0/1 ;进入端口模式 [Quidway-Ethernet0/1]duplex {half|full|auto} ;配置端口工作状态[Quidway-Ethernet0/1]speed {10|100|auto} ;配置端口工作速率[Quidway-Ethernet0/1]flow-control ;配置端口流控 [Quidway-Ethernet0/1]mdi {across|auto|normal} ;配置端口平接扭接[Quidway-Ethernet0/1]port link-type {trunk|access|hybrid} ;设置端口工作模式 [Quidway-Ethernet0/1]port access vlan 3 ;当前端口加入到VLA N [Quidway-Ethernet0/2]port trunk permit vlan {ID|All} ;设trunk允许的VLAN [Quidway-Ethernet0/3]port trunk pvid vlan 3 ;设置trunk端口的P VID [Quidway-Ethernet0/1]undo shutdown ;激活端口 [Quidway-Ethernet0/1]shutdown ;关闭端口 [Quidway-Ethernet0/1]quit ;返回 [Quidway]vlan 3 ;创建VLAN [Quidway-vlan3]port ethernet 0/1 ;在VLAN中增加端口 [Quidway-vlan3]port e0/1 ;简写方式

华为路由器交换机配置命令大全

华为华为路由器交换机配置命令大全一、计算机命令 PCAlogin:root;使用root用户 password:linux;口令是linux #shutdown-hnow;关机 #init 0;关机 #logout;用户注销 #login;用户登录 #ifconfig;显示IP地址 #ifconfig eth0 netmask;设置IP地址 #ifconfig eht0 netmask down;禁用IP地址 #route add 0.0.0.0 gw;设置网关 #route del 0.0.0.0 gw;删除网关 #route add default gw;设置网关 #route del default gw;删除网关 #route;显示网关 #ping;发ECHO包 #telnet;远程登录 二、华为路由器交换机配置命令:交换机命令 [Quidway]dis cur;显示当前配置 [Quidway]display current-configuration;显示当前配置 [Quidway]display interfaces;显示接口信息 [Quidway]display vlan;显示vlan信息 [Quidway]display version;显示版本信息 [Quidway]super password;修改特权用户密码 [Quidway]sysname;交换机命名 [Quidway]interface ethernet0/1;进入接口视图 [Quidway]interface vlan x;进入接口视图 [Quidway-Vlan-interfacex]ip address 10.65.1.1 255.255.0.0;配置VLAN的IP地址[Quidway]Ip route-static 0.0.0.0 0.0.0.0 10.65.1.2;静态路由=网关[Quidway]rip; rip协议 [Quidway]local-user ftp [Quidway]user-interface vty 0 4;进入虚拟终端 [S3026-ui-vty0-4]authentication-mode password;设置口令模式 [S3026-ui-vty0-4]set authentication-mode password simple 222;设置口令 [S3026-ui-vty0-4]user privilege level 3;用户级别 [Quidway]interface ethernet0/1;进入端口模式 [Quidway]int e0/1;进入端口模式 [Quidway-Ethernet0/1]duplex{half|full|auto};配置端口工作状态

路由器配置常用命令汇总

Access-enable允许路由器在动态访问列表中创建临时访问列表入口 Access-group把访问控制列表(ACL)应用到接口上 Access-list定义一个标准的IP ACL Access-template在连接的路由器上手动替换临时访问列表入口 Appn向APPN子系统发送命令 Atmsig执行ATM信令命令 B 手动引导操作系统 Bandwidth 设置接口的带宽 Banner motd 指定日期信息标语 Bfe 设置突发事件手册模式 Boot system 指定路由器启动时加载的系统映像 Calendar 设置硬件日历 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 断开已建立的连接

交换机和路由器的基本配置

实验一交换机和路由器的基本配置 交换机的基本配置 【实验名称】 交换机的基本配置。 【实验目的】 掌握交换机命令行各种操作模式的区别,能够使用各种帮助信息,以及用命令进行基本的配置。 【背景描述】 你是某公司新进的网管,公司要求你熟悉网络产品,公司采用全系列锐捷网络产品,首先要求你登录交换机,了解、掌握交换机的命令行操作技巧,以及如何使用一些基本命令进行配置。 【需求分析】 需要在交换机上熟悉各种不同的配置模式以及如何在配置模式间切换,使用命令进行基本的配置,并熟悉命令行界面的操作技巧。 【实验拓扑】 图1-1 实验拓扑图 【实验设备】 三层交换机1台 【预备知识】 交换机的命令行界面和基本操作 【实验原理】 交换机的管理方式基本分为两种:带内管理和带外管理。通过交换机的Console口管理交换机属于带外管理,不占用交换机的网络接口,其特点是需要使用配置线缆,近距离配置。第一次配置交换机时必须利用Console端口进行配置。 交换机的命令行操作模式,主要包括:用户模式、特权模式、全局配置模式、端口模式等几种。 ???用户模式进入交换机后得到的第一个操作模式,该模式下可以简单查看交换机的软、硬件版本信息,并进行简单的测试。用户模式提示符为switch> ???特权模式由用户模式进入的下一级模式,该模式下可以对交换机的配置文件进行管理,查看交换机的配置信息,进行网络的测试和调试等。特权模式提示符为switch# ???全局配置模式属于特权模式的下一级模式,该模式下可以配置交换机的全局性参数(如主机名、登录信息等)。在该模式下可以进入下一级的配置模式,对交换机具体的功能进行配置。全局模式提示符为switch(config)# ???端口模式属于全局模式的下一级模式,该模式下可以对交换机的端口进行参数配置。端口模式提示符为switch(config-if)# 交换机的基本操作命令包括:

华为企业级路由器配置命令大全

华为华为路由器交换机配置命令大全 一、计算机命令 PCAlogin:root;使用root用户 password:linux;口令是linux #shutdown-hnow;关机 #init 0;关机 #logout;用户注销 #login;用户登录 #ifconfig;显示IP地址 #ifconfig eth0 netmask;设置IP地址 #ifconfig eht0 netmask down;禁用IP地址 #route add 0.0.0.0 gw;设置网关 #route del 0.0.0.0 gw;删除网关 #route add default gw;设置网关 #route del default gw;删除网关 #route;显示网关 #ping;发ECHO包 #telnet;远程登录 二、华为路由器交换机配置命令:交换机命令 [Quidway]dis cur;显示当前配置 [Quidway]display current-configuration;显示当前配置 [Quidway]display interfaces;显示接口信息 [Quidway]display vlan;显示vlan信息 [Quidway]display version;显示版本信息 [Quidway]super password;修改特权用户密码 [Quidway]sysname;交换机命名 [Quidway]interface ethernet0/1;进入接口视图 [Quidway]interface vlan x;进入接口视图 [Quidway-Vlan-interfacex]ip address 10.65.1.1 255.255.0.0;配置VLAN的IP地址[Quidway]Ip route-static 0.0.0.0 0.0.0.0 10.65.1.2;静态路由=网关[Quidway]rip; rip协议 [Quidway]local-user ftp [Quidway]user-interface vty 0 4;进入虚拟终端 [S3026-ui-vty0-4]authentication-mode password;设置口令模式 [S3026-ui-vty0-4]set authentication-mode password simple 222;设置口令 [S3026-ui-vty0-4]user privilege level 3;用户级别 [Quidway]interface ethernet0/1;进入端口模式 [Quidway]int e0/1;进入端口模式 [Quidway-Ethernet0/1]duplex{half|full|auto};配置端口工作状态 [Quidway-Ethernet0/1]speed{10|100|auto};配置端口工作速率 [Quidway-Ethernet0/1]flow-control;配置端口流控

路由器常用配置命令

Cisco常用配置命令Cisco常用配置命令 一.交换机的基本配置 C2950# config terminal 进入全局配置模式 show interface fastethernet0/1 查看端口0/1的配置结果 show interface fastethernet0/1 status 查看端口0/1的状态 show mac-address-table 查看整个MAC地址表 clear mac-address-table restricted static 清除限定性地址 C2950(config)# hostname 2950A / 设置主机名为2950A interface f0/23 / 进入端口23的配置模式 enable password cisco / 设置enable password为cisco enable secret cisco1 / 设置enable secret为cisco1 ip address 192.168.1.1 255.255.255.0 / 设置交换机IP 地址 ip default-gateway 192.168.1.254 / 设置默认网关 ip domain-name https://www.doczj.com/doc/5015425280.html, / 设置域名 ip name-server 200.0.0.1 / 设置域名服务器 配置查看MAC地址表 mac-address-table ? mac-address-table aging-time 100 / 设置超时是时间为100s mac-address-table permanent https://www.doczj.com/doc/5015425280.html, /f0/3 加入永久地址mac-address-table restricted static 0000.0c02.bbcc / f0/6 f0/7 加入静态地址 end show mac-address-table /查看整个Mac地址表 clear mac-address-table restricted static C2950(config-if)# interface fastethernet0/1 /进入接口F0/1子配置模式 interface Ethernet0 /进入以太网口0子配置模式 no shutdown /激活接口 speed ? /查看speed命令的子命令 speed 100 /设置该端口速率为100Mb/s dulplex full/half/auto /设置该端口为全双工 description TO_PC1 /设置该端口描述为TO_PC1 show interface fastethernet 0/1 /查看端口0/1的配置结果 show interface fastethernet 0/1 status /查看端口0/1的状态 配置VTP和STP 一. 配置VTP 2950A #vlan database /进入VLAN配置子模式 show vtp status /查看VTP设置信息 show vlan /查看VLAN配置信息 copy running-config startup-config /保存配置文件 2950A(vlan)#vtp server/client /设置本交换机为server/client模式

最全华为路由器交换机配置命令大合集

?全面分析路由交换机配置实例应用 了解一些关于路由交换机配置的知识还是非常有用的,这里我们主要介绍路由交换机配置实例应用,在局域网中,通过路由交换机配置VLAN可以减少主机通信广播域的范围。 当VLAN之间有部分主机需要通信,但交换机不支持三层交换时,可以采用一台支持802.1Q的路由交换机配置实现VLAN的互通.这需要在以太口上建立子接口,分配IP地址作为该VLAN的网关,同时启动802.1Q。组网:路由器E0端口与交换机的上行trunk端口(第24端口)相连,交换机下行口划分3个VLAN,带若干主机。拓扑图如下: 1.路由交换机配置 1.[Router] 2.[Router]inter e0 3.[Router-Ethernet0]ip add 4.[Router-Ethernet0]inter e0.1 //定义子接口E0.1 5.[Router-Ethernet0.1]ip add 6.[Router-Ethernet0.1]vlan-type dot1q vid 1 //指定以太网子接口属于VLAN1, 此命令应用在以太网子接口上。 7.[Router-Ethernet0.1]inter e0.2 //定义子接口E0.2 8.[Router-Ethernet0.2]ip add 9.[Router-Ethernet0.2]vlan-type dot1q vid 2 //指定以太网子接口属于VLAN2 10.[Router-Ethernet0.2]inter e0.3 //定义子接口E0.3 11.[Router-Ethernet0.3]ip add 12.[Router-Ethernet0.3]vlan-type dot1q vid 3 //指定以太网子接口属于VLAN3 13.[Router-Ethernet0.3]inter e0 14.[Router-Ethernet0]undo shut 15.% Interface Ethernet0 is up 16.[Router-Ethernet0] //用网线将E0端口连到S3026第24端口 17.%19:46:32: Interface Ethernet0 changed state to UP 18.%19:46:32: Line protocol ip on interface Ethernet0, changed state to UP 19.%19:46:32: Line protocol ip on interface Ethernet0.1, changed state to UP 20.%19:46:32: Line protocol ip on interface Ethernet0.2, changed state to UP

路由器常用命令

cisco路由器常用命令 1:三大模式 router> 用户模式 router > enable 进入特权模式 router # router > enable 进入全局配置模式 router #configure terminal router (conf)# 2:其它模式 Router(config)#interface f1/0 进入接口配置模式Router(config-if)# Router(config)#interface f1/0.1 进入子接口配置模式Router(config-subif)# Router(config)#line console 0 进入line模式Router(config-line)# Router(config)#router rip 进入路由模式Router(config-router)# 3:路由器命名 hostname routera,以routerA为例 router > enable router #configure terminal router(conf)#hostname routerA routera (conf)# 4:配置各类密码 配置特权模式密码(使能口令) enable password cisco,以cisco为例 router > enable router #configure terminal router(conf)#hostname routerA routerA (conf)# enable password cisco 设置VTY(虚拟终端接口)密码 Router(config)#line vty 0 1

思科交换机路由器命令大全

思科交换机路由器命令 大全 YUKI was compiled on the morning of December 16, 2020

1. 交换机支持的命令:交换机基本状态: 交换机口令设置: 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 ;设置登录口令 xxswitch#exit ;返回命令 交换机VLAN设置:

switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端 口1switch(config-if)#switchport access vlan 2 ; 当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为干线switch(config- if)#switchport trunk allowed vlan 1,2 ;设置允许 的vlanswitch(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地址: 交换机显示命令:

交换机路由器基本命令

准备工作: 1)SecureCRT 软件(推荐使用8.0注册机版) 2)console线一条,RS232转USB线一条(淘宝购买) RS232转USB线插在电脑上,打开设备管理(快捷键devmgmt.msc),就会有提示,用360驱动(或其他驱动软件)打上即可。 下图为驱动安装成功后的设备管理器界面(本人电脑系统为win10)。 注意:com口与电脑上USB口是对应的,接在另一个USB口,com口的序号会变化。 file:///C:/Users/Potter/AppData/Local/Temp/msohtmlclip1/01/clip_imag e002.jpg 3)电脑一台 4)网络基础知识(OSI,IP,路由交换基础等) 5)登陆设备( CLI命令行) 设备-----Console—RS232-USB---电脑,打开SecureCRT软件 file:///C:/Users/Potter/AppData/Local/Temp/msohtmlclip1/01/clip_imag e004.jpg 一,锐捷交换机( 和cisco命令类似) 1,设备登陆 Web登陆:192.168.1.1 admin/admin Console密码:默认为空,如果不行试试ruijie / admin 2,系统基本配置

enable //进入用户模式,华为H3C无对应命令clockset 10:00:00 3 17 2017 //clock set 小时:分:秒月日年! config //进入全局模式,对应华为H3C的sys hostname xx //修改设备名称 ! 3,配置vlan ! config //进入全局模式 vlan 10 name xxx //创建一个vlan,并命名 vlan 20 name xxx exit ! no vlan 10 //删除一个vlan ! int range gi 0/2-4 sw mo ac //配置多个接口为access模式 sw ac vl 10 //配置多个接口加入vlan10 exit

最全华为路由器交换机配置命令大合集

全面分析路由交换机配置实例应用 也许很多人对路由交换机配置还不是特别的了解,没有关系,下面我们主要针对路由交换及,详细的分析其配置应用,希望对您有所帮助。 了解一些关于路由交换机配置的知识还是非常有用的,这里我们主要介绍路由交换机配置实例应用,在局域网中,通过路由交换机配置VLAN可以减少主机通信广播域的范围。 当VLAN之间有部分主机需要通信,但交换机不支持三层交换时,可以采用一台支持802.1Q的路由交换机配置实现VLAN的互通.这需要在以太口上建立子接口,分配IP地址作为该VLAN的网关,同时启动802.1Q。组网:路由器E0端口与交换机的上行trunk端口(第24端口)相连,交换机下行口划分3个VLAN,带若干主机。拓扑图如下: 1.路由交换机配置 1.[Router] 2.[Router]inter e0 3.[Router-Ethernet0]ip add 4.[Router-Ethernet0]inter e0.1 //定义子接口E0.1 5.[Router-Ethernet0.1]ip add 6.[Router-Ethernet0.1]vlan-type dot1q vid 1 //指定以太网子接口属于VLAN1, 此命令应用在以太网子接口上。 7.[Router-Ethernet0.1]inter e0.2 //定义子接口E0.2 8.[Router-Ethernet0.2]ip add 9.[Router-Ethernet0.2]vlan-type dot1q vid 2 //指定以太网子接口属于VLAN2 10.[Router-Ethernet0.2]inter e0.3 //定义子接口E0.3 11.[Router-Ethernet0.3]ip add 12.[Router-Ethernet0.3]vlan-type dot1q vid 3 //指定以太网子接口属于VLAN3 13.[Router-Ethernet0.3]inter e0 14.[Router-Ethernet0]undo shut 15.% Interface Ethernet0 is up 16.[Router-Ethernet0] //用网线将E0端口连到S3026第24端口 17.%19:46:32: Interface Ethernet0 changed state to UP 18.%19:46:32: Line protocol ip on interface Ethernet0, changed state to UP 19.%19:46:32: Line protocol ip on interface Ethernet0.1, changed state to UP 20.%19:46:32: Line protocol ip on interface Ethernet0.2, changed state to UP

华三华为交换机-路由器配置常用命令汇总

欢迎阅读H3C交换机配置命令大全 1、system-view 进入系统视图模式 2、sysname 为设备命名 3、display current-configuration 当前配置情况 4、language-mode Chinese|English 中英文切换 5、interface Ethernet 1/0/1 进入以太网端口视图 6、port link-type Access|Trunk|Hybrid 设置端口访问模式 7、undo shutdown 打开以太网端口 8、shutdown 关闭以太网端口 9、quit 退出当前视图模式 10、vlan 10 创建VLAN 10并进入VLAN 10的视图模式 11、port access vlan 10 在端口模式下将当前端口加入到vlan 10中 12、port E1/0/2 to E1/0/5 在VLAN模式下将指定端口加入到当前vlan中 13、port trunk permit vlan all 允许所有的vlan通过 H3C路由器配置命令大全华为交换机常用配置实例 H3C交换机路由器telnet和console口登录配置 2009年11月09日星期一 10:00 级别说明 Level 名称 命令 参观 ping、tracert、telnet 1 监控 display、debugging

2 配置 所有配置命令(管理级的命令除外) 3 管理 文件系统命令、FTP命令、TFTP命令、XMODEM命令 telnet仅用密码登录,管理员权限 [Router]user-interface vty 0 4[Router-ui-vty0-4]user privilege level 3[Router-ui-vty0-4]set authentication password simple abc telnet仅用密码登录,非管理员权限 [Router]super password level 3 simple super [Router]user-interface vty 0 4[Router-ui-vty0-4]user privilege level 1[Router-ui-vty0-4]set authentication password simple abc telnet使用路由器上配置的用户名密码登录,管理员权限 [Router]local-user admin password simple admin[Router]local-user admin service-type telnet[Router]local-user admin level 3 [Router]user-interface vty 0 4[Router-ui-vty0-4]authentication-mode local telnet使用路由器上配置的用户名密码登录,非管理员权限 [Router]super password level 3 simple super [Router]local-user manage password simple manage[Router]local-user manage service-type telnet[Router]local-user manage level 2 [Router]user-interface vty 0 4[Router-ui-vty0-4]authentication-mode local 对console口设置密码,登录后使用管理员权限 [Router]user-interface con 0[Router-ui-console0]user privilege level 3[Router-ui-console0]set authentication password simple abc 对console口设置密码,登录后使用非管理员权限 [Router]super password level 3 simple super [Router]user-interface con 0[Router-ui-console0]user privilege level 1[Router-ui-console0]set authentication password simple abc 对console口设置用户名和密码,登录后使用管理员权限 [Router]local-user admin password simple admin[Router]local-user admin service-type terminal[Router]local-user admin level 3 [Router]user-interface con 0[Router-ui-console0]authentication-mode local 对console口设置用户名和密码,登录后使用非管理员权限 [Router]super password level 3 simple super [Router]local-user manage password simple manage[Router]local-user

了解华为路由器交换机配置命令大全.doc

了解华为路由器交换机配置命令大全 欢迎来到学习啦,本文为大家提供了解华为路由器交换机配置命令大全,欢迎大家阅读学习。 为华路由器为面向运营商数据通信网络的高端路由器产品,覆盖骨干网、城域网的P/PE位置,帮助运营商应对网络带宽快速增长的压力。支持RIP、OSPF、BGP、IS-IS等单播路由协议和IGMP、PIM、MBGP、MSDP等多播路由协议,支持路由策略以及策略路由。 史上最全华为路由器交换机配置命令大合集,熟练掌握下面的华为路由器交换机配置知识点,你只需花几分钟的时间就能明白华为路由器交换机配置。交换机的配置命令等等。 华为路由器交换机配置命令:计算机命令 PCAlogin:root;使用root用户 password:linux;口令是linux #shutdown-hnow;关机 #init0;关机 #logout;用户注销 #login;用户登录 #ifconfig;显示IP地址 #ifconfigeth0netmask;设置IP地址 #ifconfigeht0netmaskdown;禁用IP地址 #routeadd0.0.0.0gw;设置网关 #routedel0.0.0.0gw;删除网关

#routeadddefaultgw;设置网关 #routedeldefaultgw;删除网关 #route;显示网关 #ping;发ECHO包 #telnet;远程登录 华为路由器交换机配置命令:交换机命令 [Quidway]discur;显示当前配置 [Quidway]displaycurrent-configuration;显示当前配置 [Quidway]displayinterfaces;显示接口信息 [Quidway]displayvlanall;显示路由信息 [Quidway]displayversion;显示版本信息 [Quidway]superpassword;修改特权用户密码 [Quidway]sysname;交换机命名 [Quidway]interfaceethernet0/1;进入接口视图 [Quidway]interfacevlanx;进入接口视图 [Quidway-Vlan-interfacex]ipaddress10.65.1.1255.255.0.0;配置VLAN的IP地址 [Quidway]iproute-static0.0.0.00.0.0.010.65.1.2;静态路由=网关 [Quidway]rip;三层交换支持 [Quidway]local-userftp [Quidway]user-interfacevty04;进入虚拟终端

华三华为交换机-路由器配置常用命令汇总

H3C交换机配置命令大全 1、system-view 进入系统视图模式 2、sysname 为设备命名 3、display current-configuration 当前配置情况 4、language-mode Chinese|English 中英文切换 5、interface Ethernet 1/0/1 进入以太网端口视图 6、port link-type Access|Trunk|Hybrid 设置端口访问模式 7、undo shutdown 打开以太网端口 8、shutdown 关闭以太网端口 9、quit 退出当前视图模式 10、vlan 10 创建VLAN 10并进入VLAN 10的视图模式 11、port access vlan 10 在端口模式下将当前端口加入到vlan 10中 12、port E1/0/2 to E1/0/5 在VLAN模式下将指定端口加入到当前vlan中 13、port trunk permit vlan all 允许所有的vlan通过 H3C路由器配置命令大全 1、system-view 进入系统视图模式 2、sysname R1 为设备命名为R1 3、display ip routing-table 显示当前路由表 4、language-mode Chinese|English 中英文切换 5、interface Ethernet 0/0 进入以太网端口视图 6、ip address 192.168.1.1 255.255.255.0 配置IP地址和子网掩码 7、undo shutdown 打开以太网端口 8、shutdown 关闭以太网端口

锐捷交换机、路由器常用命令

锐捷交换机、路由器常用命令EXEC模式: 用户模式switch> 交换机信息的查看,简单测试命令 特权模式switch# 查看、管理交换机配置信息,测试、调试 配置模式: 全局配置模式switch(config)# 配置交换机的整体参数 接口配置模式switch(config-if)# 配置交换机的接口参数 进入全局配置模式 Switch#c onfigure terminal Switch(config)#exit Switch# 进入接口配置模式 Switch(config)#interface fastethernet 0/1 Switch(config-if)#exit Switch(config)# 从子模式下直接返回特权模式 Switch(config-if)#end

Switch# 命令行其他功能 获得帮助 switch#? switch#show ? 命令简写 全写:switch# configure terminal 简写:Switch# config 使用历史命令 Switch# (向上键) Switch# (向下键) 配置交换机Telnet功能 配置远程登陆密码 Switch(config)#enable secret level 1 0 ruijie 配置进入特权模式密码 Switch (config)#enable secret level 15 0 ruijie

为交换机配置管理IP Switch (config)#interface vlan 1 Switch (config-if)#no shutdown Switch (config-if)#ip address 192.168.1.1 255.255.255.0 Switch (config-if)#end 配置文件的管理 保存配置 将当前运行的参数保存到flash 中用于系统初始化时初始化参数 Switch#copy running-config startup-config Switch#write memory Switch#write 删除配置 永久性的删除flash 中不需要的文件 使用命令delete flash:config.text 删除当前的配置:在配置命令前加no 例:switch(config-if)# no ip address 查看配置文件内容 Switch#show configure 查看保存在FLASH里的配置信息

相关主题
文本预览
相关文档 最新文档