交换机配置命令模式

交换机配置命令模式
交换机配置命令模式

交换机配置命令模式

EXEC模式:

用户模式switch>

交换机信息的查看,简单测试命令

特权模式switch#

查看、管理交换机配置信息,测试、调试

配置模式:

全局配置模式switch(config)#

配置交换机的整体参数

接口配置模式switch(config-if)#

配置交换机的接口参数

进入全局配置模式

Switch#configure 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里的配置信息

Switch#show running-config 查看RAM

里当前生效的配置

配置Port VLAN

创建VLAN10,将它命名为test的例子Switch# configure terminal

Switch(config)# vlan 10

Switch(config-vlan)# name test

Switch(config-vlan)# end

把接口0/10加入VLAN10

Switch# configure terminal Switch(config)# interface fastethernet 0/10 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan

10

Switch(config-if)# end

将一组接口加入某一个VLAN Switch(config)#interface range

fastethernet 0/1-8,0/15,0/20 Switch(config-if-range)# switchport access

vlan 20

注:连续接口0/1-8,不连续接口用逗号隔开,但一定要写明模块编号

配置Tag VLAN-Trunk

把Fa0/1配成Trunk口

Switch# configure terminal Switch(config)# interface fastethernet0/1 Switch(config-if)# switchport mode trunk 把端口Fa0/20 配置为Trunk端口,但是不

包含VLAN 2:

Switch(config)# interface fastethernet 0/20 Switch(config-if)# switchport trunk allowed

vlan remove 2

Switch(config-if)# end

Native VLAN

配置命令:

Switch(config-if)# switchport trunk native

vlan 20

Switch(config-if)# end

注意:

每个Trunk口的缺省native VLAN是VLAN

1

在配置Trunk链路时,请确保连接链路两端的Trunk口属于相同的native VLAN

保存/清除VLAN信息

将VLAN信息保存到flash中

Switch#write memory

从flash中只清除VLAN信息

Switch#delete flash:vlan.dat

从RAM中删除VLAN

Switch(config)#no vlan VLAN-id

生成树协议的配置

开启生成树协议

Switch(config)#Spanning-tree

关闭生成树协议

Switch(config)#no Spanning-tree

配置生成树协议的类型

Switch(config)#Spanning-tree mode

stp/rstp

锐捷全系列交换机默认使用MSTP协议

配置交换机优先级

Switch(config)#spanning-tree priority

<0-61440>

(“0”或“4096”的倍数、共16个、缺省

32768)

恢复到缺省值

Switch(config)# no spanning-tree priority 配置交换机端口的优先级

Switch(config)#interface

interface-type interface-number

Switch(config-if)#spanning-tree

port-priority number

配置STP、RSTP

Spanning Tree 的缺省配置:

关闭STP

STP Priority 是32768

STP port Priority 是128

STP port cost 根据端口速率自动判断

Hello Time 2秒

Forward-delay Time 15秒

Max-age Time 20秒

可通过spanning-tree reset 命令让

spanning tree参数恢复到缺省配置

查看生成树协议配置

显示生成树状态

Switch#show spanning-tree

显示端口生成树协议的状态

Switch#show spanning-tree interface

fastethernet <0-2/1-24>

配置aggregate port

将该接口加入一个AP

Switch#configure terminal

Switch(config) # interface interface-type

interface-id

Switch(config-if-range)#port-group

port-group-number

如果这个AP不存在,可自动创建AG端口

查看聚合端口的汇总信息

Switch#show aggregateport summary 查看聚合端口的流量平衡方式Switch#show aggregateport load-balance

路由器上配置telnet

第一步: 配置端口地址

RouterA# configure terminal !进入全

局配置模式

RouterA(config)# interface

fastethernet 1/0

!进入路由器接口配置模式

RouterA(config-if)# ip address 192.168.0.1 255.255.255.0

!配置路由器管理接口IP地址RouterA(config-if)# no shutdown !开启

路由器f 1/0接口

第二步:配置远程登录密码RouterA(config)# line vty 0 4 !

进入路由器线路配置模式RouterA(config-line)# login !

配置远程登录

RouterA(config-line)# password star !

设置路由器远程登录密码为“star”

RouterA(config-line)#end

第三步:配置路由器特权模式密码RouterA(config)# enable secret star !

设置路由器特权模式密码为“star”

或者

RouterA(config)# enable password star

查看配置文件

show version !查看版本

及引导信息

show running-config !查看运行

配置

show startup-config !查看用户保存在NVRAM中的配置文件

保存配置文件

Router#copy running-config startup-config

Router#write memory

Router#write

删除配置文件

Router#delete flash:config.text !删除初

始配置文件

查看路由信息

router#show ip route

Codes: C - connected,S – static,R –

RIP,O- OSPF

IA - OSPF inter area,E1-OSPF external

type 1

E2 - OSPF external type 2,* - candidate

default

Gateway of last resort is 10.5.5.5 to

network 0.0.0.0

172.16.0.0/24 is subnetted, 1 subnets

C 172.16.11.0 is directly connected,

serial1/2

O E2 172.22.0.0/16 [110/20] via 10.3.3.3,

01:03:01, Serial1/2

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

静态路由配置命令

配置静态路由用命令ip route router(config)#ip route [网络编号] [子网掩码] [转发路由器的IP地址/本地接口]

例:ip route 192.168.10.0

255.255.255.0 serial 1/2

例:ip route 192.168.10.0 255.255.255.0

172.16.2.1

静态路由描述转发路径的方式有两种

指向本地接口(即从本地某接口发出)

