導航:首頁 > 程序命令 > 銳捷交換機保存命令

銳捷交換機保存命令

發布時間:2024-02-09 10:55:19

⑴ 銳捷交換機保存配置是哪條命令

保存在交換機上所做的配置
SwitchA# running-config startup-config ! 保存交換機配置
或:
SwitchA# write memory

⑵ 關於銳捷交換機配置

交換機基本操作

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 fastEther 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]

Switch#

清空flash中的配置參數:Switch#delete flash:config.text

Switch#

交換機重新啟動:Switch#reload

System configuration has been modified. Save? [yes/no]:n

Proceed with reload? [confirm]

配置交換機主機名:Switch(config)#hostname S2126G

S2126G(config)#

配置交換機口令:

1、 配置交換機的登陸密碼

S2126G(config)#enable secret level 1 0 star

「0」表示輸入的是明文形式的口令

2、 配置交換機的特權密碼

S2126G(config)#enable secret level 15 0 Star

「0」表示輸入的是明文形式的口令

常用交換機配置命令:

1、為交換機分配管理IP地址

S2126G(config)#interface vlan 1

S2126G(config-if)#ip address {IP address} {IP submask}[secondary]

2、將介面啟用

S2126G(config-if)#no shutdown

3、將介面關閉

S2126G(config-if)#shutdown

4、配置介面速率

S2126G(config-if)#speed [10|100|auto]

5、配置介面雙工模式

S2126G(config-if)#plex [auto|full|half

顯示介面狀態:S2126G#show interfaces

測定目的端的可達性:S2126G>ping {IP address}

從TFTP伺服器下載配置參數:S2126G# tftp startup-config

管理交換機MAC地址表:

1、查看MAC地址表

S2126G#show mac-address-table

2、配置MAC地址表記錄的生存時間(預設為300秒)

S2126G(config)#mac-address-table aging-time <10-1000000>

3、查看MAC地址表記錄的生存時間

S2126G#show mac-address-table aging-time

VLAN的配置:

1.添加一個VLAN

S2126G(config)#vlan <1-4094>

S2126G(config-vlan)#

2.為VLAN命名(可選)

S2126G(config-vlan)#name

將交換機埠分配到VLAN

1.配置Port VLAN

Switch(config-if)#switchport access vlan <1-4094>

2.配置Tag VLAN

Switch(config-if)#switchport mode trunk

1).配置本地(native)VLAN

Switch(config-if)#switchport trunk native vlan <1-4094>

2).從主幹鏈路中清除VLAN

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

注:VLAN1不可被清除

VLAN的驗證:

1.顯示全部的VLAN:Switch#show vlan

2.顯示單獨的VLAN :Switch#show vlan id <1-4094>

將VLAN信息保存到flash中:Switch#write memory

從flash中清除VLAN信息:Switch#delete flash:vlan.dat

RSTP的配置:

1.啟用生成樹:S2126G(config)#spanning-tree

2.配置交換機優先順序:S2126G(config)#spanning-tree priority <0-61440>

「0」或「4096」的倍數(RSTP BPDU該值後12bit全0)

3.配置交換機埠優先順序:S2126G(config-if)#spanning-tree port-priority <0-240>

「0」或「16」的倍數(RSTP BPDU該值後4bit全0)

4、生成樹hello時間的配置(由Root決定):S2126G(config)#spanning-tree hello-time <1-10>

5、生成樹的驗證:Switch#show spanning-tree

Switch#show spanning-tree interface <介面名稱> <介面編號>

以上用於銳捷交換機的。

交換機配置命令集>Enable 進入特權模式

#ExIT 返回上一級操作模式

#End 返回到特權模式

#write memory 或 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管理)、tel-server(遠程登陸)等查看信息

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

#show interface fastether 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 fastether 0/1 switchport 查看某一埠模式(如F 0/1)

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

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

#show spanning-tree interface fastether 0/1 查看該埠的生成樹狀態

#show port-security 查看交換機的埠安全配置信息

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

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

