当前位置:文档之家› 锐捷基本命令大全

锐捷基本命令大全

锐捷基本命令大全
锐捷基本命令大全

>Enable 进入特权模式

#Exit 返回上一级操作模式

#End 返回到特权模式

#write memory 或copy running-config startup-config 保存配置文件

#del flash:config.text 删除配置文件(交换机及1700系列路由器)

#erase startup-config 删除配置文件(2500系列路由器)

#del flash:vlan.dat 删除Vlan配置信息(交换机)

#Configure terminal 进入全局配置模式

(config)# hostname switchA配置设备名称为switchA

(config)#banner motd & 配置每日提示信息&为终止符

(config)#enable secret level 1 0 star 配置远程登陆密码为star

(config)#enable secret level 15 0 star 配置特权密码为star

Level 1为普通用户级别,可选为1~15,15为最高权限级别;0表示密码不加密

(config)#enable services web-server 开启交换机WEB管理功能

Services 可选以下:web-server(WEB管理)、telnet-server(远程登陆)等

查看信息

#show running-config 查看当前生效的配置信息

#show interface fastethernet 0/3 查看F0/3端口信息

#show interface serial 1/2 查看S1/2端口信息

#show interface 查看所有端口信息

#show ip interface brief 以简洁方式汇总查看所有端口信息

#show ip interface 查看所有端口信息

#show version 查看版本信息

#show mac-address-table 查看交换机当前MAC地址表信息

#show running-config 查看当前生效的配置信息

#show vlan 查看所有VLAN信息

#show vlan id 10 查看某一VLAN (如VLAN10)的信息

#show interface fastethernet 0/1 switchport 查看某一端口模式(如F 0/1)

#show aggregateport 1 summary 查看聚合端口AG1的信息

#show spanning-tree 查看生成树配置信息

#show spanning-tree interface fastethernet 0/1 查看该端口的生成树状态

#show port-security 查看交换机的端口安全配置信息

#show port-security address 查看地址安全绑定配置信息

#show ip access-lists listname 查看名为listname的列表的配置信息

#show access-lists

端口的基本配置

(config)#Interface fastethernet 0/3 进入F0/3的端口配置模式

(config)#interface range fa 0/1-2,0/5,0/7-9 进入F0/1、F0/2、F0/5、F0/7、F0/8、F0/9的端口配置模式

(config-if)#speed 10 配置端口速率为10M,可选10,100,auto

(config-if)#duplex full 配置端口为全双工模式,可选full(全双工),half(半双式),auto(自适应)

(config-if)#no shutdown 开启该端口

(config-if)#switchport access vlan 10 将该端口划入VLAN10中,用于VLAN

(config-if)#switchport mode trunk 将该端口设为trunk模式,用于Tag vlan

可选模式为access , trunk

(config-if)#port-group 1 将该端口划入聚合端口AG1中,用于聚合端口

聚合端口的创建

(config)# interface aggregateport 1 创建聚合接口AG1

(config-if)# switchport mode trunk 配置并保证AG1为trunk 模式

(config)#int f0/23-24

(config-if-range)#port-group 1 将端口(端口组)划入聚合端口AG1中

生成树

(config)#spanning-tree 开启生成树协议

(config)#spanning-tree mode stp 指定生成树类型为stp

可选模式stp , rstp , mstp

(config)#spanning-tree priority 4096 设置交换机的优先级为4096 , 优先级值小为高。优先级可选值为0,4096,8192,……,为4096的倍数。交换机默认值为32768

VLAN的基本配置

(config)#vlan 10 创建VLAN10

(config-vlan)#name vlanname 命名VLAN为vlanname

(config-if)#switchport access vlan 10 将该端口划入VLAN10中

某端口的接口配置模式下进行

(config)#interface vlan 10 进入VLAN 10的虚拟端口配置模式

(config-if)# ip address 192.168.1.1 255.255.255.0 为VLAN10的虚拟端口配置IP及掩码,二层交换机只能配置一个IP,此IP是作为管理IP使用,例如,使用Telnet的方式登录的IP 地址

(config-if)# no shutdown 启用该端口

端口安全

(config)# interface fastethernet 0/1 进入一个端口

(config-if)# switchport port-security 开启该端口的安全功能

1.配置最大连接数限制

(config-if)# switchport port-secruity maxmum 1 配置端口的最大连接数为1,最大连接数为128

(config-if)# switchport port-secruity violation shutdown

配置安全违例的处理方式为shutdown,可选为protect (当安全地址数满后,将未知名地址丢弃)、restrict(当违例时,发送一个Trap通知)、shutdown(当违例时将端口关闭,并发送Trap通知,可在全局模式下用errdisable recovery来恢复)

2.IP和MAC地址绑定

(config-if)#switchport port-security mac-address xxxx.xxxx.xxxx ip-address 172.16.1.1

接口配置模式下配置MAC地址xxxx.xxxx.xxxx和IP172.16.1.1进行绑定(MAC地址注意用小写)

三层路由功能(针对三层交换机)

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

(config)# interface fastethernet 0/1

(config-if)# no switchport 开启端口的三层路由功能(这样就可以为某一端口配置IP)

(config-if)# ip address 192.168.1.1 255.255.255.0

(config-if)# no shutdown

三层交换机路由协议