指向下一跳路由器直连接口的IP地址(即将数据包交给X.X.X.X)

配置默认路由:

router(config)#ip route 0.0.0.0 0.0.0.0 [转发路由器的IP地址/本地接口]

RIP路由协议的版本

RIPv1

有类路由协议,不支持VLSM

以广播的形式发送更新报文

不支持认证

RIPv2

无类路由协议,支持VLSM

以组播的形式发送更新报文

支持明文和MD5的认证

配置RIP协议

配置步骤

1、开启RIP路由协议进程

Router(config)#router rip

2、申请本路由器参与RIP协议的直连网段

信息

Router(config-router)#network

192.168.1.0

3、指定RIP协议的版本2(默认是version1)

Router(config-router)#version 2

4、在RIPv2版本中关闭自动汇总Router(config-router)#no auto-summary

查看RIP配置信息

验证RIP的配置

Router#show ip protocols

显示路由表的信息

Router#show ip route

清除IP路由表的信息

Router#clear ip route

在控制台显示RIP的工作状态

Router#debug ip rip

OSPF协议

OSPF配置如下:

1、创建loopback接口,定义ROUTE ID routerA(config)#interface loopback 10 routerA(config)#ip address 192.168.100.1

255.255.255.0

2、开启OSPF进程

routerA(config)#router ospf 10

10代表进程编号,只具有本地意义

3、申请直连网段

routerA(config-router)#network 10.1.1.0

0.0.0.255 area 0

注意反掩码和区域号

查看OSPF配置信息

验证OSPF的配置

Router#show ip ospf

显示路由表的信息

Router#show ip route

清除IP路由表的信息

Router#clear ip route

在控制台显示OSPF的工作状态

Router#debug ip ospf

三层交换的路由功能

三层交换机默认开启路由功能Switch(config)#ip routing (开启三层交换

机路由功能)

三层交换机配置路由接口的两种方法

开启三层交换机物理接口的路由功能Switch(config)#interface fastethernet 0/5 Switch(config-if)#no switchport Switch(config-if)#ip address 192.168.1.1

255.255.255.0

Switch(config-if)#no shutdown

关闭物理接口路由功能

Switch(config-if)# switchport

采用SVI方式(switch virtual interface)Switch(config)#interface vlan 10

Switch(config-if)#ip address

192.168.1.1.255 255.255.0

Switch(config-if)#no shutdown

三层交换机和路由器相连的网络

方法一(SVI):

Switch(config)#interface f0/10 Switch(config-if)#switchport access vlan

10

Switch(config-if)#exit

Switch(config)#interface vlan 10 switch(config-if)#ip address 192.168.10.1

255.255.255.0

Switch(config-if)#no shutdown

方法二(路由接口):

Switch(config)#interface f0/10

Switch(config-if)#no switchport Switch(config-if)#ip address 192.168.10.1

255.255.255.0

Switch(config-if)#no shutdown

三层交换机路由协议的配置

静态路由

Switch(config)#ip route x.x.x.x x.x.x.x

[x.x.x.x/interface]

RIP

Switch(config)#router rip

Switch(config-router)#network X.X.X.X

Switch(config-router)#version 2

注:三层交换机不支持no auto-summary

OSPF

Switch(config)#router ospf Switch(config)#network X.X.X.X X.X.X.X

area x

查看三层交换机路由配置

查看路由接口信息

Switch#show ip interface

查看路由表

Switch#show ip route

查看动态路由协议

Switch#show ip rip

Switch#show ip ospf

PPP的配置

路由器上的配置

RA(config)#interface seriel 1/2

RA(config-if)# encapsulation ppp 注:路由器广域网默认封装方式为HDLC

PAP验证的配置

客户端(被验证方)

RA(config)#interface seril 0

RA(config-if)# encapsulation ppp

RA(config-if)#ppp pap sent-username

ruijie password 123

服务端(验证方)

RB(config)#username ruijie password 123 RB(config)#interface seril 0

RB(config-if)# encapsulation ppp

RB(config-if)#ppp authentication pap

CHAP认证配置

客户端(被验证方)

RA(config)#username RB password 123 RA(config)#interface serial 0

RA(config-if)#encapsulation ppp

服务端(验证方)

RB(config)#username RA password 123 RB(config)#interface serial 0

RB(config-if)#encapsulation ppp

RB(config-if)#ppp authentication chap

PPP认证的调试

特权模式下输入:

Router#show interfaces serial 1/2

Router#debug ppp authentication

交换机端口安全

安全违例产生于以下情况:

如果一个端口被配置为一个安全端口,当其安全地址的数目已经达到允许的最大个数如果该端口收到一个源地址不属于端口上

的安全地址的包

当安全违例产生时,你可以选择多种方式来

处理违例:

Protect:当安全地址个数满后,安全端口将丢弃未知名地址(不是该端口的安全地址中

的任何一个)的包

Restrict:当违例产生时,将发送一个Trap

通知

Shutdown:当违例产生时,将关闭端口并

发送一个Trap通知

配置安全端口

端口安全最大连接数配置switchport port-security !打开该接

口的端口安全功能

switchport port-security maximum

!设置接口上安全地址的最大个数,范围是1-128,缺省值为128

switchport port-security

violation{protect|restrict |shutdown}

!设置处理违例的方式

注意:

1、端口安全功能只能在access端口上进

行配置。

2、当端口因为违例而被关闭后,在全局配置模式下使用命令errdisable recovery 来将接口从错误状态中恢复过来。

端口的安全地址绑定switchport port-security !打开该接口的端口安全功能