#show access-lists埠的基本配置

(config)#Interface fastether 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)#plex 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的倍數。

交換機默認值為32768VLAN的基本配置

(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使用,例如,使用Tel的方式登錄的IP地址

(config-if)# no shutdown 啟用該埠埠安全

(config)# interface fastether 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 fastether 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)# work 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)# work 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 拒絕源地址為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-包含)

:埠號,可使用名稱或具體編號

可以使用的協議名稱(或編號)和埠名稱(或編號)請打?查詢。

(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進行允許通過處理。

⑶ 思科交換機的配置命令和銳捷交換機、華為交換機之間可以通用嗎

思科與銳捷的命令差異不大,與華為的命令就是單詞不一樣,但是同一個意思的單詞像 show 與 display
用戶模式:r1> enable 到特權模式
特權模式下:
disable 退出到用用戶模式,但是不屏顯
Show version 查看系統 硬體 軟體信息版本
Show running-configuration 查看路由器中正在運行(RAM中)的配置 簡寫 sh run,斷電會丟失
show starting-configuration 查看NVRAM中的配置信息。配置在這裡面斷電不會丟失
running-config startup-config 將RAM中的配置保存到NVRAM中
r1#write 保存配置文件到 startup-config 里
Show interfaces 介面 查看相應的介面
Show cdp neighbors 查看所有連接到這個介面的路由器信息 cdp=思科發現協議
Show cdp neighbors detail 查看連接到這個介面設備的更詳細信息
r1#sh ip interface brief 查看介面狀態
r1#show history 顯示最近使用的命令
r1#reload 重新啟動路由器
r1#erase nvram 清除nvram裡面的文件
r1#erase startup-config 功能一樣清除啟動文件

全局模式下:r1# configure terminal 簡寫conf t 到全局模式
r1(config)#
hostname 名字 為路由器命名 注意:名字不可以有空格
no ip domain-lookup 取消域名解析查找
ip default-gateway 配置網關
r1(config)#router rip 進入路由配置模式
r1(config-if)#intterface f0/0.1 進入F0的子介面
r1(config)#interface loopback 0 進入環衛口
r1(config)#line console 0 進入console口
r1(config)#line vty 0 進入VTY 0口
r1(config-if)#ip address 為埠配置IP地址

R1(config)#line console 0
R1(config-line)#exec-timeout 0 0 設置不超時 組織會話退出

R1(config)#no ip domain-lookup 禁止域名解析

R1(config)#line con 0
R1(config-line)#logging synchronous 同步輸入命令(正在輸入命令時被上一條提示信息覆蓋,輸入此命令可以不受干擾)
R1(config)#banner motd # 輸入你想說的話 類似於剛開進入IOS 提醒 聲明 警告界面一樣 #退出輸入界面

實驗配置預先配置:
1.Router(config)#line console 0
Router(config-line)#exec-timeout 0 0 設置不超時

2. Router(config)#ip domain-lookup 禁止域名解析

3. Router(config)#line con 0
Router(config-line)#logging synchronous 同步輸入命令

⑷ 三家交換機配置命令詳解(華為、H3C、銳捷)

一、華為交換機基礎配置命令

1、創建vlan:

//用戶視圖,也就是在Quidway模式下運行命令。

system-view //進入配置視圖

[Quidway] vlan 10 //創建vlan 10,並進入vlan10配置視圖,如果vlan10存在就直接進入vlan10配置視圖

[Quidway-vlan10] quit //回到配置視圖

[Quidway] vlan 100 //創建vlan 100,並進入vlan100配置視圖,如果vlan10存在就直接進入vlan100配置視圖

[Quidway-vlan100] quit //回到配置視圖

2、將埠加入到vlan中:

[Quidway] interface GigabitEthernet2/0/1 (10G光口)

[Quidway- GigabitEthernet2/0/1] port link-type access //定義埠傳輸模式

[Quidway- GigabitEthernet2/0/1] port default vlan 100 //將埠加入vlan100

[Quidway- GigabitEthernet2/0/1] quit //回到配置視圖

[Quidway] interface GigabitEthernet1/0/0 //進入1號插槽上的第一個千兆網口配置視圖中。0代表1號口

[Quidway- GigabitEthernet1/0/0] port link-type access //定義埠傳輸模式

[Quidway- GigabitEthernet2/0/1] port default vlan 10 //將這個埠加入到vlan10中

[Quidway- GigabitEthernet2/0/1] quit

3、將多個埠加入到VLAN中

system-view

[Quidway]vlan 10

[Quidway-vlan10]port GigabitEthernet 1/0/0 to 1/0/29 //將0到29號口加入到vlan10中

[Quidway-vlan10]quit

4、交換機配置IP地址

[Quidway] interface Vlanif100 // 進入vlan100介面視圖與vlan 100命令進入的地方不同

[Quidway-Vlanif100] ip address 119.167.200.90 255.255.255.252 // 定義vlan100管理IP三層 交換網關路由

[Quidway-Vlanif100] quit //返回視圖

[Quidway] interface Vlanif10 // 進入vlan10介面視圖與vlan 10命令進入的地方不同

[Quidway-Vlanif10] ip address 119.167.206.129 255.255.255.128 // 定義vlan10管理IP三層交換網關路由

[Quidway-Vlanif10] quit

5、配置默認網關:

[Quidway]ip route-static 0.0.0.0 0.0.0.0 119.167.200.89 //配置默認網關。

6、 交換機保存設置和重置命令

save //保存配置信息

reset saved-configuration //重置交換機的配置

reboot //重新啟動交換機

7、交換機常用的顯示命令

用戶視圖模式下:

display current-configuration //顯示現在交換機正在運行的配置明細

display device //顯示各設備狀態

display interface ? //顯示個埠狀態,用?可以查看後邊跟的選項

display version //查看交換機固件版本信息

display vlan ? // 查看vlan的配置信息

8、恢復交換機出廠設置

reset saved-configuration //重置交換機的配置

二、H3C交換機的基本配置

我們先來了解下h3c的配置命令與功能,都是常用的,基本上大部分網路配置都少不了這些命令。

1、基本配置

//用戶直行模式提示符,用戶視圖

system-view //進入配置視圖

[H3C] sysname xxx //設置主機名成為xxx這里使用修改特權用戶密碼

2、用戶配置

system-view

[H3C]super password H3C //設置用戶分級密碼

[H3C]undo superpassword //刪除用戶分級密碼

[H3C]localuser bigheap 1234561 //Web網管用戶設置,1為管理級用戶

[H3C]undo localuser bigheap //刪除Web網管用戶

[H3C]user-interface aux 0 //只支持0

[H3C-Aux]idle-timeout 250 //設置超時為2分50秒,若為0則表示不超時,默認為5分鍾

[H3C-Aux]undoidle-timeout //恢復默認值

[H3C]user-interface vty 0 //只支持0和1

[H3C-vty]idle-timeout 250 //設置超時為2分50秒,若為0則表示不超時,默認為5分鍾

[H3C-vty]undoidle-timeout //恢復默認值

[H3C-vty]set authentication password123456 //設置telnet密碼,必須設置

[H3C-vty]undo set authenticationpassword //取消密碼

[H3C]displayusers //顯示用戶

[H3C]displayuser-interface //用戶界面狀態

3、vlan配置

[H3C]vlan 2 //創建VLAN2

[H3C]undo vlanall //刪除除預設VLAN外的所有VLAN,預設VLAN不能被刪除

[H3C-vlan2]port Ethernet 0/4 to Ethernet0/7 //將4到7號埠加入到VLAN2中,此命令只能用來加access埠,不能用來增加trunk或者hybrid埠

[H3C-vlan2]port-isolate enable //打開VLAN內埠隔離特性,不能二層轉發,默認不啟用該功能

[H3C-Ethernet0/4]port-isolate uplink-portvlan 2 //設置4為VLAN2的隔離上行埠,用於轉發二層數據,只能配置一個上行埠,若為trunk,則建議允許所有VLAN通過,隔離不能與匯聚同時配置

[H3C]display vlan all //顯示所有VLAN的詳細信息

[H3C]user-group 20 //創建user-group 20,默認只存在user-group 1

[H3C-UserGroup20]port Ethernet 0/4 toEthernet 0/7 //將4到7號埠加入到VLAN20中,初始時都屬於user-group 1中

[H3C]display user-group 20 //顯示user-group 20的相關信息

四、交換機ip配置

[H3C]vlan 20 //創建vlan

[H3C]management-vlan 20 //管理vlan

[H3C]interface vlan-interface 20 //進入並管理vlan20

[H3C]undo interface vlan-interface 20 //刪除管理VLAN埠

[H3C-Vlan-interface20]ip address192.168.1.2 255.255.255.0 //配置管理VLAN介面靜態IP地址

[H3C-Vlan-interface20]undo ipaddress //刪除IP地址

[H3C-Vlan-interface20]ip gateway 192.168.1.1 //指定預設網關(默認無網關地址)

[H3C-Vlan-interface20]undo ip gateway

[H3C-Vlan-interface20]shutdown //關閉介面

[H3C-Vlan-interface20]undo shutdown //開啟

[H3C]display ip //顯示管理VLAN介面IP的相關信息

[H3C]display interface vlan-interface20 //查看管理VLAN的介面信息

debugging ip //開啟IP調試功能

undo debugging ip

5、DHCP客戶端配置

[H3C-Vlan-interface20]ip address dhcp-alloc // 管理VLAN介面通過DHCP方式獲取IP地址

[H3C-Vlan-interface20]undo ip address dhcp-alloc // 取消

[H3C]display dhcp //顯示DHCP客戶信息

debugging dhcp-alloc //開啟DHCP調試功能

undo debugging dhcp-alloc

6、埠配置

[H3C]interface Ethernet0/3 //進入埠

[H3C-Ethernet0/3]shutdown //關閉埠

[H3C-Ethernet0/3]speed 100 //速率可為10,100,1000和auto(預設)

[H3C-Ethernet0/3]plexfull //雙工,可為half,full和auto,光口和匯聚後不能配置

[H3C-Ethernet0/3]flow-control //開啟流控,默認為關閉

[H3C-Ethernet0/3]broadcast-suppression 20 //設置抑制廣播百分比為20%,可取5,10,20,100,預設為100,同時組播和未知單播也受此影響

[H3C-Ethernet0/3]loopback internal //內環測試

[H3C-Ethernet0/3]port link-type trunk //設置鏈路的類型為trunk

[H3C-Ethernet0/3]port trunk pvid vlan 20 //設置20為該trunk的預設VLAN,默認為1(trunk線路兩端的PVID必須一致)

[H3C-Ethernet0/3]port access vlan 20 //將當前access埠加入指定的VLAN

[H3C-Ethernet0/3]port trunk permit vlanall //允許所有的VLAN通過當前的trunk埠,可多次使用該命令

[H3C-Ethernet0/3]mdiauto //設置以太埠為自動監測,normal為直通線,across為交叉線

[H3C]link-aggregation Ethernet 0/1 toEthernet 0/4 //將1-4口加入匯聚組,1為主埠,兩端需要同時配置,設置了埠鏡像以及埠隔離的埠無法匯聚

[H3C]undo link-aggregation Ethernet 0/1 //刪除該匯聚組

[H3C]link-aggregation mode egress

⑸ 華為、H3C、銳捷交換機配置命令大全

對於 華為、H3C、銳捷 交換機的命令配置,三家交換機的配置命令容易弄混,經常在實際項目配置中出錯,因此,本期我把這三家交換機的基礎配置命令顯示在這里,大家可以分別來看下他們的命令有什麼不同。

為了讓大家更加清楚,每行代碼都有解釋。

一、華為交換機基礎配置命令

1、創建vlan:

//用戶視圖,也就是在Quidway模式下運行命令。

system-view //進入配置視圖

[Quidway] vlan 10 //創建vlan 10,並進入vlan10配置視圖,如果vlan10存在就直接進入vlan10配置視圖

[Quidway-vlan10] quit //回到配置視圖

[Quidway] vlan 100 //創建vlan 100,並進入vlan100配置視圖,如果vlan10存在就直接進入vlan100配置視圖

[Quidway-vlan100] quit //回到配置視圖

2、將埠加入到vlan中:

[Quidway] interface GigabitEthernet2/0/ // (10G光口)

[Quidway- GigabitEthernet2/0/1] port link-type access //定義埠傳輸模式

[Quidway- GigabitEthernet2/0/1] port default vlan 100 //將埠加入vlan100

[Quidway- GigabitEthernet2/0/1] quit //回到配置視圖

[Quidway] interface GigabitEthernet1/0/0 //進入1號插槽上的第一個千兆網口配置視圖中。0代表1號口

[Quidway- GigabitEthernet1/0/0] port link-type access //定義埠傳輸模式

[Quidway- GigabitEthernet2/0/1] port default vlan 10 //將這個埠加入到vlan10中

[Quidway- GigabitEthernet2/0/1] quit //退出

3、將多個埠加入到VLAN中

system-view

[Quidway]vlan 10

[Quidway-vlan10]port GigabitEthernet 1/0/0 to 1/0/29 //將0到29號口加入到vlan10中

[Quidway-vlan10]quit

4、交換機配置IP地址

[Quidway] interface Vlanif100 // 進入vlan100介面視圖與vlan 100命令進入的地方不同

[Quidway-Vlanif100] ip address 119.167.200.90 255.255.255.252 // 定義vlan100管理IP三層 交換網關路由

[Quidway-Vlanif100] quit //返回視圖

[Quidway] interface Vlanif10 // 進入vlan10介面視圖與vlan 10命令進入的地方不同

[Quidway-Vlanif10] ip address 119.167.206.129 255.255.255.128 // 定義vlan10管理IP三層交換網關路由

[Quidway-Vlanif10] quit

5、配置默認網關:

[Quidway]ip route-static 0.0.0.0 0.0.0.0 119.167.200.89 //配置默認網關。

6、 交換機保存設置和重置命令

save //保存配置信息

reset saved-configuration //重置交換機的配置

reboot //重新啟動交換機

7、交換機常用的顯示命令

用戶視圖模式下:

display current-configuration //顯示現在交換機正在運行的配置明細

display device //顯示各設備狀態

display interface ? //顯示個埠狀態,用?可以查看後邊跟的選項

display version //查看交換機固件版本信息

display vlan ? // 查看vlan的配置信息

8、恢復交換機出廠設置

reset saved-configuration //重置交換機的配置

二、H3C交換機的基本配置

我們先來了解下h3c的配置命令與功能,都是常用的,基本上大部分網路配置都少不了這些命令。

1、基本配置

//用戶直行模式提示符,用戶視圖

system-view //**進入配置視圖**

[H3C] sysname xxx //設置主機名成為xxx這里使用修改特權用戶密碼

2、用戶配置

system-view

[H3C]super password H3C //設置用戶分級密碼

[H3C]undo superpassword //刪除用戶分級密碼

[H3C]localuser bigheap 1234561 //Web網管用戶設置,1為管理級用戶

[H3C]undo localuser bigheap //刪除Web網管用戶

[H3C]user-interface aux 0 //只支持0

[H3C-Aux]idle-timeout 250 //設置超時為2分50秒,若為0則表示不超時,默認為5分鍾

[H3C-Aux]undoidle-timeout //恢復默認值

[H3C]user-interface vty 0 //只支持0和1

[H3C-vty]idle-timeout 250 //設置超時為2分50秒,若為0則表示不超時,默認為5分鍾

[H3C-vty]undoidle-timeout //恢復默認值

[H3C-vty]set authentication password123456 //設置telnet密碼,必須設置

[H3C-vty]undo set authenticationpassword //取消密碼

[H3C]displayusers //顯示用戶

[H3C]displayuser-interface //用戶界面狀態

3、vlan配置

[H3C]vlan 2 //創建VLAN2

[H3C]undo vlanall //刪除除預設VLAN外的所有VLAN,預設VLAN不能被刪除

[H3C-vlan2]port Ethernet 0/4 to Ethernet0/7 //將4到7號埠加入到VLAN2中,此命令只能用來加access埠,不能用來增加trunk或者hybrid埠

[H3C-vlan2]port-isolate enable //打開VLAN內埠隔離特性,不能二層轉發,默認不啟用該功能

[H3C-Ethernet0/4]port-isolate uplink-portvlan 2 //設置4為VLAN2的隔離上行埠,用於轉發二層數據,只能配置一個上行埠,若為trunk,則建議允許所有VLAN通過,隔離不能與匯聚同時配置

[H3C]display vlan all //顯示所有VLAN的詳細信息

[H3C]user-group 20 //創建user-group 20,默認只存在user-group 1

[H3C-UserGroup20]port Ethernet 0/4 toEthernet 0/7 //將4到7號埠加入到VLAN20中,初始時都屬於user-group 1中

[H3C]display user-group 20 //顯示user-group 20的相關信息

4、交換機ip配置

[H3C]vlan 20 //創建vlan

[H3C]management-vlan 20 //管理vlan

[H3C]interface vlan-interface 20 //進入並管理vlan20

[H3C]undo interface vlan-interface 20 //刪除管理VLAN埠

[H3C-Vlan-interface20]ip address192.168.1.2 255.255.255.0 //配置管理VLAN介面靜態IP地址

[H3C-Vlan-interface20]undo ipaddress //刪除IP地址

[H3C-Vlan-interface20]ip gateway 192.168.1.1 //指定預設網關(默認無網關地址)

[H3C-Vlan-interface20]undo ip gateway

[H3C-Vlan-interface20]shutdown //關閉介面

[H3C-Vlan-interface20]undo shutdown //開啟

[H3C]display ip //顯示管理VLAN介面IP的相關信息

[H3C]display interface vlan-interface20 //查看管理VLAN的介面信息

debugging ip //開啟IP調試功能

undo debugging ip

5、DHCP客戶端配置

[H3C-Vlan-interface20]ip address dhcp-alloc // 管理VLAN介面通過DHCP方式獲取IP地址

[H3C-Vlan-interface20]undo ip address dhcp-alloc // 取消

[H3C]display dhcp //顯示DHCP客戶信息

debugging dhcp-alloc //開啟DHCP調試功能

undo debugging dhcp-alloc

6、埠配置

[H3C]interface Ethernet0/3 //進入埠

[H3C-Ethernet0/3]shutdown //關閉埠

[H3C-Ethernet0/3]speed 100 //速率可為10,100,1000和auto(預設)

[H3C-Ethernet0/3]plexfull //雙工,可為half,full和auto,光口和匯聚後不能配置

[H3C-Ethernet0/3]flow-control //開啟流控,默認為關閉

[H3C-Ethernet0/3]broadcast-suppression 20 //設置抑制廣播百分比為20%,可取5,10,20,100,預設為100,同時組播和未知單播也受此影響

[H3C-Ethernet0/3]loopback internal //內環測試

[H3C-Ethernet0/3]port link-type trunk //設置鏈路的類型為trunk

[H3C-Ethernet0/3]port trunk pvid vlan 20 //設置20為該trunk的預設VLAN,默認為1(trunk線路兩端的PVID必須一致)

[H3C-Ethernet0/3]port access vlan 20 //將當前access埠加入指定的VLAN

[H3C-Ethernet0/3]port trunk permit vlanall //允許**所有的VLAN通過當前的trunk埠,可多次使用該命令

[H3C-Ethernet0/3]mdiauto //設置以太埠為自動監測,normal為直通線,across為交叉線

[H3C]link-aggregation Ethernet 0/1 toEthernet 0/4 //將1-4口加入匯聚組,1為主埠,兩端需要同時配置,設置了埠鏡像以及埠隔離的埠無法匯聚

[H3C]undo link-aggregation Ethernet 0/1 //刪除該匯聚組

[H3C]link-aggregation mode egress //配置埠匯聚模式為根據目的MAC地址進行負荷分擔,可選為 ingress,egress和both,預設為both

[H3C]monitor-port Ethernet 0/2 //將該埠設置為鏡像埠,必須先設置鏡像埠,刪除時必須先刪除被鏡像埠,而且它們不能同在一個埠,該埠不能在匯聚組中,設置新鏡像埠時,新取代舊,被鏡像不變

[H3C]mirroring-port Ethernet 0/3 toEthernet 0/4 both //將埠3和4設置為被鏡像埠,both為同時監控接收和發送的報文,inbound表示僅監控接收的報文,outbound表示僅監控發送的報文

[H3C]display mirror

[H3C]display interface Ethernet 0/3

resetcounters //清除所有埠的統計信息

[H3C]display link-aggregation Ethernet0/3 //顯示埠匯聚信息

[H3C-Ethernet0/3]virtual-cable-test //診斷該埠的電路狀況

7、qos優先順序配置

QoS配置步驟:設置埠的優先順序,設置交換機信任報文的優先順序方式,隊列調度,埠限速

[H3C-Ethernet0/3]priority 7 //設置埠優先順序為7,默認為0

[H3C]priority-trustcos //設置交換機信任報文的優先順序方式為cos(802.1p優先順序,預設值),還可以設為dscp方式

[H3C]queue-scheler hq-wrr 2 4 6 8 //設置隊列調度演算法為HQ-WRR(默認為WRR),權重為2,4,6,8

[H3C-Ethernet0/3]line-rate inbound 29 //將埠進口速率限制為2Mbps,取1-28時,速率為rate*8*1024/125,即64,128,192...1.792M;

29-127時,速率為(rate-27)*1024,即2M,3M,4M...100M。

[H3C]displayqueue-scheler //顯示隊列調度模式及參數

[H3C]displaypriority-trust //顯示優先順序信任模式

三、銳捷交換機基礎命令配置

連接上交換機後,肯定是需要進行命令配置,我們來看下基礎命令配置。

1、准備命令

>Enable //進入特權模式

#Exit //返回上一級操作模式

#End //返回到特權模式

# 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(遠程登陸)等

2、查看信息

#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 //查看某一埠模式(如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的列表的配置信息

3、埠的基本配置

(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)#plex full //配置埠為全雙工模式,可選full(全雙工),half(半雙式),auto(自適應)

(config-if)#no shutdown //開啟該埠

(config-if)#switchport access vlan 10 //將該埠劃入VLAN10中,用於VLAN

(config-if)#switchport mode trunk //將該埠設為trunk模式,可選模式為access , trunk

(config-if)#port-group 1 //將該埠劃入聚合埠AG1中,用於聚合埠

4、聚合埠的創建

(config)# interface aggregateport 1 //創建聚合介面AG1

(config-if)# switchport mode trunk //配置並保證AG1為 trunk 模式

(config)#int f0/23-24

(config-if-range)#port-group 1 //將埠(埠組)劃入聚合埠AG1中

5、生成樹

配置多生成樹協議:

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地址(另一三層交換機)

6、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 //啟用該埠

7、埠安全

(config)# interface fastethernet 0/1 //進入一個埠

(config-if)# switchport port-security //開啟該埠的安全功能

a、配置最大連接數限制

(config-if)# switchport port-secruity maxmum 1 //配置埠的最大連接數為1,最大連接數為128
(config-if)# switchport port-secruity violation shutdown
//配置安全違例的處理方式為shutdown,可選為protect (當安全地址數滿後,將未知名地址丟棄)、restrict(當違例時,發送一個Trap通知)、shutdown(當違例時將埠關閉,並發送Trap通知,可在全局模式下用errdisable recovery來恢復)

b、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地址注意用小寫)

8、三層路由功能(針對三層交換機)

(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

9、三層交換機路由協議

(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為骨幹區域)

可以明顯看出,三家命令大同小異,其實華為與H3C更加類似。

⑹ 銳捷交換機(S2320G-P為例)配置命令

  1. 為交換機分配管理IP地址

    S2126G(config)#interfacevlan1

    S2126G(config-if)#ipaddress{IPaddress}{IPsubnetmask}[secondary]

  2. 將介面啟用

    S2126G(config-if)#noshutdown

  3. 將介面關閉

    S2126G(config-if)#shutdown

  4. 配置介面速率

    S2126G(config-if)#speed[10|100|auto]

  5. 配置介面雙工模式

    S2126G(config-if)#plex[auto|full|half]

⑺ 求銳捷三層交換機常用命令

交換機配置命令類別命令格式命令含義基本配置S> enable進入特權模式S# configure terminal 進入全局配置模式S(config)# hostname name改變交換機名稱S(config)# enable password level level_# password設置用戶口令(level_#=1)或特權口令(level_#=15)S(config)# line console 0進入控制台介面S(config-line)# password console_password接上一條命令,設置控制台口令S(config)# line vty 0 15進入虛擬終端S(config-line)# password telnet_password接上一條命令,設置Telnet口令S(config-line)# login允許Telnet登錄S(config)# enable password|secret privilege_password配置特權口令(加密或不加密)S(config)# interface ethernet|fastethernet|gigabitethernet slot_#/port_#進入介面子配置模式S(config-if)# [no] shutdown關閉或啟用該介面(默認啟用)S(config)# ip address IP_address sunbet_mask指定IP地址S(config)# ip default-gateway router's_IP_address指定哪台路由器地址為默認網關S# show running-config查看當前的配置S# running-config startup-config將RAM中的當前配置保存到NVRAM中S> show interface [type slot_#/port_#]查看所有或指定介面的信息S> show ip 顯示交換機的IP配置(只在1900系列上可用)S> show version查看設備信息S# show ip interface brief驗證IP配置S(config-if)# speed 10|100|auto設置介面速率S(config-if)# plex auto|full|half設置介面雙工模式S> show mac-address-table查看CAM表S# clear mac-address-table清除CAM表中的動態條目1900(config)# mac-address-table permanent MAC_address type [slot_#/]port_#在CAM表中創建靜態條目2950(config)# mac-address-table static MAC_address vlan VLAN_# interface type [slot_#/] port_#在CAM表中創建靜態條目1900(config)# mac-address-table restricted static MAC_address source_port list_of_allowed_interface設置靜態埠安全措施1900(config-if)# port secure啟用粘性學習1900(config-if)# port secure max-mac-count value設置粘性學習特性能夠學到的地址數
太多命令了 打不完上去啊

閱讀全文

與銳捷交換機保存命令相關的資料

熱點內容
matlab實用教程pdf 瀏覽:769
伺服器加密方式哪種好 瀏覽:121
顯示加密服務超時 瀏覽:611
日語口譯pdf 瀏覽:433
外人如何評價身邊的程序員 瀏覽:105
霍夫曼編碼壓縮演算法 瀏覽:122
我想學習單片機 瀏覽:644
陳寶蓮拍過 瀏覽:336
遙調命令的設定命令實現過程 瀏覽:76
演算法中最壞情況都為多少 瀏覽:995
排序演算法圖形化展示 瀏覽:782
看電影免費網站入口 瀏覽:447
加密U盤啟動區和交換區格式化 瀏覽:247
求不需要下載播放器就能看的網站 瀏覽:828
日本重生電影在線 瀏覽:623
女的被一個小孩上了 瀏覽:948
macandroid找不到設備 瀏覽:514
漫威電影不能投屏了怎麼破 瀏覽:308
安卓qq最新版本怎麼解綁手機號 瀏覽:681
經典三極3d版古裝劇 瀏覽:172