(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1 配置静态路由

注:172.16.1.0 255.255.255.0 为目标网络的网络号及子网掩码

172.16.2.1 为下一跳的地址,也可用接口表示,如ip route 172.16.1.0 255.255.255.0 serial 1/2(172.16.2.0所接的端口)

(config)# router rip 开启RIP协议进程

(config-router)# network 172.16.1.0 申明本设备的直连网段信息

(config-router)# version 2 开启RIP V2,可选为version 1(RIPV1)、version 2(RIPV2)

(config-router)# no auto-summary 关闭路由信息的自动汇总功能(只有在RIPV2支持)

(config)# router ospf 开启OSPF路由协议进程(针对1762,无需使用进程ID)(config)# router ospf 1 开启OSPF路由协议进程(针对2501,需要加OSPF进程ID)

(config-router)# network 192.168.1.0 0.0.0.255 area 0

申明直连网段信息,并分配区域号(area0为骨干区域)

IP ACL:

交换机采用命名的访问控制列表;分标准(stand)和扩展(extended)两种

1.标准ACL

(config)#ip access-list stand listname 定义命名标准列表,命名为listname,stand为标准列表

(config-std-nacl)#deny 192.168.30.0 0.0.0.255 拒绝来自192.168.30.0网段的IP流量通过注:deny:拒绝通过;可选:deny(拒绝通过)、permit(允许通过)

192.168.30.0 0.0.0.255:源地址及源地址通配符;可使用any表示任何IP

(config-std-nacl)#permit any

(config-std-nacl)#end 返回

2.扩展ACL

(config)#ip access-list extended listname

定义命名扩展列表,命名为listname,extended为扩展

(config-ext-nacl)#deny tcp 192.168.30.0 0.0.0.255 192.168.10.0 0.0.0.255 eq www 拒绝源地址为192.168.30.0网段的IP访问目的地址为192.168.10.0网段的WWW服务注:deny:拒绝通过,可选:deny(拒绝通过)、permit(允许通过)

tcp: 协议名称,协议可以是udp, ip,eigrp, gre, icmp, igmp, igrp等等。

192.168.10.0 0.0.0.255:源地址及源地址通配符

192.168.30.0 0.0.0.255:目的地址及目的地址通配符

eq:操作符(lt-小于,eq-等于,gt-大于,neg-不等于,range-包含)

www:端口号,可使用名称或具体编号

可以使用的协议名称(或编号)和端口名称(或编号)请打?查询。

(config-ext-nacl)#permit ip any any 允许其它通过

(config-ext-nacl)#end 返回

(config)#interface vlan 10 进入端口配置模式

(config-if)# ip access-group listname in 访问控制列表在端口下in方向应用;可选:in(入栈)、out(出栈)

(config-if)#end 返回

注:配置ACL时,若只想对其中部分IP进行限制访问时,必须配置允许其流量通过,否则设备只会对限制IP进行处理,不会对非限制IP进行允许通过处理。

在锐捷交换机上配置vrrp、arp和mstp

交换机

密码

1234(config)#enable secret level 1 0 100

1234(config)#enable secret level 15 0 100

远程登入密码

1234(config)#line vty 0 4

1234(config-line)#password 100

1234(config-line)#end

交换机管理IP

1234(config)#interface vlan 1

1234(config-if)#ip address 192.168.1.10 255.255.255.0

1234(config-if)#no shutdown

修改交换机老化时间

1234(config)#mac-address-table aging-time 20

1234(config)#end

添删vlan

1234(config)#vlan 888

1234(config-vlan)#name a888

1234(config)#no vlan 888

添加access口

1234(config)#interface gigabitEthernet 0/10

1234(config-if)#switchport mode access

1234(config-if)#switchport access vlan 10

切换assess trunk

1234(config-if)#switchport mode access

1234(config-if)#switchport mode trunk

指定特定一个native vlan

1234(config-if)#switchport trunk native vlan 10 配置trunk口的许可vlan列表

1234(config-if)#switchport trunk allowed vlan ?

add Add VLANs to the current list

all All VLANs

except All VLANs except the following remove Remove VLANs from the current list

速成树协议

1234(config)#spanning-tree

1234(config)#spanning-tree mode rstp/stp

配置网关:

switch(config)#ip default-gateway 192.168.1.254

交换机基本配置-常见查看命令

查看CPU利用率

show cpu

查看交换机时钟

show clock

查看交换机日志

show logging

查看交换机动态学习到的MAC地址表

show mac-address-table dynamic

查看当前交换机运行的配置文件

show running-config

查看交换机硬件、软件信息

show version

查看交换机的arp表

show arp

显示接口详细信息的命令

show interfaces gigabitEthernet 4/1 counters

接口配置

Switch(config)#interface gigabitethernet 0/1

把接口工作模式改为光口。

Switch(config-if)#medium-type fiber

把接口工作模式改为电口。

Switch(config-if)#medium-type copper

速度/双工配置

进入接口配置模式。

Switch(config)#interface interface-id

设置接口的速率参数,或者设置为auto。

Switch(config-if)#speed {10 | 100 | 1000 | auto } 设置接口的双工模式。

Switch(config-if)#duplex {auto | full | half}

例子

Switch(config)#interface gigabitethernet 0/1

Switch(config-if)#speed 1000

Switch(config-if)#duplex full

光口不能修改速度和双工配置,只能auto。

在故障处理的时候,如果遇到规律性的时断时续或掉包,在排除其他原因后,可以考虑是否和对端设备的速率和双工模式不匹配,尤其是两端设备为不同厂商的时候。

VLAN

建立VLAN 100

Switch (config)#vlan 100

该VLAN名称为ruijie

Switch (config)#name ruijie

将交换机接口划入VLAN 中:

range表示选取了系列端口1-48,这个对多个端口进行相同配置时非常有用。

Switch (config)#interface range f 0/1-48

将接口划到VLAN 100中。

Switch (config-if-range)#switchport access vlan 100

将接口划回到默认VLAN 1中,即端口初始配置。

Switch (config-if-range)#no switchport access vlan

Switch(config)#interface fastEthernet 0/1

该端口工作在access模式下

Switch(config-if)#switchport mode access

该端口工作在trunk模式下

Switch(config-if)#switchport mode trunk

Switch(config)#interface fastEthernet 0/2

设定VLAN要修剪的VLAN。

Switch(config-if)#switchport trunk allowed vlan remove 2-9,11-19,21-4094

取消端口下的VLAN修剪。

Switch(config-if)#no switchport trunk allowed vlan

生成树

开启生成树协议。

Switch(config)#spanning-tree

禁止生成树协议。

Switch(config)#no spanning-tree

配置生成树优先级:

配置设备优先级为4096。

Switch(config)#spanning-tree priority 4096

数值越低,优先级别越高。

端口镜像

配置G0/2为镜像端口。

Switch (config)# monitor session 1 destination interface G 0/2

配置G0/1为被镜像端口,且出入双向数据均被镜像。

Switch (config)# monitor session 1 source interface G 0/1 both

去掉镜像1。

Switch (config)# no monitor session 1

端口聚合

Switch(config)#interface fastEthernet 0/1

把端口f0/1加入到聚合组1中。

Switch (config-if)#port-group 1

把端口f0/1从聚合组1中去掉

Switch (config-if)#no port-group 1

建立ACL:

建立ACL访问控制列表名为ruijie,extend表示建立的是扩展访

Switch(config)# Ip access-list exten ruijie

问控制列表。

添加ACL的规则:

禁止PING IP地址为192.168.1.1的设备。

Switch (config-ext-nacl)#deny icmp any 192.168.1.1 255.255.255.0

禁止端口号为135的应用。

Switch (config-ext-nacl)# deny tcp any any eq 135

禁止协议为www的应用。

Switch (config-ext-nacl)#deny udp any any eq www

允许所有行为。

Switch(config-ext-nacl)# permit ip any any

将ACL应用到具体的接口上:

Switch (config)#interface range f 0/1

把名为ruijie的ACL应用到端口f 0/1上。

Switch (config-if)#ip access-group ruijie in

从接口去除ACL。

Switch (config-if)#no ip access-group ruijie in

删除ACL:

删除名为ruijie的ACL。

Switch(config)#no Ip access-list exten ruijie

增加ACE项后,是增加到ACL最后,不可以中间插入,如果要调整ACE的顺序,必须整个删除ACL后再重新配置。

端口安全

Switch (config)#interface range f 0/1

开启端口安全。

Switch(config-if)# switchport port-security

关闭端口安全。

Switch(config-if)# no switchport port-security

设置端口能包含的最大安全地址数为8。

Switch(config-if)# switchport port-security maximum 8

在接口fastethernet0/1配置一个安全地址00d0.f800.073c,并为其绑定一个IP地址192.168.1.1 Switch(config-if)# switchport port-security mac-address 00d0.f800.073c ip-address 192.168.1.1

删除接口上配置的安全地址。

Switch(config-if)#no switchport port-security mac-address 00d0.f800.073c ip-address 192.168.1.1

防ARP攻击

IP和MAC地址的绑定

Switch(config)#arp ip-address hardware-address [type] interface-id Switch(config)#arp 192.168.12.111 00d0.f800.073c arpa g 0/1

绑定网关

进入指定端口进行配置。

Switch(config)#Interface interface-id

配置防止ip-address的ARP欺骗。

Switch(config-if)#Anti-ARP-Spoofing ip ip-address

防STP攻击

进入端口Fa0/1。

Switch(config)# inter fastEthernet 0/1

打开该端口的的BPDU guard功能。

Switch(config-if)# spanning-tree bpduguard enable

关闭该端口的的BPDU guard功能。

Switch(config-if)# spanning-tree bpduguard diaable

端口关闭后只能shutdown然后再no shutdown

或者重新启动交换机才能恢复!

防DOS/DDOS攻击

进入端口Fa0/1。

Switch(config)# inter fastEthernet 0/1

预防伪造源IP的DOS攻击的入口过滤功能。

Switch(config-if)#ip deny spoofing-source

关闭入口过滤功能只能在三层接口上配置。

Switch(config-if)#no ip deny spoofing-source

和ACL不能同时存在。

端口关闭后只能shutdown然后再no shutdown

或者重新启动交换机才能恢复!

防IP扫描攻击配置:

打开系统保护。

Switch(config)#system-guard enable

关闭系统保护功能。

Switch(config)#no system-guard

DHCP配置

打开DHCP Relay Agent:

Switch(config)#service dhcp

配置DHCP Server的IP地址:

Switch(config)#ip helper-address address

VRRP配置

Switch(config)#Interface interface-id

Switch(config-if)#Standby [group-number] ip ip-address

设置虚拟机的优先级。

standby [group-number] priority priority

三层交换机配置

SVI:

把VLAN 10配置成SVI。

switch (config)#interface vlan 10

给该SVI接口配置一个IP地址

switch (config-if)#ip address 192.168.1.1 255.255.255.0

Routed Port:

switch (config)#interface fa 0/1

把f 0/1变成路由口。

switch (config-if)#no switch

路由配置:

添加一条路由。

switch (config)#ip route 目的地址掩码下一跳

switch (config)#ip route 210.10.10.0 255.255.255.0 218.8.8.8

配置多生成树协议:

switch(config)#spanning-tree //开启生成树协议

switch(config)#spanning-tree mst configuration //建立多生成树协议

switch(config-mst)#name ruijie //命名为ruijie

switch(config-mst)#revision 1 //设定校订本为1

switch(config-mst)#instance 0 vlan 10,20 //建立实例0

switch(config-mst)#instance 1 vlan 30,40 //建立实例1

switch(config)#spanning-tree mst 0 priority 4096 //设置优先级为4096

switch(config)#spanning-tree mst 1 priority 8192 //设置优先级为8192

switch(config)#interface vlan 10

switch(config-if)#vrrp 1 ip 192.168.10.1 //此为vlan 10的IP地址

switch(config)#interface vlan 20

switch(config-if)#vrrp 1 ip 192.168.20.1 //此为vlan 20的IP地址

switch(config)#interface vlan 30

switch(config-if)#vrrp 2 ip 192.168.30.1 //此为vlan 30的IP地址(另一三层交换机)

switch(config)#interface vlan 40

switch(config-if)#vrrp 2 ip 192.168.40.1 //此为vlan 40的IP地址(另一三层交换机)

此配置需在两个三层交换机和二层交换机上进行配置!在二层交换机上不用配置VRRP!

冗余链路

在骨干网设备连接中,单一链路的连接很容易实现,但一个简单的故障就会造成网络的中断.因此在实际网络组建的过程中,为了保持网络的稳定性,在多台交换机组成的网络环境中,通常都使用一些备份连接,以提高网络的健壮性、稳定性.

这里的备份连接也称为备份链路或者冗余链路.备份链路之间的交换机经常互相连接,形成一个环路,通过环路可以在一定程度上实现冗余.

链路的冗余备份能为网络带来健壮性、稳定性和可靠性等好处,但是备份链路也会使网络存在环路,环路问题是备份链路所面临的最为严重的问题,交换机之间的环路将导致网络新问题的发生:

广播风暴

多帧复制

地址表的不稳定

解决方法:

生成树协议避免环路

每个LAN都会选择一台设备为指定交换机,通过该设备的端口连接到根,该端口为指定端口(Designated port )

将交换网络中所有设备的根端口(RP)和指定端口(DP)设为转发状态(Forwarding),将其他端口设为阻塞状态(Blocking)

生成树经过一段时间(默认值是50秒左右)稳定之后,所有端口要么进入转发状态,要么进入阻塞状态。

IEEE 802.1w—快速生成树协议

快速生成树协议概述

快速生成树协议RSTP(Rapid Spannning Tree Protocol) IEEE 802.1w

RSTP协议在STP协议基础上做了改进,使得收敛速度快得多(最快1秒以内)

生成树协议的配置

开启生成树协议

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

显示生成树状态

Switch#show spanning-tree

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

Switch#show spanning-tree interface fastethernet <0-2/1-24>

生成树协议概述

生成树协议(spanning-tree protocol)由IEEE 802.1d标准定义

生成树协议的作用是为了提供冗余链路,解决网络环路问题

生成树协议通过SPA(生成树算法)生成一个没有环路的网络,当主要链路出现故障时,能够自动切换到备份链路,保证网络的正常通信

配置模式:

全局配置模式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# 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

删除配置

永久性的删除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#c onfigure 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配置信息

锐捷基本命令大全

>Enable 进入特权模式 #Exit 返回上一级操作模式 #End 返回到特权模式 #write memory 或copy running-config startup-config 保存配置文件 #del flash:config.text 删除配置文件(交换机及1700系列路由器) #erase startup-config 删除配置文件(2500系列路由器) #del flash:vlan.dat 删除Vlan配置信息(交换机) #Configure terminal 进入全局配置模式 (config)# hostname switchA 配置设备名称为switchA (config)#banner motd & 配置每日提示信息&为终止符 (config)#enable secret level 1 0 star 配置远程登陆密码为star (config)#enable secret level 15 0 star 配置特权密码为star Level 1为普通用户级别,可选为1~15,15为最高权限级别;0表示密码不加密 (config)#enable services web-server 开启交换机WEB管理功能 Services 可选以下:web-server(WEB管理)、telnet-server(远程登陆)等 查看信息 #show running-config 查看当前生效的配置信息 #show interface fastethernet 0/3 查看F0/3端口信息 #show interface serial 1/2 查看S1/2端口信息 #show interface 查看所有端口信息 #show ip interface brief 以简洁方式汇总查看所有端口信息 #show ip interface 查看所有端口信息 #show version 查看版本信息 #show mac-address-table 查看交换机当前MAC地址表信息 #show running-config 查看当前生效的配置信息 #show vlan 查看所有VLAN信息 #show vlan id 10 查看某一VLAN (如VLAN10)的信息 #show interface fastethernet 0/1 switchport 查看某一端口模式(如F 0/1) #show aggregateport 1 summary 查看聚合端口AG1的信息 #show spanning-tree 查看生成树配置信息 #show spanning-tree interface fastethernet 0/1 查看该端口的生成树状态 #show port-security 查看交换机的端口安全配置信息 #show port-security address 查看地址安全绑定配置信息 #show ip access-lists listname 查看名为listname的列表的配置信息 #show access-lists 端口的基本配置 (config)#Interface fastethernet 0/3 进入F0/3的端口配置模式 (config)#interface range fa 0/1-2,0/5,0/7-9 进入F0/1、F0/2、F0/5、F0/7、F0/8、F0/9的端口配置模式 (config-if)#speed 10 配置端口速率为10M,可选10,100,auto (config-if)#duplex full 配置端口为全双工模式,可选full(全双工),half(半双式),auto(自适应) (config-if)#no shutdown 开启该端口 (config-if)#switchport access vlan 10 将该端口划入VLAN10中,用于VLAN

锐捷交换机常用操作命令

一、交换机配置模式介绍 (2) 二、交换机基本配置 (2) 2.1 接口介质类型配置 (3) 2.2 接口速度/双工配置 (3) 2.3 VLAN配置 (4) 2.4 端口镜像 (5) 2.5 端口聚合 (6) 2.6 交换机堆叠 (6) 2.7 ACL配置 (7) 2.8 端口安全 (8) 2.9 交换机防攻击配置 (10) 2.10 DHCP配置 (13) 2.11 三层交换机配置 (14) 三、交换机常用查看命令 (16)

一、交换机配置模式介绍 交换机配置模式主要有: 用户模式:此模式只可以简单的查看一些交换机的配置和一些简单的修改。 Switch> 特权模式:此模式可以查看一些交换机的配置,后面讲述的很多show命令便是在此模式下进行的,还可以对一些简单的设置配置,例如时间。 Switch> enable //在用户模式下输入enable将进入配置模式 Switch# 全局配置模式:此模式下可以进行对交换机的配置,例如:命名、配置密码、设路由等。Switch#configure erminal //特权模式下可以通过config terminal 命令进入配置模式Switch(config)# 端口配置模式:此模式下对端口进行配置,如配置端口ip等。 Switch(config)#interface gigabitEthernet 1/1 //配置模式下输入interface gigabitEthernet 1/1进入到端口g 1/1接口模式。 二、交换机基本配置 交换机命名:在项目实施的时候,建议为处于不同位置的交换机命名,便于记忆,可提高后期管理效率。 switch(config)#hostname ruijie //ruijie为该交换机的名字 交换机配置管理密码:配置密码可以提高交换机的安全性,另外,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表示为特权密码 交换机配置管理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,养成习惯,无论配置什么设备,都使用一下这个命令

锐捷交换机基本配置命令

交换机基本操作 1.进入特权模式 Switch>enable Switch# 2.返回用户模式 Switch#exit Press RETURN to get started! Switch> 配置模式: 全局配置模式[主机名(config)#]:配置交换机的整体参数 子模式: 1.线路配置模式[主机名(config-line)#]:配置交换机的线路参数 2.接口配置模式[主机名(config-if)#]:配置交换机的接口参数 1.进入全局配置模式下 Switch#configure terminal Switch(config)#exit Switch# 2.进入线路配置模式 Switch(config)#line console 0 Switch(config-line)#exit Switch(config)# 3.进入接口配置模式 Switch(config)#interface fastEthernet 0/1 Switch(config-if)#exit Switch(config)# 从子模式下直接返回特权模式 Switch(config-if)#end Switch# 交换机操作帮助特点: 1.支持命令简写(按TAB键将命令补充完整) 2.在每种操作模式下直接输入“?”显示该模式下所有的命令 3.命令空格“?”显示命令参数并对其解释说明 4.字符“?”显示以该字符开头的命令 5.命令历史缓存: (Ctrl+P)显示上一条命令,(Ctrl+N)显示下一条命令 6.错误提示信息 交换机显示命令: 显示交换机硬件及软件的信息Switch#show version 显示当前运行的配置参数Switch#show running-config 显示保存的配置参数Switch#show configure

锐捷交换机配置手册簿完整

锐捷S3550配置手册 第一部分:交换机概述 一:交换机的几种配置方法 本部分包括以下内容: 控制台 远程登录 其它配置方法 本部分内容适用于交换机、路由器等网络设备。 控制台 用一台计算机作为控制台和网络设备相连,通过计算机对网络设备进行配置。 1、硬件连接: 把Console线一端连接在计算机的串行口上,另一端连接在网络设备的Console口上。Console线在购置网络设备时会提供,它是一条反转线,你也可以自己用双绞线进行制作。

按照上面的线序制作一根双绞线,一端通过一个转接头连接在计算机的串行口上,另一端连 接在网络设备的Console口上。 注意:不要把反转线连接在网络设备的其他接口上,这有可能导致设备损坏。 2、软件安装: 在计算机上需要安装一个终端仿真软件来登录网络设备。通常我们使用Windows自带的“超级终端”。超级终端的安装方法: 开始| 程序| 附件| 通信| 超级终端。 按照提示的步骤进行安装,其中连接的接口应选择“COM1”,端口的速率应选择“9600”,数据流控制应选择“无”,其它都使用默认值。

登录后,就可以对网络设备进行配置了。 说明:超级终端只需安装一次,下次再使用时可从“开始| 程序| 附件| 通信| 超级终端”中找到上次安装的超级终端,直接使用即可。 远程登录 通过一台连接在网络中的计算机,用Telnet命令登录网络设备进行配置。 远程登录条件: 1、网络设备已经配置了IP地址、远程登录密码和特权密码。 2、网络设备已经连入网络工作。

3、计算机也连入网络,并且可以和网络设备通信。 说明:远程登录的计算机不是连接在网络设备Console口上的计算机,而是网络中任一台计算机。 远程登录方法: 在计算机的命令行中,输入命令“telnet 网络设备IP地址”,输入登录密码就可以进入网 络设备的命令配置模式。 说明:远程登录方式不能用来配置新设备,新设备应该用控制台配置IP地址等参数,以后才能使用远程登录进行配置。 其它配置方法 除了控制台和远程登录之外,还有其它一些配置方法配置网络设备。 1、TFTP服务器: TFTP服务器是网络中的一台计算机,你可以把网络设备的配置文件等信息备份到TFTP服务器之中,也可以把备份的文件传回到网络设备中。 由于设备的配置文件是文本文件,所以,你可以用文本编辑软件打开进行修改,再把修改后 的配置文件传回网络设备,这样就可以实现配置功能。你也可以用TFTP服务器把一个已经做好的配置文件上传到一台同型号的设备中实现对它的配置。

锐捷路由器命令大全

锐捷路由器命令大全 2007-09-07 21:08 出现攻击时掉线时请用console链接路由,保存好如下命令的相关内容,用以分析: 1、show ver (版本信息) 2、show run (配置信息) 3、show arp (arp信息) 4、show interface (端口信息) 5、show ip nat trans (nat信息) 6、show ip nat stat 7、show ip nat statistics per-user (只要第1屏的信息) 8、show ip cache (只要第1屏的信息) 9、show ip nat statistics suspicious-pc 发送免费arp: lh#conf t Enter configuration commands, one per line. End with CNTL/Z. lh(config)#int f 0/0(内网) lh(config)#arp gr int 1 lh(config)#int f 1/0(外网) lh(config)#arp gr int 1 lh(config)#end lh#wr端口映射: lh#conf t Enter configuration commands, one per line. End with CNTL/Z. lh(config)#ip nat source static tcp 192.168.3.99ip 80 219.128.102.110 80 permit-inside lh(config)#end lh#wr限制内网某机器不限速(192.168.2.80): lh#conf t Enter configuration commands, one per line. End with CNTL/Z. lh(config)#ip nat translation rate-limit iprange 192.168.2.2 192.168.2.79 inbound 500 outbound 1000 lh(config)#ip nat translation rate-limit iprange 192.168.2.81 192.168.3.253 inbound 500 outbound 1000 lh(config)#end lh#wr限制内网PC的链接线程数同限速: lh#conf t Enter configuration commands, one per line. End with CNTL/Z. lh(config)#ip nat translation per-user 0.0.0.0 250 lh(config)#ip nat translation rate-limit default inbound 500 outbound 1000 lh(config)#end lh#wr禁止公网访问IP lh#conf t Enter configuration commands, one per line. End with CNTL/Z.

(完整版)锐捷交换机命令大全

【第一部分】交换机支持的命令: 1.交换机基本状态: switch: ;ROM状态,路由器是rommon> hostname> ;用户模式 hostname# ;特权模式 hostname(config)# ;全局配置模式 hostname(config-if)# ;接口状态 2.交换机口令设置: 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 ;返回命令 3.交换机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模式

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

锐捷交换机、路由器常用命令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里的配置信息

锐捷交换机常用操作命令手册

锐捷交换机常用操作命令手册 目录 一、交换机配置模式介绍3 二、交换机基本配置3 2.1 接口介质类型配置4 2.2 接口速度/双工配置5 2.3 VLAN配置6 2.4 端口镜像9 2.5 端口聚合10 2.6 交换机堆叠11 2.7 ACL配置12 2.8 端口安全14 2.9 交换机防攻击配置16 2.10 dhcp配置21 2.11 三层交换机配置22 三、交换机常用查看命令24 一、交换机配置模式介绍 交换机配置模式主要有: ? 用户模式:此模式只可以简 单的查看一些交换机的配置和一些简单的修改。 Switch> ? 特权模式:此模式可以查看一些交换机的配置,后面讲述的很多show命令便是在此模式下进行的,还可以对一些简单的设置配置,例如时间。

Switch> enable //在用户模式下输入enable将进入配置模式 Switch# ? 全局配置模式:此模式下可以进行对交换机的配置,例如:命名、配置密码、设路由等。 Switch#configure erminal //特权模式下可以通过config terminal 命令进入配置模式 Switch(config)# ? 端口配置模式:此模式下对端口进行配置,如配置端口ip等。 Switch(config)#interface gigabitEthernet 1/1 //配置模式下输入interface gigabitEthernet 1/1进入到端口g 1/1接口模式。 二、交换机基本配置 ? 交换机命名: 在项目实施的时候,建议为处于不同位置的交换机命名,便于记忆,可提高后期管理效率。 switch(config)#hostname ruijie //ruijie为该交换机的名字 ? 交换机配置管理密码: 配置密码可以提高交换机的安全性,另外,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表示为特权密码 ? 交换机配置管理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,养成习惯,无论配置什么设备,都使用一下这个命令 ? 交换机配置网关:

锐捷交换机配置手册完整

锐捷交换机配置手册完 整 集团标准化工作小组 #Q8QGGQT-GX8G08Q8-GNQGJ8-MHHGN#

锐捷S3550配置手册 第一部分:交换机概述 一:交换机的几种配置方法 本部分包括以下内容: 本部分内容适用于交换机、路由器等网络设备。 控制台 用一台计算机作为控制台和网络设备相连,通过计算机对网络设备进行配置。 1、硬件连接: 把Console线一端连接在计算机的串行口上,另一端连接在网络设备的Console口上。 Console线在购置网络设备时会提供,它是一条反转线,你也可以自己用双绞线进行制作。 按照上面的线序制作一根双绞线,一端通过一个转接头连接在计算机的串行口上,另一端连接在网络设备的Console口上。 注意:不要把反转线连接在网络设备的其他接口上,这有可能导致设备损坏。 2、软件安装: 在计算机上需要安装一个终端仿真软件来登录网络设备。通常我们使用Windows自带的“超级终端”。超级终端的安装方法: 开始 | 程序 | 附件 | 通信 | 超级终端。 按照提示的步骤进行安装,其中连接的接口应选择“COM1”,端口的速率应选择“9600”,数据流控制应选择“无”,其它都使用默认值。

登录后,就可以对网络设备进行配置了。 说明:超级终端只需安装一次,下次再使用时可从“开始 | 程序 | 附件 | 通信 | 超级终端”中找到上次安装的超级终端,直接使用即可。 远程登录 通过一台连接在网络中的计算机,用Telnet命令登录网络设备进行配置。 远程登录条件: 1、网络设备已经配置了IP地址、远程登录密码和特权密码。 2、网络设备已经连入网络工作。 3、计算机也连入网络,并且可以和网络设备通信。 说明:远程登录的计算机不是连接在网络设备Console口上的计算机,而是网络中任一台计算机。 远程登录方法: 在计算机的命令行中,输入命令“telnet 网络设备IP地址”,输入登录密码就可以进入网络设备的命令配置模式。 说明:远程登录方式不能用来配置新设备,新设备应该用控制台配置IP地址等参数,以后才能使用远程登录进行配置。 其它配置方法 除了控制台和远程登录之外,还有其它一些配置方法配置网络设备。 1、TFTP服务器: TFTP服务器是网络中的一台计算机,你可以把网络设备的配置文件等信息备份到TFTP服务器之中,也可以把备份的文件传回到网络设备中。 由于设备的配置文件是文本文件,所以,你可以用文本编辑软件打开进行修改,再把修改后的配置文件传回网络设备,这样就可以实现配置功能。你也可以用TFTP服务器把一个已经做好的配置文件上传到一台同型号的设备中实现对它的配置。

锐捷交换机命令

锐捷交换机配置命令 交换机基本操作 1.进入特权模式 Switch>enable Switch# 2.返回用户模式 Switch#exit Press RETURN to get started! Switch> 配置模式: 全局配置模式[主机名(config)#]:配置交换机的整体参数 子模式: 1.线路配置模式[主机名(config-line)#]:配置交换机的线路参数 2.接口配置模式[主机名(config-if)#]:配置交换机的接口参数 1.进入全局配置模式下 Switch#configure terminal Switch(config)#exit Switch# 2.进入线路配置模式 Switch(config)#line console 0 Switch(config-line)#exit Switch(config)# 3.进入接口配置模式 Switch(config)#interface fastEthernet 0/1 Switch(config-if)#exit Switch(config)# 从子模式下直接返回特权模式 Switch(config-if)#end Switch# 交换机操作帮助特点: 1.支持命令简写(按TAB键将命令补充完整) 2.在每种操作模式下直接输入“?”显示该模式下所有的命令 3.命令空格“?”显示命令参数并对其解释说明 4.字符“?”显示以该字符开头的命令 5.命令历史缓存: (Ctrl+P)显示上一条命令,(Ctrl+N)显示下一条命令 6.错误提示信息 交换机显示命令: 显示交换机硬件及软件的信息Switch#show version 显示当前运行的配置参数Switch#show running-config 显示保存的配置参数Switch#show configure 常用交换机EXEC命令 将当前运行的配置参数复制到flash:Switch#write memory Building configuration... [OK]

锐捷交换机配置命令

锐捷交换机配置命令 交换机基本操作: 1.进入特权模式 Switch>enable Switch# 2.返回用户模式 Switch#exit Press RETURN to get started! Switch> 配置模式: 全局配置模式[主机名(config)#]:配置交换机的整体参数 子模式: 1.线路配置模式[主机名(config-line)#]:配置交换机的线路参数 2.接口配置模式[主机名(config-if)#]:配置交换机的接口参数 1.进入、退出全局配置模式 Switch#configure terminal Switch(config)#exit Switch# 2.进入、退出线路配置模式 Switch(config)#line console 0 Switch(config-line)#exit Switch(config)# 3.进入、退出接口配置模式 Switch(config)#interface fastEthernet 0/1 Switch(config-if)#exit Switch(config)#

从子模式下直接返回特权模式 Switch(config-if)#end Switch# 交换机操作帮助: 1.支持命令简写(按TAB键将命令补充完整) 2.在每种操作模式下直接输入“?”显示该模式下所有的命令 3.命令空格“?”显示命令参数并对其解释说明 4. “字符?”显示以该字符开头的命令 5.命令历史缓存: (Ctrl+P)显示上一条命令,(Ctrl+N)显示下一条命令 6.错误提示信息 交换机显示命令: 显示交换机硬件及软件的信息 Switch#show version 显示当前运行的配置参数 Switch#show running-config 显示保存的配置参数 Switch#show configure 常用交换机EXEC命令: 1.将当前运行的配置参数复制到flash: Switch#write memory Building configuration... [OK] Switch# 2.清空flash中的配置参数: Switch#delete flash:config.text Switch# 3.交换机重新启动:

锐捷基本配置命令

S3750>enable 特权模式 S3750#configure terminal 全局模式 S3750(config)#hostname SW1 将交换机命名为SW1 SW1(config)#vlan 10 创建VLAN 10 SW1(config-vlan)#name 1 命名VLAN 10 为1 SW1(config-vlan)#exit 退出到上一级 SW1(config)#vlan 20 创建VLAN 20 SW1(config-vlan)#name 2命名VLAN 20 为2 SW1(config-vlan)#exit退出到上一级 SW1(config)#interface fastEthernet 0/1进入端口0/1 SW1(config-if)#no shutdown启用端口 SW1(config-if)#shutdown禁用端口 SW1(config-if)#exit退出到上一级 SW1(config)#interface range fastEthernet 0/2-5进入端口2-5端口SW1(config-if-range)#switchport mode access将端口配置为access 模式 SW1(config-if-range)#switchport access vlan 1 将端口划分给VLAN 1 SW1(config-if-range)#exit 退出到上一级 SW1(config)#interface range fastEthernet 0/6-10 进入6-10端口SW1(config-if-range)#switchport mode access 将端口配置为access模式

锐捷网络交换机常用命令

锐捷网络 交换机常用操作命令手册 目录 一、交换机配置模式介绍 3 二、交换机基本配置 3 2.1 接口介质类型配置 4 2.2 接口速度/双工配置 5 2.3 VLAN配置 6 2.4 端口镜像 9 2.5 端口聚合 10 2.6 交换机堆叠 11 2.7 ACL配置 12 2.8 端口安全 14 2.9 交换机防攻击配置 16 2.10 DHCP配置 21 2.11 三层交换机配置 22 三、交换机常用查看命令 24 一、交换机配置模式介绍 交换机配置模式主要有: ? 用户模式:此模式只可以简单的查看一些交换机的配置和一些简单的修改。 Switch> ? 特权模式:此模式可以查看一些交换机的配置,后面讲述的很多show命令便是在此模式下进行的,还可以对一些简单的设置配置,例如时间。 Switch> enable //在用户模式下输入enable将进入配置模式 Switch# ? 全局配置模式:此模式下可以进行对交换机的配置,例如:命名、配置密码、设路由等。

Switch#configure erminal //特权模式下可以通过config terminal 命令进入配置模式 Switch(config)# ? 端口配置模式:此模式下对端口进行配置,如配置端口ip等。 Switch(config)#interface gigabitEthernet 1/1 //配置模式下输入interface gigabitEthernet 1/1 进入到端口g 1/1接口模式。 二、交换机基本配置 ? 交换机命名: 在项目实施的时候,建议为处于不同位置的交换机命名,便于记忆,可提高后期管理效率。 switch(config)#hostname ruijie //ruijie为该交换机的名字 ? 交换机配置管理密码: 配置密码可以提高交换机的安全性,另外,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表示为特权密码 ? 交换机配置管理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,养成习惯,无论配置什么设备,都使用一下这个命令? 交换机配置网关: switch(config)#ip default-gateway 192.168.1.254 //假设网关地址为192.168.1.254,此命令用户二层设备。 通过以上几个命令的配置,设备便可以实现远程管理,在项目实施时(尤其是设备位置比较分散)特别能提高效率。 2.1 接口介质类型配置 锐捷为了降低SME客户的总体拥有成本,推出灵活选择的端口形式:电口和光口复用接口,方便用户根据网络环境选择对应的介质类型。 但光口和电口同时只能用其一,如图1,如使用了光口1F,则电口1不能使用。 图1 接口介质类型的转换:

锐捷交换机命令集合

锐捷交换机常用命令集合 交换机 >Enable 进入特权模式 #Exit 返回上一级操作模式 #End 返回到特权模式 #write memory 或copy running-config startup-config 保存配置文件 #del flash:config.text 删除配置文件(交换机及1700系列路由器) #erase startup-config 删除配置文件(2500系列路由器) #del flash:vlan.dat 删除Vlan配置信息(交换机) #Configure terminal 进入全局配置模式 (config)# hostname switchA 配置设备名称为switchA (config)#banner motd & 配置每日提示信息&为终止符 (config)#enable secret level 1 0 star 配置远程登陆密码为star (config)#enable secret level 15 0 star 配置特权密码为star Level 1为普通用户级别,可选为1~15,15为最高权限级别;0表示密码不加密(config)#enable services web-server 开启交换机WEB管理功能 Services 可选以下:web-server(WEB管理)、telnet-server(远程登陆)等 查看信息 #show running-config 查看当前生效的配置信息 #show interface fastethernet 0/3 查看F0/3端口信息 #show interface serial 1/2 查看S1/2端口信息 #show interface 查看所有端口信息 #show ip interface brief 以简洁方式汇总查看所有端口信息 #show ip interface 查看所有端口信息 #show version 查看版本信息 #show mac-address-table 查看交换机当前MAC地址表信息 #show running-config 查看当前生效的配置信息 #show vlan 查看所有VLAN信息 #show vlan id 10 查看某一VLAN (如VLAN10)的信息 #show interface fastethernet 0/1 switchport 查看某一端口模式(如F 0/1) #show aggregateport 1 summary 查看聚合端口AG1的信息 #show spanning-tree 查看生成树配置信息 #show spanning-tree interface fastethernet 0/1 查看该端口的生成树状态 #show port-security 查看交换机的端口安全配置信息 #show port-security address 查看地址安全绑定配置信息 #show ip access-lists listname 查看名为listname的列表的配置信息 #show access-lists

锐捷三层交换机命令大全

交换机>Enable 进入特权模式 #Exit 返回上一级操作模式 #E nd 返回到特权模式 #write memory 或 copy running-config startup-config #del flash:con fig.text #erase startup-c onfig #del flash:vla n. dat #Con figure termi nal (con fig)# host name switchA (con fig)#ba nner motd & (con fig)#e nable secret level 1 0 star (con fig)#e nable secret level 15 0 star Level 1为普通用户级别,可选为1~15, 加密 (con fig)#e nable services web-server Services 可选以下:web-server(WEB 管 理)、telnet-server( 远程登陆)等 查看信息 #show runnin g-co nfig 查看当前生效的配置信息 #show in terface fastethernet 0/3 查看 F0/3 端口信息 #show in terface serial 1/2 查看 S1/2 端口信息 #show in terface 查看所有端口信息 #show ip in terface brief 以简洁方式汇总查看所有端口信息 #show ip in terface 查看所有端口信息 #show version 查看版本信息 #show mac-address-table 查看交换机当前MAC 地址表信息 #show runnin g-co nfig 查看当前生效的配置信息 #show vlan 查看所有VLAN 言息 #show vlan id 10 查看某一 VLAN (如 VLAN10的信息 #show in terface fastethernet 0/1 switchport 查看某一端口模式 (如 F 0/1) #show aggregateport 1 summary 查看聚合端口 AG1 的信息 #show spa nnin g-tree 查看生成树配置信息 #show spa nnin g-tree in terface fastethernet 0/1 查看该端口的生成树 状态 #show port-security 查看交换机的端口安全配置信息 #show port-security address 查看地址安全绑定配置信息 #show ip access-lists list name 查看名为list name 的列表的配置信息 #show access-lists 端口的基本配置 保存配置文件 删除配置文件(交换机及1700系列路由器) 删除配置文件(2500系列路由器) 删除Vian 配置信息(交换机) 进入全局配置模式 配置设备名称为switchA 配置每日提示信息&为终止符 配置远程登陆密码为star 配置特权密码为star 15为最高权限级别;0表示密码不 开启交换机WEB 管理功能

锐捷设备配置命令行简介-基本上等同于cisco命令行

锐捷设备配置命令行简介-基本上等 同于cisco命令行 2010-04-07 13:47 交换机配置命令模式 EXEC模式: 用户模式switch> 交换机信息的查看,简单测试命令 特权模式switch# 查看、管理交换机配置信息,测试、调试 配置模式: 全局配置模式switch(config)# 配置交换机的整体参数 接口配置模式switch(conf-if)# 配置交换机的接口参数 进入全局配置模式 Switch#conf t Switch(config)#exit 进入接口配置模式 Switch(config)#interface fastethernet 0/1 Switch(conf-if)#exit 从子模式下直接返回特权模式

Switch(conf-if)#end 命令行其他功能:获得帮助 switch#? switch#show ? 命令简写 全写:switch# configure terminal 简写:Switch# config t 使用历史命令 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 (conf-if)#no shutdown Switch (conf-if)#ip address 192.168.1.1 255.255.255.0 Switch (conf-if)#end 配置文件的管理 保存配置

锐捷交换机配置命令

精心整理 锐捷交换机配置命令 交换机基本操作: 1.进入特权模式 Switch>enable Switch# 2.返回用户模式 Switch> 子模式: 1.2.1.Switch# 2.3.进入、退出接口配置模式 Switch(config)#interfacefastEthernet0/1 Switch(config-if)#exit Switch(config)# 从子模式下直接返回特权模式 Switch(config-if)#end Switch#

交换机操作帮助: 1.支持命令简写(按TAB键将命令补充完整) 2.在每种操作模式下直接输入“?”显示该模式下所有的命令 3.命令空格“?”显示命令参数并对其解释说明 4.“字符?”显示以该字符开头的命令 5.命令历史缓存:(Ctrl+P)显示上一条命令,(Ctrl+N)显示下一条命令 6.错误提示信息 交换机显示命令: 1. [OK] Switch# 2.清空 Switch# 3. Proceedwithreload?[confirm] 4.配置交换机主机名: Switch(config)#hostnameS2126G-1 S2126G-1(config)# 5.配置交换机口令: 1)配置交换机的登陆密码 S2126G(config)#enablesecretlevel10star “0”表示输入的是明文形式的口令 2)配置交换机的特权密码

S2126G(config)#enablesecretlevel150star “0”表示输入的是明文形式的口令 常用交换机配置命令: 1、为交换机分配管理IP地址 S2126G(config)#interfacevlan1 S2126G(config-if)#ipaddress{IPaddress}{IPsubnetmask}[secondary] 2、将接口启用 S2126G(config-if)#noshutdown 3 4 5 从TFTP 1、查看 2、配置MAC地址表记录的生存时间(缺省为300秒) S2126G(config)#mac-address-tableaging-time<10-1000000> 3、查看MAC地址表记录的生存时间 S2126G#showmac-address-tableaging-time VLAN的配置: 1.添加一个VLAN S2126G(config)#vlan<1-4094> S2126G(config-vlan)# 2.为VLAN命名

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