switchport port-security mac-address mac-address ip-address ip-address !

手工配置接口上的安全地址

注意:

1、端口安全功能只能在access端口上进

行配置

2、端口的安全地址绑定方式有:单MAC、

单IP、MAC+IP

案例(一)

下面的例子是配置接口gigabitethernet1/3上的端口安全功能,设置最大地址个数为8,设置违例方式为protect

Switch# configure terminal

Switch(config)# interface gigabitethernet

1/3

Switch(config-if)# switchport mode access Switch(config-if)# switchport port-security Switch(config-if)# switchport port-security

maximum 8

Switch(config-if)# switchport port-security

violation protect

Switch(config-if)# end

案例(二)

下面的例子是配置接口fastethernet0/3上的端口安全功能,配置端口绑定地址,主机MAC为00d0.f800.073c,IP为

192.168.12.202

Switch# configure terminal Switch(config)# interface fastethernet 0/3 Switch(config-if)# switchport mode access Switch(config-if)# switchport port-security Switch(config-if)# switchport port-security mac-address 00d0.f800.073c

ip-address 192.168.12.202

Switch(config-if)# end

查看配置信息

查看所有接口的安全统计信息,包括最大安全地址数,当前安全地址数以及违例处理方

式等

Switch#show port-security

Secure Port MaxSecureAddr CurrentAddr Security Action

----------------- --------

--------- --------------

Gi1/3 8

1 Protect

查看安全地址信息

Switch# show port-security address

Vlan Mac Address IP Address Type Port Remaini

ng Age(mins)

---- ----------- ----------

------- --------- --------

1 00d0.f800.073c 192.168.12.2

02 Configured Fa0/3 8 1

IP标准访问列表的配置

1.定义标准ACL

编号的标准访问列表

Router(config)#access-list <1-99>

{permit|deny} 源地址[反掩码]

命名的标准访问列表

switch(config)# ip access-list standard <

name >

switch(config-std-nacl)#{permit|deny} 源

地址[反掩码]

2.应用ACL到接口

Router(config-if)#ip access-group <1-99>

{ in | out }

IP扩展访问列表的配置

1.定义扩展的ACL

编号的扩展ACL

Router(config)#access-list <100-199> { permit /deny } 协议源地址反掩码[源端口] 目的地址反掩码[ 目的端口]

命名的扩展ACL

ip access-list extended {name} { permit /deny } 协议源地址反掩码[源端口] 目的地址反掩码[ 目的端口]

2.应用ACL到接口

Router(config-if)#ip access-group

<100-199> { in | out }

IP扩展访问列表配置实例(一)

如何创建一条扩展ACL

该ACL有一条ACE,用于允许指定网络(192.168.x..x)的所有主机以HTTP访问服务器172.168.12.3,但拒绝其它所有主机

使用网络

Router (config)# access-list 103 permit tcp 192.168.0.0 0.0.255.255 host

172.168.12.3 eq www

Router # show access-lists 103

IP扩展访问列表配置实例(二)

access-list 115 deny udp any any eq 69 access-list 115 deny tcp any any eq

135

access-list 115 deny udp any any eq

135

access-list 115 deny udp any any eq

137

access-list 115 deny udp any any eq

138

access-list 115 deny tcp any any eq

139

access-list 115 deny udp any any eq

139

access-list 115 deny tcp any any eq

445

access-list 115 deny tcp any any eq

593

access-list 115 deny tcp any any eq

4444

access-list 115 permit ip any any

interface

ip access-group 115

in

ip access-group 115

out

利用ACL隔离冲击波病毒

访问列表的验证

显示全部的访问列表

Router#show access-lists

显示指定的访问列表

Router#show access-lists <1-199>

显示接口的访问列表应用

Router#show ip interface 接口名称接口

编号

IP访问列表配置注意事项

1、一个端口在一个方向上只能应用一组

ACL

2、锐捷全系列交换机可针对物理接口和

SVI接口应用ACL

针对物理接口,只能配置入栈应用(In) 针对SVI(虚拟VLAN)接口,可以配置入栈(In)和出栈(Out)应用

3、访问列表的缺省规则是:拒绝所有------------------------------------

----

NAT/NAPT的配置

NAT/NAPT的配置有两种

静态NAT/NAPT

动态NAT/NAPT

静态NAT/NAPT

需要向外网络提供信息服务的主机

永久的一对一IP地址映射关系

动态NAT/NAPT

只访问外网服务,不提供信息服务的主机内部主机数可以大于全局IP地址数

最多访问外网主机数决定于全局IP地址数临时的一对一IP地址映射关系

静态NAT

配置步骤

1、定义内网接口和外网接口Router(config)#interface fastethernet 1/0 Router(config-if)#ip nat outside Router(config)#interface fastethernet 1/1 Router(config-if)#ip nat inside

2、建立静态的映射关系

Router(config)#ip nat inside source static 192.168.1.7 200.8.7.3

静态NAPT

1、定义内网接口和外网接口Router(config)#interface fastethernet 0 Router(config-if)#ip nat outside Router(config)#interface fastethernet 1 Router(config-if)#ip nat inside

2、建立静态的映射关系

Router(config)#ip nat inside source static

tcp

192.168.1.7 1024 200.8.7.3 1024 Router(config)#ip nat inside source static

udp

192.168.1.7 1024 200.8.7.3 1024

动态NAT配置

1、定义内网接口和外网接口

Router(config-if)#ip nat outside

Router(config-if)#ip nat inside

2、定义内部本地地址范围

Router(config)#access-list 10 permit

192.168.1.0 0.0.0.255

3、定义内部全局地址池

Router(config)#ip nat pool abc 200.8.7.3 200.8.7.10 netmask 255.255.255.0

4、建立映射关系

Router(config)#ip nat inside source list 10

pool abc

动态NAPT配置

1、定义内网接口和外网接口

Router(config-if)#ip nat outside

Router(config-if)#ip nat inside

2、定义内部本地地址范围

Router(config)#access-list 10 permit

192.168.1.0 0.0.0.255

3、定义内部全局地址池

Router(config)#ip nat pool abc 200.8.7.3 200.8.7.3 netmask 255.255.255.0

4、建立映射关系

Router(config)#ip nat inside source list 10

pool abc overload

NAT/NAPT的监视和维护命令

显示命令

show ip nat statistics

显示翻译统计

show ip nat translations [verbose]

显示活动翻译

清除状态命令

clear ip nat translation *

从NAT转换表中清除所有动态地址转换项

交换机的配置命令

网络互连设备 1、交换机基本配置命令 (1)用户模式Switch> (2)特权模式Switch>enable Switch# (3)特权模式退回到用户模式:disable (4)下一级模式退回到上一级:exit (5)某个模式直接退回到特权模式:end (6)配置交换机名称命令hostname <交换机> (7)进入交换机端口模式命令 模式:switch(config)# 命令:interface <端口类型> <端口号> 交换机常见的端口类型:ethernet、fastethernet、gigabitethernet以及VLAN 接口等。端口号一般采用插槽号/端口号,如0/1。 (8)进入交换机的某个端口模式switch(config-if)# 显示交换机端口状态命令switch# show interface <端口类型> <端口号> (9)进入控制台线路模式模式:switch(config)# 命令:line console <编号> 参数:编号是配置口的编号,从0开始编号。结果:进入控制台模式 switch(config-line)#。 (10)配置控制台口令模式:switch(config-line)# 命令:password <密码> 参数:密码支持字母和数字。 启用密码认证模式:switch(config-line)# 命令:login (11)配置进入特权模式口令模式:switch(config)# 命令:enable password|secret <密码> 参数:password表示密码以明文形式存放,secret表示密码以密文形式存放。密码支持字母和数字。 (12)为之前设置的口令加密模式:switch(config)# 命令:service password-encryption 结果:将之前设置的所有口令加密。 (13)配置交换机的登录标语模式:switch(config)# 命令:banner motd %<标语>%参数:标语应该是警示性的文字,不识别中文。结果:下次进入某个需要输入密码的模式时将会显示该提示。 (14)禁止干扰信息模式:控制台模式命令:logging synchronous 结果:下次弹出日志信息时会强制回车。 2、交换机系统帮助命令 (1)显示系统信息命令Switch> show version (2)显示交换机当前配置命令show running-config (3)显示交换机已保存的配置命令show startup-config (4)保存现有配置命令copy running-configu startup-config (5)清除已保存的配置erase startup-config (6)了解在某模式下有哪些命令时,可以输入“?” (7)某个命令只记得一部分时,可以在记得的部分后输入“?”(无空格)(8)清楚某单词后可输入的命令时,可在此单词后输入“? ”(中间有空格)。(9)将命令补充完整。输入能唯一识别某个命令关键字的一部分后,可以按键盘上的TAB键可以将该关键字补充完整。

H3C三层交换机配置命令

H3C三层交换机配置命令 [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的IP地址 [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} ;配置端

锐捷交换机常用配置基础命令

一、交换机基本配置 1、交换机命名: 在项目实施的时候,建议为处于不同位置的交换机命名,便于记忆,可提高后期管理效率。 switch(config)#hostname ruijie //ruijie为该交换机的名字 2、交换机配置管理密码: 配置密码可以提高交换机的安全性,另外,telnet登录交换机的时候,必须要求有telnet管理密码。 switch (config)#enable secret level 1 0 rg //配置telnet管理密码为rg,其中1表示telnet密码,0表示密码不加密 switch (config)#enable secret level 15 0 rg //配置特权模式下的管理密码rg,其中15表示为特权密码3、交换机配置管理IP switch (config)#interface vlan 1 //假设管理VLAN为VLAN 1 switch (config-if)#ip address 192.168.1.1 255.255.255.0 //给管理VLAN配置管理IP地址 switch (config-if)#no shutdown //激活管理IP,养成习惯,无论配置什么设备,都使用一下这个命令 4、交换机配置网关: switch(config)#ip default-gateway 192.168.1.254 //假设网关地址为192.168.1.254,此命令用户二层设备。通过以上几个命令的配置,设备便可以实现远程管理,在项目实施时(尤其是设备位置比较分散)特别能提高效率。 二、接口介质类型配置 锐捷为了降低SME客户的总体拥有成本,推出灵活选择的端口形式:电口和光口复用接口,方便用户根据网络环境选择对应的介质类型。 但光口和电口同时只能用其一,如图1,如使用了光口1F,则电口1不能使用。 1、接口介质类型的转换: Switch(config)#interface gigabitethernet 0/25-28

实验三 交换机配置方式及基本命令的熟悉文档

实验三交换机配置方式及基本命令的熟悉 【实验目的】 通过对交换机设备的几种配置手段、配置模式和基本配置命令的认识,获得交换机的基本使用能力。 【实验任务】 1、认识交换机的配置方式。 2、按照给出的参考拓扑图构建逻辑拓扑图。 3、按照给出的配置参数表配置各个设备。 4、练习交换机的一些基本命令。 建议实验学时:2学时。 【实验背景】 在前面的实验中我们已经接触了Cisco的路由器运行的Cisco互联网络操作系统(ISO,Internetwork Operating System),熟悉了Cisco IOS软件内置的命令行界面(CLI,command-line interface)。同样,交换机可以通过一个菜单驱动程序的界面,或者通过命令行界面(CLI),或者在交换机配置了IP地址后通过Telnet远程登录、web登录的方式对交换机来进行配置。 交换机除了可以通过Console端口与计算机直接连接外,还可以通过交换机的普通端口进行连接。如果是堆叠型的,也可以把几台交换机一起进行配置,因为实际上这个时候它们是一个整体,这时通过普通端口对交换机进行管理时,就不再使用超级终端了,而是以Telnet 虚拟终端或Web浏览器的方式实现与被管理交换机的通信。前提是在本地配置方式中已为交换机配置好了IP地址,我们可通过IP地址与交换机进行通信,不过要注意,只有是网管型的交换机才具有这种管理功能。实际上最常用的Catalyst交换机OS被称为Catalyst OS、CatOS,其最大的特点是基于set 命令。但我们常用的是与路由器的IOS相类似的基于IOS 的Catalyst OS。下面简单介绍交换机的各种命令模式以及各种常用的命令。 表4.1交换机的各种命令模式的访问方式、提示符、退出方法及其描述

交换机配置命令

交换机配置命令 Prepared on 24 November 2020

配置命令 交换机之间用交叉线 1进入特权模式:Switch>enable 2配置模式 Switch#config 3配置主机名:Switch(config)#hostname S1 4.设置访问口令S1#configure terminal S1(config)#line console 0 S1(config-line)#password cisco S1(config-line)#login S1(config-line)#line vty 0 15 S1(config-line)#password cisco S1(config-line)#login S1(config-line)#exit 5.将使能加密口令设置为 class。 S1(config)#enable secret class S1(config)#配置默认网关 6.在虚拟接口vlan99设置交换机ip地址 S1(config)#interface vlan99 S1(config-if)# S1(config-if)#no shutdown S1(config-if)#exit 7.交换机 VLAN 分配端口 S1(config)#interface fa0/1 S1(config-if)#switchport mode access S1(config-if)#switchport access vlan 99 S1(config-if)#exit 8.给vlan命名 S1(config)#vlan 10 S1(config-vlan)#name Faculty/Staff .本征vlan即分配端口连接s1 使用中继vlan S1中继vlan S1(config)#interface FastEthernet 0/1 S1(config-if)#switchport mode trunk S1(config-if)#switchport trunk native vlan 99 9..设置交换机默认网关

三层交换机的配置命令

三层交换机的图,如图所示: 一.交换机的配置: S2的配置命令: Enable Conf terminal Hostname S2 Switch(config)#vlan 10 Switch(config-vlan)#name stu10 Switch(config-vlan)#vlan 20 Switch(config-vlan)#name stu20 Switch(config)#interface f0/1 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10 Switch(config)#interface f0/2 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 20 Switch(config)#inte f0/24 Switch(config-if)#switchport mode trunk

S3的配置命令: Enable Conf terminal Hostname S3 Switch(config)#vlan 10 Switch(config-vlan)#name stu10 Switch(config-vlan)#vlan 20 Switch(config-vlan)#name stu20 Switch(config)#interface f0/1 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10 Switch(config)#interface f0/2 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 20 Switch(config)#inte f0/24 Switch(config-if)#switchport mode trunk 二.三层交换机的配置命令 Enable Conf terminal Switch(config)#vlan 10 Switch(config-vlan)#vlan 20 Switch(config)#interface f0/1 Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunk Switch(config)#interface f0/2 Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunk Switch(config)#interface vlan 10 Switch(config-if)#ip address 192.168.10.254 255.255.255.0 Switch(config-if)#no shutdown

华为交换机基本配置命令29908

华为交换机基本配置命令 一、单交换机VLAN划分 命令命令解释 system 进入系统视图 system-view 进入系统视图 quit 退到系统视图 undo vlan 20 删除vlan 20 sysname 交换机命名 disp vlan 显示vlan vlan 20 创建vlan(也可进入vlan 20) port e1/0/1toe1/0/5 把端口1-5放入VLAN 20 中 5700系列 单个端口放入VLAN [Huawei]intg0/0/1 [Huawei]port link-typeaccess(注:接口类型access,hybrid、trunk) [Huawei]port default vlan 10 批量端口放入VLAN [Huawei]port-group 1 [Huawei-port-group-1]group-member ethernet G0/0/1 to ethernet G0/0/20 [Huawei-port-group-1]port hybrid untagged vlan 3 删除group(组)vlan 200内的15端口 [Huawei]intg0/0/15 [Huawei-GigabitEthernet0/0/15]undo port hybrid untagged vlan 200 通过group端口限速设置 [Huawei]Port-group 2 [Huawei]group-member g0/0/2 to g0/0/23 [Huawei]qos lr outbound cir 2000 cbs 20000 disp vlan 20 显示vlan里的端口20 int e1/0/24 进入端口24 undo port e1/0/10 表示删除当前VLAN端口10 disp curr 显示当前配置 return 返回 Save 保存 info-center source DS channel 0 log state off trap state off通过关闭日志信息命令改变DS模块来实现(关闭配置后的确认信息显示) info-center source DS channel 0 log state on trap state on 通过打开日志信息命令改变DS模块来实现(打开配置后的确认信息显示)

配置H3C交换机常用命令

H3C交换机常用步骤和命令 1.进入命令行sys 2.给交换机命名: sysname fuwuqi2 3.创建所属vlan: vlan 114 4.描述vlan 114 及分配情况: description fuwuqi2 5.把24个口划分到vlan114中: port e 1/0/1 to e 1/0/24 6.退出: quit 7.进入vlan 114: vlan 114 8.查看千兆口信息: dis int g 9.把25,26两个千兆口加到vlan 114中: port g 1/0/25 to g 1/0/26 10.退出: quit 11.进入vlan114 : int vlan 114 12.查看本接口信息dis this 13.退出quit 14.进入vlan 114虚接口下(可以配置管理地址):interface vlan-interface 114 15.配置管理地址ip address 111.115.76.98 27 16.查看信息dis this 17.退出quit 18.配置默认路由ip route-static 0.0.0.0 0.0.0.0 111.115.76.97(分别是目 的地址子网掩码网关) 19.建立一个登陆交换机的用户名local-user fuwuqi2 20.设置登陆密码password cipher fuwuqi2_2918 21.设置用户管理等级0-3,3是超级管理员authorization-attribute level 3 22.设置用“telnet”方式登陆service-type telnet 23.退出quit 24.打开telnet服务telnet server enable 25.设置0-5共6个用户可同时远程登陆user-interface vty 0 5 26.设置用户登陆方式,scheme是用户名+密码authentication-mode scheme 27.查看当前配置信息dis this 28.查看当前所有配置dis cur 29.保存配置信息save 30.查看交换机上有哪些VLAN dis vlan 31.查看各交换机端口状态及vlan情况: dis brief int 32.将某个端口加入到某个vlan中:sys Vlan 111 Port eth 1/0/1 33.查看当前各端口流量情况: dis int 34.查看交换机上mac地址:dis mac-address 物理地址 35.查看CPU占用:dis cup 36.静态IP与MAC地址绑定(不与端口绑定): sys arp static 192.168.11.204 0005-5d02-f2b3 查询:dis arp 192.168.11.204 取消:undo arp 192.168.11.204

DELL交换机配置命令

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)#switchport access 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)#ip address;设置IP地址 switch(config)#ip default-gateway;设置默认网关 switch#dir flash: ;查看闪存 交换机显示命令: switch#write ;保存配置信息 switch#show vtp ;查看vtp配置信息 switch#show run ;查看当前配置信息 switch#show vlan ;查看vlan配置信息 switch#show interface ;查看端口信息 switch#show int f0/0 ;查看指定端口信息 2. 路由器支持的命令:

华为三层交换机配置方法及命令

Enable //进入私有模式 Configure terminal //进入全局模式 service password-encryption //对密码进行加密 hostname Catalyst 3550-12T1 //给三层交换机定义名称 enable password 123456. //enable密码 Enable secret 654321 //enable的加密密码(应该是乱码而不是654321这样) Ip subnet-zero //允许使用全0子网(默认都是打开的) Ip name-server 172.16.8.1 172.16.8.2 //三层交换机名字Catalyst 3550-12T1对应的IP地址是172.16.8.1 Service dhcp //提供DHCP服务 ip routing //启用三层交换机上的路由模块 Exit Vtp mode server //定义VTP工作模式为sever模式 Vtp domain centervtp //定义VTP域的名称为centervtp Vlan 2 name vlan2 //定义vlan并给vlan取名(如果不取名的话,vlan2的名字应该是vlan002) Vlan 3 name vlan3 Vlan 4 name vlan4 Vlan 5 name vlan5 Vlan 6 name vlan6 Vlan 7 name vlan7 Vlan 8 name vlan8 Vlan 9 name vlan9 Exit interface Port-channel 1 //进入虚拟的以太通道组1 Interface gigabitethernet 0/1 //进入模块0上的吉比特以太口1 channel-group 1 mode on //把这个接口放到快速以太通道组1中 Interface gigabitethernet 0/2 //同上channel-group 1 mode on port-channel load-balance src-dst-ip //定义快速以太通道组的负载均衡方式(依靠源和目的IP的方式)

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

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 关闭以太网端口

华为交换机常用命令配置介绍

华为交换机配置命令 华为QuidWay交换机配置命令手册: 1、开始 建立本地配置环境,将主机的串口通过配置电缆与以太网交换机的Console口连接。 在主机上运行终端仿真程序(如Windows的超级终端等),设置终端通信参数为:波特率为9600bit/s、8位数据位、1位停止位、无校验和无流控,并选择终端类型为VT100。 以太网交换机上电,终端上显示以太网交换机自检信息,自检结束后提示用户键入回车,之后将出现命令行提示符(如)。 键入命令,配置以太网交换机或查看以太网交换机运行状态。需要帮助可以随时键入"?" 2、命令视图 (1)用户视图(查看交换机的简单运行状态和统计信息):与交换机建立连接即进入 (2)系统视图(配置系统参数)[Quidway]:在用户视图下键入system-view (3)以太网端口视图(配置以太网端口参数)[Quidway-Ethernet0/1]:在系统视图下键入interface ethernet 0/1 (4)VLAN视图(配置VLAN参数)[Quidway-Vlan1]:在系统视图下键入vlan 1 (5)VLAN接口视图(配置VLAN和VLAN汇聚对应的IP接口参数)[Quidway-Vlan-interface1]:在系统视图下键入interface vlan-interface 1 (6)本地用户视图(配置本地用户参数)[Quidway-luser-user1]:在系统视图下键入local-user user1 (7)用户界面视图(配置用户界面参数)[Quidway-ui0]:在系统视图下键入user-interface 3、其他命令 设置系统时间和时区clock time Beijing add 8 clock datetime 12:00:00 2005/01/23 设置交换机的名称[Quidway]sysname TRAIN-3026-1[TRAIN-3026-1] 配置用户登录[Quidway]user-interface vty 0 4 [Quidway-ui-vty0]authentication-mode scheme 创建本地用户[Quidway]local-user huawei [Quidway-luser-huawei]password simple huawei [Quidway-luser-huawei] service-type telnet level 3 4、VLAN配置方法 『配置环境参数』 SwitchA端口E0/1属于VLAN2,E0/2属于VLAN3 『组网需求』 把交换机端口E0/1加入到VLAN2 ,E0/2加入到VLAN3 数据配置步骤 『VLAN配置流程』 (1)缺省情况下所有端口都属于VLAN 1,并且端口是access端口,一个access端口只能属于一个vlan; (2)如果端口是access端口,则把端口加入到另外一个vlan的同时,系统自动把该端口从原来的vlan中删除掉; (3)除了VLAN1,如果VLAN XX不存在,在系统视图下键入VLAN XX,则创建VLAN XX并进入VLAN视图;如果VLAN XX已经存在,则进入VLAN视图。

中兴交换机配置命令

中兴交换机配置命令 ZTE交换机配置常用命令汇总(摘自网络) 个人心得:命令的使用要注意各种用户模式。 配成普通交换机:把2-24端口归到VLAN1下,2-24端口如果互相隔离,可以用PVLAN删除隔离端口即可。 2852s和2826s配置: 创建VLAN命令如下: set vlan 10 enable ///创建vlan set vlan 10 add port 1-24 untag ///在创建的vlan内添加用户端口 set vlan 10 add port 25 tag ///把级联端口添加到vlan10中,需打tag标签,即为trunk端口。 set port 1-24 pvid 10 ///把添加到vlan10的用户端口,pvid至vlan10中。交换机用户端口必须在所添加的vlan中做 此项命令。(默认的pvid为vlan10) 删除vlan命令如下: set vlan 10 delete port 1-24 ///删除用户端口 set vlan 10 delete port 25 ///删除级联端口 set vlan 10 disable ///删除vlan set port 1-24 pvid 1 ///恢复默认设置,该项命令必须添加,不然还会在show running-config信息中显示 set port 1-24 pvid 10的信息,会导致vlan用户使用不正常。 ENABLE密码配置: zte>enable //进入全局配置模式 password:***** //输入进入全局配置模式的密码,缺省没有密码 zte(cfg)#adminpass zxr10 //配置进入全局配置模式的密码为zxr10 TELNET 用户名密码配置(为了便于对设备的维护,有时需要修改登录用户名或密码,配置如下:) zte(cfg)#create user zxr10 //创建名为zxr10的用户 zte(cfg)#loginpass zxr10 //设置登录密码为zxr10 zte(cfg)#show user //显示telnet登录用户信息和当前用户名 配置三层管理或业务地址: config router ///进入config router模式 set ipport 0 ipaddress 10.20.20.1 255.255.255.0 ///设置三层接口ip地址及掩码 set ipport 0 vlan 10 ///三层端口绑定vlan set ipport 0 enable ///启用三层端口 iproute 0.0.0.0 0.0.0.0 10.20.20.1 ///设置默认路由指向网关 T40G和5228交换机配置: 批量创建vlan方式: zxr10#vlan database zxr10(vlan)#vlan 10-20

交换机配置和设备常用命令

常用命令等 1、连接交换机并设置软件连接交换机/路由器等: 如果设备管理器里边没有端口选项则说明USB-COM驱动未安装好;到这里记录下COM口的端口号,我这里是COM4。 打开securecrt软件:打开crt解压到的目录点软件启动

在弹出的窗口中点击下图中的按钮 按照下图中选择选项:

选择完成后点击确定按钮后敲击回车,如窗口中显示XXXXX>则说明设备连接成功。 2、配置5750交换机步骤 A、第一步删除5750交换机现有配置,复制下边命令并粘贴到crt命令行内: en ruijie delete config.text y reload y B、重新配置5750交换机: en

conf t hos btjx-zhl-25750-2 vlan 101 exit int vlan 101 ip add 192.168.101.252 255.255.255.0 exit ip route 0.0.0.0 0.0.0.0 192.168.101.254 enable sec ruijie lin vty 0 4 pass ruijie exit rldp enable int r g0/1 – 22 sw mo acc sw acc vlan 101 rldp port loo shutdown-port exit int r g0/23 – 24 me fi sw mo tr int g0/24

des btjx-zhl-25750-1 exit err re int 1800 end wr wr 此配置是11日没有拆下来的交换机的配置: 此配置是11日拆除下来的5750交换机的配置(需要增加部分配置) 上边配置的5750交换机23口24口都是级联口5750-1-24口接86,5750-1-23连接5750-2-24口 3、2952交换机配置,修改级联口部分: en ruijie conf t int g0/49 sw mo tr int g0/51 sw mo tr

H C交换机常用配置命令

H3C交换机常用配置命令 一、用户配置 system-view [H3C]super password H3C 设置用户分级密码 [H3C]undo super password 删除用户分级密码 [H3C]localuser bigheap 123456 1 Web网管用户设置,1(缺省)为管理级用户,缺省admin,admin [H3C]undo localuser bigheap 删除Web网管用户 [H3C]user-interface aux 0 只支持0 [H3C-Aux]idle-timeout 2 50 设置超时为2分50秒,若为0则表示不超时,默认为5分钟 [H3C-Aux]undo idle-timeout 恢复默认值 [H3C]user-interface vty 0 只支持0和1 [H3C-vty]idle-timeout 2 50 设置超时为2分50秒,若为0则表示不超时,默认为5分钟 [H3C-vty]undo idle-timeout 恢复默认值 [H3C-vty]set authentication password 123456 设置telnet密码,必须设置 [H3C-vty]undo set authentication password 取消密码 [H3C]display users 显示用户 [H3C]display user-interface 显示用户界面状态 二、系统IP设置 [H3C]vlan 20 [H3C]management-vlan 20 [H3C]interface vlan-interface 20 创建并进入管理VLAN [H3C]undo interface vlan-interface 20 删除管理VLAN接口 [H3C-Vlan-interface20]ip [H3C-Vlan-interface20]undo ip address 删除IP地址 [H3C-Vlan-interface20]ip [H3C-Vlan-interface20]undo ip gateway [H3C-Vlan-interface20]shutdown 关闭接口 [H3C-Vlan-interface20]undo shutdown 开启 [H3C]display ip 显示管理VLAN接口IP的相关信息 [H3C]display interface vlan-interface 20 查看管理VLAN的接口信息

3COM 交换机配置命令

3COM SWITCH 4005 调试步骤 1.1连接 1.用一条console线将3COM SWITCH 4005 与终端连接,在windows 窗口中,单击开始选择程序-附件-通讯-超级终端,单击超级终端打开超级终端程序,选择连接端口(COM1,COM2)单击确定 在下面窗口选择还原为默认值按钮然后单击确定

进入超级终端窗口,Login:admin Password:(没有) 回车

2.1.创建VLAN 在Select menu option:输入bridge回车 在Select menu option (bridge):输入vlan回车 在Select menu option (bridge/vlan): 输入create回车 在Select VLAN ID (2-2047)[2]: 输入2 在Enter VLAN name [VLAN 2]: 输入tech(可根据需要起名字)] 重复以上步骤可创建多个VLAN 2.2.查看VLAN信息 在Select menu option (bridge/vlan): 输入summary 回车 在Select VLAN ID (1,2,all)[all]: 输入ALL回车 可以看到VLAN的摘要信息 2. 3在VLAN中添加端口 在Select menu option (bridge/vlan): 输入modify回车 在Select menu option (bridge/vlan/modify): 输入addport回车 在Select VLAN ID (1,2)[1]: 输入2回车 在Select slot (1-5): 输入1回车 在Select bridge port (1-8,all) [all]: 输入1回车 在Enter tag type (untagged,tagged): 输入untagged回车 注:如果此端口用于连接交换机或同属于两个以上的VLAN选择tagged,如此端口用于连接服务器及工作站且只属于一个VLAN(服务

cisco交换机常用配置命令

3、常用配置命令 3.1 把端口加入到vlan Switch>en Password: Switch #conf t /*进入配置模式*/ Enter configuration commands, one per line. End with CNTL/Z. Switch (config)#inter f 0/1 /*进入端口*/ Switch (config-if)#switchport access vlan X /*把端口加入到vlan X*/ Switch (config-if)#end Switch #wr /*保存*/ Building configuration... [OK] Switch # 3.2 添加新vlan(在核心交换机上写) Switch>en Password: Switch #conf t /*进入配置模式*/ Enter configuration commands, one per line. End with CNTL/Z. Switch (config)#Vlan X /*添加新Vlan*/ Switch (config-vlan)#inter vlan X /*进入Vlan*/ Switch (config-if)#ip address x.x.x.x 255.255.255.0/*设置vlan ip地址*/ Switch (config-if)#no shut 3.3 配置trunk,透传vlan Switch>en Password: Switch #conf t /*进入配置模式*/ Enter configuration commands, one per line. End with CNTL/Z. Switch (config)#inter fast 0/x /*进入级联端口*/ Switch (config-if)#switchport mode trunk /*修改端口模式*/ Switch (config-if)# switchport trunk allowed vlan all /*设置允许通过的vlan*/ 保存 删除命令:所有的命令前面加no。

Cisco交换机常用配置命令

Cisco交换机常用配置命令 CISCO交换机基本配置 switch>ena 進入特权模式 switch#erasenvram 全部清除交换机的所有配置 switch#reload 重新启动交换机(初始提示符为switch> ) ------------------------------------------------------------------------------------ CISCO交换机基本配置:Console端口连接 用户模式hostname>; 特权模式hostname(config)# ; 全局配置模式hostname(config-if)# ; 交换机口令设置: switch>enable ;进入特权模式 switch#config;进入全局配置模式 switch(config)#hostname cisco ;设置交换机的主机名 switch(config)#enable secret csico1 ;设置特权加密口令 switch(config)#enable password csico8 ;设置特权非密口令 switch(config)#line console 0 ;进入控制台口 switch(config-line)#line vty 0 4 ;进入虚拟终端 switch(config-line)#login ;虚拟终端允许登录 switch(config-line)#password csico6 ;设置虚拟终端登录口令csico6 switch#write 保存配置設置 switch#copy running-config startup-config 保存配置設置,與write一樣switch#exit;返回命令 配置终端过一会时间就会由全局配置模式自动改为用户模式,将超时设置为永不超时 switch#conf t switch(config)#line con 0 switch(config-line)#exec-timeout 0 --------------------------------------------------------------------------------- 交换机显示命令: switch#write;保存配置信息 switch#showvtp;查看vtp配置信息 switch#show run ;查看当前配置信息 switch#showvlan;查看vlan配置信息 switch#showvlan name vlan2 switch#show interface ;查看端口信息

相关文档
最新文档