天天看點

華為網絡裝置常用指令

華為交換機配置

端口表示方法E1/0/1

顯示系統版本資訊:display version

顯示診斷資訊:display diagnostic-information

顯示系統目前配置:display current-configuration

顯示系統儲存配置: display saved-configuration

顯示接口資訊:display interface

顯示路由資訊:display ip routing-table

顯示VLAN資訊:display vlan

顯示生成樹資訊:display stp

顯示MAC位址表:display mac-address

顯示ARP表資訊:display arp

顯示系統CPU使用率:display cpu

顯示系統記憶體使用率:display memory

顯示系統日志:display log

顯示系統時鐘:display clock

驗證配置正确後,使用儲存配置指令:save

删除某條指令,一般使用指令: undo

system-view進入配置模式

操作完畢後save儲存配置

quit退出接口模式到系統視圖

按Tab鍵可以自動跳出完整指令

1、建立VLAN

vlan 2

删除VLAN

undo vlan 2

2、把端口劃入VLAN

int e1/0/2

port access vlan 3

端口退出vlan(在vlan裡删除端口)

inter vlan 10

undo port e 1/0/1

3、設定trunk端口

port link-type trunk(access為普通端口)

4、設定SNMP

# 設定團體名為mgr,并且可以進行讀寫通路。

[Sysname] snmp-agent community write mgr

# 删除團體名comaccess。

[Sysname] undo snmp-agent community comaccess

時間同步

[Sysname] interface Vlan-interface1

[Sysname-Vlan-interface1] ntp-service broadcast-client

使用者:

local-user <>

password  simple/cipher <>

services-type  terminal/telnet/ssh

配置了認證登入後,必須配置使用者的類型,否則會出現超級終端上登入不了的情況,

同時配level 3,否則telnet後沒有相應的操作權限

5、配console

user-interface aux 0

authentication-mode scheme/password

local-user 使用者名

password cipher 密碼

service-type telnet terminal level 3

q

配Telnet

user-interface vty 0 4

authentication-mode scheme【方案】

save

一般步驟:

先建立使用者

設定密碼

設定使用者類型

配置console加密

配置telnet加密

6、更改主機名

sysname name

7、設定端口名稱 端口描述

8、設定交換機管理位址

interface Vlan-interface 1

ip address 129.12.0.1 255.255.255.0

9、備份檔案

tftp 1.1.1.1 get abc.txt efg.txt

tftp 1.1.1.1 put config.cfg temp.cfg

10、配置靜态路由:

ip route 129.1.0.0 255.255.0.0 10.0.0.2

11、恢複出廠配置

<H3C>reset saved-configuration

<H3C>reboot

出廠配置沒有使用者名和密碼,恢複出廠設定後設定的使用者名和密碼依然存在;

12、配置生成樹(預防環路發生)

stp enable

删除裝置配置

reset saved-configuration

重新開機

reboot

看目前配置檔案

display current-configuration

改裝置名

sysname

儲存配置

save

進入特權模式

sysview

華為隻有2層模式 不像cisco enale之後還要conf t

定義acl

acl nubmere XXXX(3000以上)進入以後

rule permit/deny IP/TCP/UDP等 source XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向)

destination XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向) eq

注意 華為預設沒有deny any any

防火牆上端口加載ACL

[Quidway-Ethernet0/0]firewall packet-filter 3000 inbound

防火牆上新增加使用者

local-user XXX(使用者名) password simple XXX(密碼)

local-user XXX service-type ppp

删除某條指令

undo(類似與cisco的no)

靜态路由

ip route-static 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX

對vpdn使用者設定acl的接口

inte***ce Virtual-Template1

檢視路由表

display ip routing-table

設定telnet密碼

user-inte***ce vty 0 4

user privilege level 3

set authentication password simple XXX

啟動/關閉

啟動 un shut

關閉 shut

動态nat設定

acl number 3000

rule 0 permit ip source XXX.XXX.XXX.XXX

rule 1 permit ip source XXX.XXX.XXX.XXX

rule 2 permit ip source XXX.XXX.XXX.XXX

inte***ce Ethernet1/0

description ====To-Internet(WAN)====

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

nat outbound 3000

ipsec policy policy1

利用acl來做 符合acl的IP位址可以出去(注意 此處的ACL隐含了deny any any)不符合的IP位址不可以出去

建立vlan

[shzb-crsw-s6506-1]vlan 100

華為vlan不支援name

将port放入vlan

建立了vlan後 進入vlan模式

[shzb-crsw-s6506-1-vlan100]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/8

表示從G1/0/1 到1/0/8放入VLAN 100

建立trunk

inte***ce GigabitEthernet1/0/1

duplex full

speed 1000

* port link-type trunk

* port trunk permit vlan all

port link-aggregation group 1

帶*号的是建立trunk鍊路的語句

vlan位址指定

inte***ce Vlan-inte***ce2

description server

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

vrrp vrid 2 virtual-ip XXX.XXX.XXX.XXX

vrrp vrid 2 priority 120

vrrp vrid 2 preempt-mode timer delay 10

其中vrrp語句指定vrrp 類似與hsrp

使用vrrp要注意的是華為不支援pvst

隻能一台完全是主,一台完全是備份

在主vrrp裝置上要指定

stp instance 0 root primary

stp TC-protection enable

stp enable

在從vrrp裝置上要指定

stp instance 0 root secondary

stp TC-protection enable

stp enable

交換機下面綁acl

首先進入接口模式,輸入qos指令

[shzb-crsw-s6506-1-GigabitEthernet1/0/1]qos

在輸入如下指令

[shzb-crsw-s6506-1-qoss-GigabitEthernet1/0/1]packet-filter inbound ip-group 3000

華為交換機隻能指定inbound方向

啟用ospf

[shzb-crsw-s6506-1]ospf 100

[shzb-crsw-s6506-1-ospf-100]area 0

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]network XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

配置ospf重釋出

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]quit

[shzb-crsw-s6506-1-ospf-100]import-route static

建立link-group(類似與cisco的channel-group)

link-aggregation group 1 mode manual

然後進入接口

port link-aggregation group 1

啟用VRRP之前必須輸入

vrrp ping-enable

使得客戶能ping網關

交換機指令

~~~~~~~~~~

[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}                 ;配置端口平接扭接

[Quidway-Ethernet0/1]port link-type {trunk|access|hybrid}     ;設定端口工作模式

[Quidway-Ethernet0/1]port access vlan 3                  ;目前端口加入到VLAN

[Quidway-Ethernet0/2]port trunk permit vlan {ID|All}        ;設trunk允許的VLAN

[Quidway-Ethernet0/3]port trunk pvid vlan 3          ;設定trunk端口的PVID

[Quidway-Ethernet0/1]undo shutdown                       ;激活端口

[Quidway-Ethernet0/1]shutdown                               ;關閉端口

[Quidway-Ethernet0/1]quit                               ;傳回

[Quidway]vlan 3                                         ;建立VLAN

[Quidway-vlan3]port ethernet 0/1                 ;在VLAN中增加端口

[Quidway-vlan3]port e0/1                                 ;簡寫方式

[Quidway-vlan3]port ethernet 0/1 to ethernet 0/4         ;在VLAN中增加端口

[Quidway-vlan3]port e0/1 to e0/4                         ;簡寫方式

[Quidway]monitor-port <interface_type interface_num>         ;指定鏡像端口

[Quidway]port mirror <interface_type interface_num>         ;指定被鏡像端口

[Quidway]port mirror int_list observing-port int_type int_num ;指定鏡像和被鏡像

[Quidway]description string                              ;指定VLAN描述字元

[Quidway]description                                   ;删除VLAN描述字元

[Quidway]display vlan [vlan_id]                               ;檢視VLAN設定

[Quidway]stp {enable|disable}                                 ;設定生成樹,預設關閉

[Quidway]stp priority 4096                               ;設定交換機的優先級

[Quidway]stp root {primary|secondary}                    ;設定為根或根的備份

[Quidway-Ethernet0/1]stp cost 200                        ;設定交換機端口的花費

[Quidway]link-aggregation e0/1 to e0/4 ingress|both           ; 端口的聚合

[Quidway]undo link-aggregation e0/1|all                       ;  始端口為通道号

[SwitchA-vlanx]isolate-user-vlan enable                  ;設定主vlan

[SwitchA]isolate-user-vlan <x> secondary <list>          ;設定主vlan包括的子vlan

[Quidway-Ethernet0/2]port hybrid pvid vlan <id>          ;設定vlan的pvid

[Quidway-Ethernet0/2]port hybrid pvid                    ;删除vlan的pvid

[Quidway-Ethernet0/2]port hybrid vlan vlan_id_list untagged  ;設定無辨別的vlan

如果包的vlan id與PVId一緻,則去掉vlan資訊. 預設PVID=1。

是以設定PVID為所屬vlan id, 設定可以互通的vlan為untagged.

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

路由器指令

~~~~~~~~~~

[Quidway]display version                                ;顯示版本資訊

[Quidway]display current-configuration                  ;顯示目前配置

[Quidway]display interfaces                             ;顯示接口資訊

[Quidway]display ip route                               ;顯示路由資訊

[Quidway]sysname aabbcc                                 ;更改主機名

[Quidway]super passwrod 123456                          ;設定密碼

[Quidway]interface serial0                              ;進入接口

[Quidway-serial0]ip address <ip> <mask|mask_len>        ;配置端口IP位址

[Quidway-serial0]undo shutdown                          ;激活端口

[Quidway]link-protocol hdlc                             ;綁定hdlc協定

[Quidway]user-interface vty 0 4

[Quidway-ui-vty0-4]authentication-mode password

[Quidway-ui-vty0-4]set authentication-mode password simple 222

[Quidway-ui-vty0-4]user privilege level 3

[Quidway-ui-vty0-4]quit

[Quidway]debugging hdlc all serial0                     ;顯示所有資訊

[Quidway]debugging hdlc event serial0                   ;調試事件資訊

[Quidway]debugging hdlc packet serial0                  ;顯示包的資訊

靜态路由:

[Quidway]ip route-static <ip><mask>{interface number|nexthop}[value][reject|blackhole]

例如:

[Quidway]ip route-static 129.1.0.0 16 10.0.0.2

[Quidway]ip route-static 129.1.0.0 255.255.0.0 10.0.0.2

[Quidway]ip route-static 129.1.0.0 16 Serial 2

[Quidway]ip route-static 0.0.0.0 0.0.0.0  10.0.0.2

動态路由:

[Quidway]rip                                                  ;設定動态路由

[Quidway]rip work                                             ;設定工作允許

[Quidway]rip input                                            ;設定入口允許

[Quidway]rip output                                           ;設定出口允許

[Quidway-rip]network 1.0.0.0                             ;設定交換路由網絡

[Quidway-rip]network all                                      ;設定與所有網絡交換

[Quidway-rip]peer ip-address                                  ;

[Quidway-rip]summary                                          ;路由聚合

[Quidway]rip version 1                                        ;設定工作在版本1

[Quidway]rip version 2 multicast                              ;設版本2,多點傳播方式

[Quidway-Ethernet0]rip split-horizon                          ;水準分隔

[Quidway]router id A.B.C.D                                    ;配置路由器的ID

[Quidway]ospf enable                                          ;啟動OSPF協定

[Quidway-ospf]import-route direct                             ;引入直聯路由

[Quidway-Serial0]ospf enable area <area_id>                   ;配置OSPF區域

标準通路清單指令格式如下:

acl <acl-number> [match-order config|auto]                    ;預設前者順序比對。

rule [normal|special]{permit|deny} [source source-addr source-wildcard|any]

例:

[Quidway]acl 10

[Quidway-acl-10]rule normal permit source 10.0.0.0 0.0.0.255

[Quidway-acl-10]rule normal deny source any

擴充通路控制清單配置指令

配置TCP/UDP協定的擴充通路清單:

rule {normal|special}{permit|deny}{tcp|udp}source {<ip wild>|any}destination <ip wild>|any}

[operate]

配置ICMP協定的擴充通路清單:

rule {normal|special}{permit|deny}icmp source {<ip wild>|any]destination {<ip wild>|any]

[icmp-code] [logging]

擴充通路控制清單操作符的含義

equal portnumber                                        ;等于

greater-than portnumber                                        ;大于

less-than portnumber                                        ;小于

not-equal portnumber                                        ;不等

range portnumber1 portnumber2                                  ;區間

擴充通路控制清單舉例

[Quidway]acl 101

[Quidway-acl-101]rule deny souce any destination any

[Quidway-acl-101]rule permit icmp source any destination any icmp-type echo

[Quidway-acl-101]rule permit icmp source any destination any icmp-type echo-reply

[Quidway]acl 102

[Quidway-acl-102]rule permit ip source 10.0.0.1 0.0.0.0 destination 202.0.0.1 0.0.0.0

[Quidway-acl-102]rule deny ip source any destination any

[Quidway]acl 103

[Quidway-acl-103]rule permit tcp source any destination 10.0.0.1 0.0.0.0 destination-port equal ftp

[Quidway-acl-103]rule permit tcp source any destination 10.0.0.2 0.0.0.0 destination-port equal www

[Quidway]firewall enable

[Quidway]firewall default permit|deny

[Quidway]int e0

[Quidway-Ethernet0]firewall packet-filter 101 inbound|outbound

位址轉換配置舉例

[Quidway]firewall enable

[Quidway]firewall default permit

[Quidway]acl 101                             ;内部指定主機可以進入e0

[Quidway-acl-101]rule deny ip source any destination any

[Quidway-acl-101]rule permit ip source 129.38.1.1 0 destination any

[Quidway-acl-101]rule permit ip source 129.38.1.2 0 destination any

[Quidway-acl-101]rule permit ip source 129.38.1.3 0 destination any

[Quidway-acl-101]rule permit ip source 129.38.1.4 0 destination any

[Quidway-acl-101]quit

[Quidway]int e0

[Quidway-Ethernet0]firewall packet-filter 101 inbound

[Quidway]acl 102                             ;外部特定主機和大于1024端口的資料包允許進入S0

[Quidway-acl-102]rule deny ip source any destination any

[Quidway-acl-102]rule permit tcp source 202.39.2.3 0 destination 202.38.160.1 0

[Quidway-acl-102]rule permit tcp source any destination 202.38.160.1 0 destination-port great-than

1024

[Quidway-acl-102]quit

[Quidway]int s0

[Quidway-Serial0]firewall packet-filter 102 inbound      ;設202.38.160.1是路由器出口IP。

[Quidway-Serial0]nat outbound 101 interface   ;是Easy ip,将acl 101允許的IP從本接口出時變換源位址。

内部伺服器位址轉換配置指令(靜态nat):

nat server global <ip> [port] inside <ip> port [protocol]       ;global_port不寫時使用inside_port

[Quidway-Serial0]nat server global 202.38.160.1 inside 129.38.1.1 ftp tcp

[Quidway-Serial0]nat server global 202.38.160.1 inside 129.38.1.2 telnet tcp

[Quidway-Serial0]nat server global 202.38.160.1 inside 129.38.1.3 www tcp

設有公網IP:202.38.160.101~202.38.160.103 可以使用。             ;對外通路(原例題)

[Quidway]nat address-group 202.38.160.101 202.38.160.103 pool1   ;建立位址池

[Quidway]acl 1

[Quidway-acl-1]rule permit source 10.110.10.0 0.0.0.255          ;指定允許的内部網絡

[Quidway-acl-1]rule deny source any

[Quidway-acl-1]int serial 0

[Quidway-Serial0]nat outbound 1 address-group pool1              ;在s0口從位址池取出IP對外通路

[Quidway-Serial0]nat server global 202.38.160.101 inside 10.110.10.1 ftp tcp

[Quidway-Serial0]nat server global 202.38.160.102 inside 10.110.10.2 www tcp

[Quidway-Serial0]nat server global 202.38.160.102 8080 inside 10.110.10.3 www tcp

[Quidway-Serial0]nat server global 202.38.160.103 inside 10.110.10.4 smtp udp

PPP設定:

[Quidway-s0]link-protocol ppp                                  ;預設的協定

PPP驗證:

主驗方:pap|chap

[Quidway]local-user q2 password {simple|cipher} hello          ;路由器1

[Quidway]interface serial 0

[Quidway-serial0]ppp authentication-mode {pap|chap}

[Quidway-serial0]ppp chap user q1                              ;pap時,沒有此句

pap被驗方:

[Quidway]interface serial 0                                    ;路由器2

[Quidway-serial0]ppp pap local-user q2 password {simple|cipher} hello

chap被驗方:

[Quidway]interface serial 0                                    ;路由器2

[Quidway-serial0]ppp chap user q2                              ;自己路由器名

[Quidway-serial0]local-user q1 password {simple|cipher} hello  ;對方路由器名

幀中繼frame-relay    (二分冊6-61)

[q1]fr switching

[q1]int s1

[q1-Serial1]ip address 192.168.34.51 255.255.255.0

[q1-Serial1]link-protocol fr                                   ;封裝幀中繼協定

[q1-Serial1]fr interface-type dce

[q1-Serial1]fr dlci 100

[q1-Serial1]fr inarp

[q1-Serial1]fr map ip 192.168.34.52 dlci 100

[q2]int s1

[q2-Serial1]ip address 192.168.34.52 255.255.255.0

[q2-Serial1]link-protocol fr

[q2-Serial1]fr interface-type dte

[q2-Serial1]fr dlci 100

[q2-Serial1]fr inarp

[q2-Serial1]fr map ip 192.168.34.51 dlci 100

幀中繼監測

[q1]display fr lmi-info[]interface type number]

[q1]display fr map

[q1]display fr pvc-info[serial interface-number][dlci dlci-number]

[q1]display fr dlci-switch

[q1]display fr interface

[q1]reset fr inarp-info

[q1]debugging fr all[interface type number]

[q1]debugging fr arp[interface type number]

[q1]debugging fr event[interface type number]

[q1]debugging fr lmi[interface type number]

啟動ftp服務:

[Quidway]local-user ftp password {simple|cipher} aaa service-type ftp

[Quidway]ftp server enable

inte***ce M-Ethernet0/0/0是CPU闆的管理口

 華為6506下加入ACL步驟:

    先進入配置模式.

    <SW6506>sys

      System View: return to User View with Ctrl+Z

    [SW6506]

    建立通路控制清單

[SW6506]acl number 4012

[SW6506-acl-adv-4012]

 [SW6506-acl-adv-4012]rule 0 permit icmp source 10.1.43.0 0.0.0.255 destination 10.1.2.11 0

 [SW6506-acl-adv-4012]rule 1 deny icmp source 10.1.0.0 0.0.255.255 destination 10.1.2.11 0

    進入接口模式

[SW6506]int g4/0/43

[SW6506-GigabitEthernet4/0/43]qos

 This interface\'s qos performance is limited as following:

   The number of rules that can be made active is <= 120/(interface).

   The number of traffic statistics that can be made active is <= 32/(interface).

   The number of traffic bandwidth limits that can be made active is <= 60/(inter

face).

[SW6506-qosb-GigabitEthernet4/0/43]pack

[SW6506-qosb-GigabitEthernet4/0/43]packet-filter ?

   inbound  Apply the acl on inbound packets of the interface

[SW6506-qosb-GigabitEthernet4/0/43]packet-filter inbound ?

   ip-group    Apply the basic or advanced acl

   link-group  Apply the link-based acl

   user-group  Apply the user-defined acl

[SW6506-qosb-GigabitEthernet4/0/43]packet-filter inbound ip-

 2XJDZJ-SW-S6506-01-qosb-GigabitEthernet4/0/43]packet-filter inbound ip-group 4012    将ACL應用到接口,再dis cu int g4/0/43進行檢視.

[SW6506-qosb-GigabitEthernet4/0/43]dis cu int g4/0/43

#

interface GigabitEthernet4/0/43

 port access vlan 143

 qos

 packet-filter inbound ip-group 4012 rule 0 system-index 1

 packet-filter inbound ip-group 4012 rule 1 system-index 2

#

return

[SW6506-qosb-GigabitEthernet4/0/43]

    取消接口上的應用

[SW6506-qosb-GigabitEthernet4/0/43]qos

This interface\'s qos performance is limited as following:

  The number of rules that can be made active is <= 120/(interface).

  The number of traffic statistics that can be made active is <= 32/(interface).

  The number of traffic bandwidth limits that can be made active is <= 60/(inter

face).

[SW6506-qosb-GigabitEthernet4/0/43]undo pack

[SW6506-qosb-GigabitEthernet4/0/43]undo packet-filter inbound ?

  ip-group    Apply the basic or advanced acl

  link-group  Apply the link-based acl

  user-group  Apply the user-defined acl

[SW6506-qosb-GigabitEthernet4/0/43]undo packet-filter inbound ip-group 4012

[SW6506-qosb-GigabitEthernet4/0/43]

本文來自CSDN部落格,轉載請标明出處:http://blog.csdn.net/zhrmghl/archive/2007/05/30/1632101.aspx

 換機為H3C S3600-28TP-SI。欲限制部分使用者對一些裝置FTP、SSH、VNC SERVER的通路。在奧運期間加強裝置的安全性。

    該交換機的ACL可以作用在端口的OUT 或 IN方向上。考慮到所做的ACL想對個别的接口連接配接裝置起作用,是以将ACL應用到接口的出的方向上。

    (1)首先定義ACL。

    acl number 3001

         rule permit tcp source 10.65.43.0 0.0.0.255 destination-port eq ftp-data

         rule permit tcp source 10.65.43.0 0.0.0.255 destination-port eq ftp    

        rule permit tcp source 10.65.155.0 0.0.0.255 destination-port eq ftp-data

         rule permit tcp source 10.65.155.0 0.0.0.255 destination-port eq ftp

         rule permit tcp source 10.65.150.0 0.0.0.255 destination-port eq ftp-data

         rule permit tcp source 10.65.150.0 0.0.0.255 destination-port eq ftp

         rule permit tcp source 10.65.43.0 0.0.0.255 destination-port eq 22

         rule permit tcp source 10.65.252.0 0.0.0.128 destination-port eq 22

         rule permit tcp source 10.65.43.0 0.0.0.255 destination-port eq 5901

         rule deny tcp destination-port eq ftp-data

         rule deny tcp destination-port eq ftp

         rule deny tcp destination-port eq 22

         rule deny tcp destination-port eq 5901

    (2)在接口上應用。

        packet-filter outbound ip-group 3001

    (3)顯示接口上的應用

    [XJDZJ-WL-3628-01]dis cu int e1/0/5

    #

    interface Ethernet1/5

         packet-filter outbound ip-group 3001 rule 0

         packet-filter outbound ip-group 3001 rule 1

         packet-filter outbound ip-group 3001 rule 2

         packet-filter outbound ip-group 3001 rule 3

         packet-filter outbound ip-group 3001 rule 4

         packet-filter outbound ip-group 3001 rule 5

         packet-filter outbound ip-group 3001 rule 6

         packet-filter outbound ip-group 3001 rule 7

         packet-filter outbound ip-group 3001 rule 8

         packet-filter outbound ip-group 3001 rule 9

         packet-filter outbound ip-group 3001 rule 10

         packet-filter outbound ip-group 3001 rule 11

         packet-filter outbound ip-group 3001 rule 12

 開門直接寫,不廢話.

删除裝置配置

reset saved-configuration

重新開機

reboot

看目前配置檔案

display current-configuration

改裝置名

sysname

儲存配置

save

進入特權模式

sysview

華為隻有2層模式 不像cisco enale之後還要conf t

定義acl

acl nubmere XXXX(3000以上)進入以後

rule permit/deny IP/TCP/UDP等 source XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向)

destination XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向) eq

注意 華為預設沒有deny any any

防火牆上端口加載ACL

[Quidway-Ethernet0/0]firewall packet-filter 3000 inbound

防火牆上新增加使用者

local-user XXX(使用者名) password simple XXX(密碼)

local-user XXX service-type ppp

删除某條指令

undo(類似與cisco的no)

靜态路由

ip route-static 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX

對vpdn使用者設定acl的接口

inte***ce Virtual-Template1

檢視路由表

display ip routing-table

設定telnet密碼

user-inte***ce vty 0 4

user privilege level 3

set authentication password simple XXX

啟動/關閉

啟動 un shut

關閉 shut

動态nat設定

acl number 3000

rule 0 permit ip source XXX.XXX.XXX.XXX

rule 1 permit ip source XXX.XXX.XXX.XXX

rule 2 permit ip source XXX.XXX.XXX.XXX

inte***ce Ethernet1/0

des cription ====To-Internet(WAN)====

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

nat outbound 3000

ipsec policy policy1

利用acl來做 符合acl的IP位址可以出去(注意 此處的ACL隐含了deny any any)不符合的IP位址不可以出去

建立vlan

[shzb-crsw-s6506-1]vlan 100

華為vlan不支援name

将port放入vlan

建立了vlan後 進入vlan模式

[shzb-crsw-s6506-1-vlan100]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/8

表示從G1/0/1 到1/0/8放入VLAN 100

建立trunk

inte***ce GigabitEthernet1/0/1

duplex full

speed 1000

* port link-type trunk

* port trunk permit vlan all

port link-aggregation group 1

帶*号的是建立trunk鍊路的語句

vlan位址指定

inte***ce Vlan-inte***ce2

des cription server

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

vrrp vrid 2 virtual-ip XXX.XXX.XXX.XXX

vrrp vrid 2 priority 120

vrrp vrid 2 preempt-mode timer delay 10

其中vrrp語句指定vrrp 類似與hsrp

使用vrrp要注意的是華為不支援pvst

隻能一台完全是主,一台完全是備份

在主vrrp裝置上要指定

stp instance 0 root primary

stp TC-protection enable

stp enable

在從vrrp裝置上要指定

stp instance 0 root secondary

stp TC-protection enable

stp enable

交換機下面綁acl

首先進入接口模式,輸入qos指令

[shzb-crsw-s6506-1-GigabitEthernet1/0/1]qos

在輸入如下指令

[shzb-crsw-s6506-1-qoss-GigabitEthernet1/0/1]packet-filter inbound ip-group 3000

華為交換機隻能指定inbound方向

啟用ospf

[shzb-crsw-s6506-1]ospf 100

[shzb-crsw-s6506-1-ospf-100]area 0

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]network XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

配置ospf重釋出

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]quit

[shzb-crsw-s6506-1-ospf-100]import-route static

建立link-group(類似與cisco的channel-group)

link-aggregation group 1 mode manual

然後進入接口

port link-aggregation group 1

啟用VRRP之前必須輸入

vrrp ping-enable

使得客戶能ping網關

H3C交換機配置指令2008-11-11 16:32配置終端操作密碼:

[ST-ZC501-LSW-R4C14.I.S2403]user-interface aux 0     /進入使用者0模式

[ST-ZC501-LSW-R4C14.I.S2403-ui-aux0]authentication-mode password /配置密碼

無操作自動斷開連接配接:

idle-timeout minutes 10 /10分鐘無操作自動斷開連接配接

idle-timeout seconds 10 /10秒鐘無操作自動斷開連接配接

鎖定使用者:

<ST-ZC501-LSW-R4C14.I.S2403>lock /鎖定目前使用者(接着輸入密碼,解除按回車輸入

剛才的密碼就行了)。

開啟telnet服務:

[ST-ZC501-LSW-R4C14.I.S2403]telnet server enable   /啟動telnet 服務(預設關閉)

強制使用者下線:

<ST-ZC501-LSW-R4C14.I.S2403>free web-users all /強制所有線上WEB使用者下線

檢視端口接收、傳送、丢棄封包數:

<ST-ZC501-LSW-R4C14.I.S2403>display garp statistics interface (加端口号) 查

/看端口接收和傳送和丢棄的GVRP封包數

VTP配置:

gvrp registration fixed   /端口模式下配置(相當于思科的伺服器模式VTP)____必須

在trunk工作模式的端口下。

gvrp registration forbidden   /端口模式下配置(相當于思科的透明模式VTP)____必

須在trunk工作模式的端口下。

gvrp registration normal   /端口模式下配置(相當于思科的用戶端模式VTP)____必須

在trunk工作模式的端口下。

[ST-ZC501-LSW-R4C14.I.S2403]stp disable

bpdu-tunnel dot1q stp    /VTP的開啟(端口下或全局模式下)預設關閉

undo bpdu-tunnel dot1q stp   /關閉VTP(端口下或全局模式下)

指定以太網端口通過的最大廣播百分比:

broadcast-suppression   (1-100)   /指定以太網端口允許通過的最大廣播

流量占該端口傳輸能力的百分比(預設關閉)——打開此功能可以保證正常

流量的傳輸。

檢視本端系統的裝置ID,包括LACP協優先級與MAC位址:

display lacp system-id

優先級設定為64(值越小優先級越大):

[ST-ZC501-LSW-R4C14.I.S2403]lacp system-priority 64

端口聚合命名:

[ST-ZC501-LSW-R4C14.I.S2403]link-aggregation group 1 description   /名字

建立組号為8的手工聚合組:

[ST-ZC501-LSW-R4C14.I.S2403]link-aggregation group 8 mode manual

/把端口加入到組号為8的手工聚合組:

端口下port link-aggregation group 8

進入聚合端口組8模式:

[ST-ZC501-LSW-R4C14.I.S2403]port-group aggregation 8

[ST-ZC501-LSW-R4C14.I.S2403-port-group-aggregation-8] 此指令不能添加或删

除端口組成員,隻能進行對聚合相關的配置指令,包括STP、VLAN、QOS、GVRP、

TELNET、MAC等配置。

端口下綁定IP及MAC位址:

user-bind ip-address 121.11.86.72 mac-address 0101-0101-0101

檢視非正常阻塞端口(任意視圖下):

display stp abnormal-port裡顯示結果為Reason項裡Formatcompatibility

rotected

檢視被STP保護功能down掉的端口資訊(任意視圖下):

display stp down-port

檢視所有MSTP執行個體的根橋資訊(任意視圖下):

dis stp root

清除生成樹的統計資訊(使用者視圖下):

reset stp

reset stp interface 端口号------消除指定端口生成樹的統計資訊。

檢視已經生效的MST域(生成樹)的配置資訊:

display stp region-configuration

開啟和關閉stp功能:

[ST-ZC501-LSW-R4C14.I.S2403]stp enable 開啟全局stp

端口下關閉stp:

stp disable

端口下設定端口的路徑開銷(根橋):

stp instance 0 cost 16 ______指定生成樹執行個體0的路徑開銷為16

指定目前裝置為生成樹執行個體0的根橋:

stp instance 0 root primary

指定目前裝置為生成樹執行個體0的備份根橋:

stp instance 0 root secondary

端口下啟動端口的根保護功能:

stp root-protection

端口下配置以太網端口為邊緣端口(即直接轉發端口——不阻塞端口):

stp edged-port disable

端口下開啟環路保護功能:

stp loop-protection

路由指令

檢視路由表中目前激活路由的摘要資訊:

display ip routing-table

檢視通過基本通路控制清單ACL2000過濾的,處于active狀态的路由的摘要資訊:

display ip routing-table acl 2000

檢視通過基本通路控制清單ACL2000過濾的,處于active和inactive的路由的詳細資訊:

display ip routing-table acl 2000 verbose

檢視所有直連路由的摘要資訊:

display ip routing-table protocol direct

檢視所有靜态路由表:

display ip routing-table protocol static

檢視路由的綜合資訊:

dispaly ip routing-table statistics

清除路由表中所有路由協定的統計資訊:

reset ip routing-table statistics protcol all

靜态路由配置:

[ST-ZC501-LSW-R4C14.I.S2403]ip route-static 目的位址/掩碼 下一跳IP tag 50

删除靜态路由:

[ST-ZC501-LSW-R4C14.I.S2403]undo ip route-static 目的位址/掩碼 下一跳IP tag

50

配置靜态路由的預設優先級為120預設為60)

[ST-ZC501-LSW-R4C14.I.S2403]ip route-static default-perference 120

将OSPF區域1中兩個網段11.1.1.0/24和11.1.2.0/24的路由聚合成一條聚合路由

11.1.0.0/16向其它區域釋出:

[ST-ZC501-LSW-R4C14.I.S2403]ospf 100

[ST-ZC501-LSW-R4C14.I.S2403-ospf-100]area 1

[ST-ZC501-LSW-R4C14.I.S2403-ospf-100-0.0.0.1]network 11.1.1.0 0.0.0.255

[ST-ZC501-LSW-R4C14.I.S2403-ospf-100-0.0.0.1]network 11.1.2.0 0.0.0.255

[ST-ZC501-LSW-R4C14.I.S2403-ospf-100-0.0.0.1]abr-summary 11.1.0.0

255.255.0.0

建立OSPF區域0并進入ospf區域視圖:

[ST-ZC501-LSW-R4C14.I.S2403]ospf 100

[ST-ZC501-LSW-R4C14.I.S2403-ospf-100]area 0 (删除則undo area 0)

[ST-ZC501-LSW-R4C14.I.S2403-ospf-100-0.0.0.0]

設定ospf對引入的路由進行聚合:

[ST-ZC501-LSW-R4C14.I.S2403]ip route-static 11.1.1.0 24 null 0

[ST-ZC501-LSW-R4C14.I.S2403]ip route-static 11.1.2.0 24 null 0

[ST-ZC501-LSW-R4C14.I.S2403]ospf 100

[ST-ZC501-LSW-R4C14.I.S2403-ospf-100]import-route static

[ST-ZC501-LSW-R4C14.I.S2403-ospf-100]asbr-summary 11.1.0.0 255.255.0.0 tag

2 cost 100

指定OSPF區域0支援MD5密文驗證模式:

一個區域中所有路由器的驗證模式必須一緻(不驗證\使用簡單驗證\使用MD5密文驗證)

[ST-ZC501-LSW-R4C14.I.S2403]ospf 100

[ST-ZC501-LSW-R4C14.I.S2403-ospf-100]area 0

[ST-ZC501-LSW-R4C14.I.S2403-ospf-100-0.0.0.0]authentication-mode md5

設定鍊路的帶寬參考值為1000Mbps:

[ST-ZC501-LSW-R4C14.I.S2403]ospf 100

[ST-ZC501-LSW-R4C14.I.S2403-ospf-100]bandwidth-reference 1000

設定外部路由預設值開銷10、類型2、标記100和一次引入的數量上限20000:

[ST-ZC501-LSW-R4C14.I.S2403]ospf 100

[ST-ZC501-LSW-R4C14.I.S2403-ospf-100]default cost 10 limit 20000 tag 100

type 2

将産生的預設路由引入到OSPF路由區域(本地路由器的路由表中不存在預設路由):

[ST-ZC501-LSW-R4C14.I.S2403]ospf 100

[ST-ZC501-LSW-R4C14.I.S2403-ospf-100]default-route-advertise always

路由OSPF描述:

[ST-ZC501-LSW-R4C14.I.S2403]ospf 100

[ST-ZC501-LSW-R4C14.I.S2403-ospf-100]description 123456

檢視OSPF路由資訊:

[ST-ZC501-LSW-R4C14.I.S2403]display ospf abr-asbr

檢視OSPF的所有引入路由聚合資訊:

display ospf asbr-summary

檢視OSPF的錯誤資訊:

display ospf (可加區域号) error

檢視OSPF接口資訊(如果不指定OSPF程序号,将顯示所有OSPF程序的接口資訊):

display ospf interface

顯示SOPF的下一跳資訊:

display ospf nexthop

檢視OSPF鄰居詳細資訊:

display ospf peer verbose

檢視OSPF鄰居概要資訊:

display ospf peer

檢視所有OSPF鄰居的統計資訊:

display ospf peer statistics

檢視OSPF請求清單資訊(如果不指定OSPF程序号,将顯示所有OSPF程序的請求清單信

息):

display ospf request-queue

檢視OSPF路由表的資訊:

display ospf routing

開啟OSPF日志資訊開關(預設關閉):

[ST-ZC501-LSW-R4C14.I.S2403]ospf 100

[ST-ZC501-LSW-R4C14.I.S2403-ospf-100]enable log

個人總結的一些華為指令

個人總結的一些華為指令

個人總結的一些華為指令

删除裝置配置

reset saved-configuration

重新開機

reboot

看目前配置檔案

display current-configuration

改裝置名

sysname

儲存配置

save

進入特權模式

sysview

華為隻有2層模式 不像cisco enale之後還要conf t

定義acl

acl nubmere XXXX(3000以上)進入以後

rule permit/deny IP/TCP/UDP等 source XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向)

destination XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向) eq

注意 華為預設沒有deny any any

防火牆上端口加載ACL

[Quidway-Ethernet0/0]firewall packet-filter 3000 inbound

防火牆上新增加使用者

local-user XXX(使用者名) password simple XXX(密碼)

local-user XXX service-type ppp

删除某條指令

undo(類似與cisco的no)

靜态路由

ip route-static 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX

對vpdn使用者設定acl的接口

inte***ce Virtual-Template1

檢視路由表

display ip routing-table

設定telnet密碼

user-inte***ce vty 0 4

user privilege level 3

set authentication password simple XXX

啟動/關閉

啟動 un shut

關閉 shut

動态nat設定

acl number 3000

rule 0 permit ip source XXX.XXX.XXX.XXX

rule 1 permit ip source XXX.XXX.XXX.XXX

rule 2 permit ip source XXX.XXX.XXX.XXX

inte***ce Ethernet1/0

description ====To-Internet(WAN)====

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

nat outbound 3000

ipsec policy policy1

利用acl來做 符合acl的IP位址可以出去(注意 此處的ACL隐含了deny any any)不符合的IP位址不可以出去

建立vlan

[shzb-crsw-s6506-1]vlan 100

華為vlan不支援name

将port放入vlan

建立了vlan後 進入vlan模式

[shzb-crsw-s6506-1-vlan100]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/8

表示從G1/0/1 到1/0/8放入VLAN 100

建立trunk

inte***ce GigabitEthernet1/0/1

duplex full

speed 1000

* port link-type trunk

* port trunk permit vlan all

port link-aggregation group 1

帶*号的是建立trunk鍊路的語句

vlan位址指定

inte***ce Vlan-inte***ce2

description server

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

vrrp vrid 2 virtual-ip XXX.XXX.XXX.XXX

vrrp vrid 2 priority 120

vrrp vrid 2 preempt-mode timer delay 10

其中vrrp語句指定vrrp 類似與hsrp

使用vrrp要注意的是華為不支援pvst

隻能一台完全是主,一台完全是備份

在主vrrp裝置上要指定

stp instance 0 root primary

stp TC-protection enable

stp enable

在從vrrp裝置上要指定

stp instance 0 root secondary

stp TC-protection enable

stp enable

交換機下面綁acl

首先進入接口模式,輸入qos指令

[shzb-crsw-s6506-1-GigabitEthernet1/0/1]qos

在輸入如下指令

[shzb-crsw-s6506-1-qoss-GigabitEthernet1/0/1]packet-filter inbound ip-group 3000

華為交換機隻能指定inbound方向

啟用ospf

[shzb-crsw-s6506-1]ospf 100

[shzb-crsw-s6506-1-ospf-100]area 0

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]network XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

配置ospf重釋出

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]quit

[shzb-crsw-s6506-1-ospf-100]import-route static

建立link-group(類似與cisco的channel-group)

link-aggregation group 1 mode manual

然後進入接口

port link-aggregation group 1

啟用VRRP之前必須輸入

vrrp ping-enable

使得客戶能ping網關個人總結的一些華為指令

個人總結的一些華為指令

删除裝置配置

reset saved-configuration

重新開機

reboot

看目前配置檔案

display current-configuration

改裝置名

sysname

儲存配置

save

進入特權模式

sysview

華為隻有2層模式 不像cisco enale之後還要conf t

定義acl

acl nubmere XXXX(3000以上)進入以後

rule permit/deny IP/TCP/UDP等 source XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向)

destination XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向) eq

注意 華為預設沒有deny any any

防火牆上端口加載ACL

[Quidway-Ethernet0/0]firewall packet-filter 3000 inbound

防火牆上新增加使用者

local-user XXX(使用者名) password simple XXX(密碼)

local-user XXX service-type ppp

删除某條指令

undo(類似與cisco的no)

靜态路由

ip route-static 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX

對vpdn使用者設定acl的接口

inte***ce Virtual-Template1

檢視路由表

display ip routing-table

設定telnet密碼

user-inte***ce vty 0 4

user privilege level 3

set authentication password simple XXX

啟動/關閉

啟動 un shut

關閉 shut

動态nat設定

acl number 3000

rule 0 permit ip source XXX.XXX.XXX.XXX

rule 1 permit ip source XXX.XXX.XXX.XXX

rule 2 permit ip source XXX.XXX.XXX.XXX

inte***ce Ethernet1/0

description ====To-Internet(WAN)====

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

nat outbound 3000

ipsec policy policy1

利用acl來做 符合acl的IP位址可以出去(注意 此處的ACL隐含了deny any any)不符合的IP位址不可以出去

建立vlan

[shzb-crsw-s6506-1]vlan 100

華為vlan不支援name

将port放入vlan

建立了vlan後 進入vlan模式

[shzb-crsw-s6506-1-vlan100]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/8

表示從G1/0/1 到1/0/8放入VLAN 100

建立trunk

inte***ce GigabitEthernet1/0/1

duplex full

speed 1000

* port link-type trunk

* port trunk permit vlan all

port link-aggregation group 1

帶*号的是建立trunk鍊路的語句

vlan位址指定

inte***ce Vlan-inte***ce2

description server

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

vrrp vrid 2 virtual-ip XXX.XXX.XXX.XXX

vrrp vrid 2 priority 120

vrrp vrid 2 preempt-mode timer delay 10

其中vrrp語句指定vrrp 類似與hsrp

使用vrrp要注意的是華為不支援pvst

隻能一台完全是主,一台完全是備份

在主vrrp裝置上要指定

stp instance 0 root primary

stp TC-protection enable

stp enable

在從vrrp裝置上要指定

stp instance 0 root secondary

stp TC-protection enable

stp enable

交換機下面綁acl

首先進入接口模式,輸入qos指令

[shzb-crsw-s6506-1-GigabitEthernet1/0/1]qos

在輸入如下指令

[shzb-crsw-s6506-1-qoss-GigabitEthernet1/0/1]packet-filter inbound ip-group 3000

華為交換機隻能指定inbound方向

啟用ospf

[shzb-crsw-s6506-1]ospf 100

[shzb-crsw-s6506-1-ospf-100]area 0

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]network XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

配置ospf重釋出

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]quit

[shzb-crsw-s6506-1-ospf-100]import-route static

建立link-group(類似與cisco的channel-group)

link-aggregation group 1 mode manual

然後進入接口

port link-aggregation group 1

啟用VRRP之前必須輸入

vrrp ping-enable

使得客戶能ping網關

個人總結的一些華為指令

删除裝置配置

reset saved-configuration

重新開機

reboot

看目前配置檔案

display current-configuration

改裝置名

sysname

儲存配置

save

進入特權模式

sysview

華為隻有2層模式 不像cisco enale之後還要conf t

定義acl

acl nubmere XXXX(3000以上)進入以後

rule permit/deny IP/TCP/UDP等 source XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向)

destination XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向) eq

注意 華為預設沒有deny any any

防火牆上端口加載ACL

[Quidway-Ethernet0/0]firewall packet-filter 3000 inbound

防火牆上新增加使用者

local-user XXX(使用者名) password simple XXX(密碼)

local-user XXX service-type ppp

删除某條指令

undo(類似與cisco的no)

靜态路由

ip route-static 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX

對vpdn使用者設定acl的接口

inte***ce Virtual-Template1

檢視路由表

display ip routing-table

設定telnet密碼

user-inte***ce vty 0 4

user privilege level 3

set authentication password simple XXX

啟動/關閉

啟動 un shut

關閉 shut

動态nat設定

acl number 3000

rule 0 permit ip source XXX.XXX.XXX.XXX

rule 1 permit ip source XXX.XXX.XXX.XXX

rule 2 permit ip source XXX.XXX.XXX.XXX

inte***ce Ethernet1/0

description ====To-Internet(WAN)====

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

nat outbound 3000

ipsec policy policy1

利用acl來做 符合acl的IP位址可以出去(注意 此處的ACL隐含了deny any any)不符合的IP位址不可以出去

建立vlan

[shzb-crsw-s6506-1]vlan 100

華為vlan不支援name

将port放入vlan

建立了vlan後 進入vlan模式

[shzb-crsw-s6506-1-vlan100]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/8

表示從G1/0/1 到1/0/8放入VLAN 100

建立trunk

inte***ce GigabitEthernet1/0/1

duplex full

speed 1000

* port link-type trunk

* port trunk permit vlan all

port link-aggregation group 1

帶*号的是建立trunk鍊路的語句

vlan位址指定

inte***ce Vlan-inte***ce2

description server

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

vrrp vrid 2 virtual-ip XXX.XXX.XXX.XXX

vrrp vrid 2 priority 120

vrrp vrid 2 preempt-mode timer delay 10

其中vrrp語句指定vrrp 類似與hsrp

使用vrrp要注意的是華為不支援pvst

隻能一台完全是主,一台完全是備份

在主vrrp裝置上要指定

stp instance 0 root primary

stp TC-protection enable

stp enable

在從vrrp裝置上要指定

stp instance 0 root secondary

stp TC-protection enable

stp enable

交換機下面綁acl

首先進入接口模式,輸入qos指令

[shzb-crsw-s6506-1-GigabitEthernet1/0/1]qos

在輸入如下指令

[shzb-crsw-s6506-1-qoss-GigabitEthernet1/0/1]packet-filter inbound ip-group 3000

華為交換機隻能指定inbound方向

啟用ospf

[shzb-crsw-s6506-1]ospf 100

[shzb-crsw-s6506-1-ospf-100]area 0

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]network XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

配置ospf重釋出

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]quit

[shzb-crsw-s6506-1-ospf-100]import-route static

建立link-group(類似與cisco的channel-group)

link-aggregation group 1 mode manual

然後進入接口

port link-aggregation group 1

啟用VRRP之前必須輸入

vrrp ping-enable

使得客戶能ping網關個人總結的一些華為指令

個人總結的一些華為指令

删除裝置配置

reset saved-configuration

重新開機

reboot

看目前配置檔案

display current-configuration

改裝置名

sysname

儲存配置

save

進入特權模式

sysview

華為隻有2層模式 不像cisco enale之後還要conf t

定義acl

acl nubmere XXXX(3000以上)進入以後

rule permit/deny IP/TCP/UDP等 source XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向)

destination XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向) eq

注意 華為預設沒有deny any any

防火牆上端口加載ACL

[Quidway-Ethernet0/0]firewall packet-filter 3000 inbound

防火牆上新增加使用者

local-user XXX(使用者名) password simple XXX(密碼)

local-user XXX service-type ppp

删除某條指令

undo(類似與cisco的no)

靜态路由

ip route-static 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX

對vpdn使用者設定acl的接口

inte***ce Virtual-Template1

檢視路由表

display ip routing-table

設定telnet密碼

user-inte***ce vty 0 4

user privilege level 3

set authentication password simple XXX

啟動/關閉

啟動 un shut

關閉 shut

動态nat設定

acl number 3000

rule 0 permit ip source XXX.XXX.XXX.XXX

rule 1 permit ip source XXX.XXX.XXX.XXX

rule 2 permit ip source XXX.XXX.XXX.XXX

inte***ce Ethernet1/0

description ====To-Internet(WAN)====

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

nat outbound 3000

ipsec policy policy1

利用acl來做 符合acl的IP位址可以出去(注意 此處的ACL隐含了deny any any)不符合的IP位址不可以出去

建立vlan

[shzb-crsw-s6506-1]vlan 100

華為vlan不支援name

将port放入vlan

建立了vlan後 進入vlan模式

[shzb-crsw-s6506-1-vlan100]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/8

表示從G1/0/1 到1/0/8放入VLAN 100

建立trunk

inte***ce GigabitEthernet1/0/1

duplex full

speed 1000

* port link-type trunk

* port trunk permit vlan all

port link-aggregation group 1

帶*号的是建立trunk鍊路的語句

vlan位址指定

inte***ce Vlan-inte***ce2

description server

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

vrrp vrid 2 virtual-ip XXX.XXX.XXX.XXX

vrrp vrid 2 priority 120

vrrp vrid 2 preempt-mode timer delay 10

其中vrrp語句指定vrrp 類似與hsrp

使用vrrp要注意的是華為不支援pvst

隻能一台完全是主,一台完全是備份

在主vrrp裝置上要指定

stp instance 0 root primary

stp TC-protection enable

stp enable

在從vrrp裝置上要指定

stp instance 0 root secondary

stp TC-protection enable

stp enable

交換機下面綁acl

首先進入接口模式,輸入qos指令

[shzb-crsw-s6506-1-GigabitEthernet1/0/1]qos

在輸入如下指令

[shzb-crsw-s6506-1-qoss-GigabitEthernet1/0/1]packet-filter inbound ip-group 3000

華為交換機隻能指定inbound方向

啟用ospf

[shzb-crsw-s6506-1]ospf 100

[shzb-crsw-s6506-1-ospf-100]area 0

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]network XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

配置ospf重釋出

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]quit

[shzb-crsw-s6506-1-ospf-100]import-route static

建立link-group(類似與cisco的channel-group)

link-aggregation group 1 mode manual

然後進入接口

port link-aggregation group 1

啟用VRRP之前必須輸入

vrrp ping-enable

使得客戶能ping網關

個人總結的一些華為指令

删除裝置配置

reset saved-configuration

重新開機

reboot

看目前配置檔案

display current-configuration

改裝置名

sysname

儲存配置

save

進入特權模式

sysview

華為隻有2層模式 不像cisco enale之後還要conf t

定義acl

acl nubmere XXXX(3000以上)進入以後

rule permit/deny IP/TCP/UDP等 source XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向)

destination XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向) eq

注意 華為預設沒有deny any any

防火牆上端口加載ACL

[Quidway-Ethernet0/0]firewall packet-filter 3000 inbound

防火牆上新增加使用者

local-user XXX(使用者名) password simple XXX(密碼)

local-user XXX service-type ppp

删除某條指令

undo(類似與cisco的no)

靜态路由

ip route-static 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX

對vpdn使用者設定acl的接口

inte***ce Virtual-Template1

檢視路由表

display ip routing-table

設定telnet密碼

user-inte***ce vty 0 4

user privilege level 3

set authentication password simple XXX

啟動/關閉

啟動 un shut

關閉 shut

動态nat設定

acl number 3000

rule 0 permit ip source XXX.XXX.XXX.XXX

rule 1 permit ip source XXX.XXX.XXX.XXX

rule 2 permit ip source XXX.XXX.XXX.XXX

inte***ce Ethernet1/0

description ====To-Internet(WAN)====

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

nat outbound 3000

ipsec policy policy1

利用acl來做 符合acl的IP位址可以出去(注意 此處的ACL隐含了deny any any)不符合的IP位址不可以出去

建立vlan

[shzb-crsw-s6506-1]vlan 100

華為vlan不支援name

将port放入vlan

建立了vlan後 進入vlan模式

[shzb-crsw-s6506-1-vlan100]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/8

表示從G1/0/1 到1/0/8放入VLAN 100

建立trunk

inte***ce GigabitEthernet1/0/1

duplex full

speed 1000

* port link-type trunk

* port trunk permit vlan all

port link-aggregation group 1

帶*号的是建立trunk鍊路的語句

vlan位址指定

inte***ce Vlan-inte***ce2

description server

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

vrrp vrid 2 virtual-ip XXX.XXX.XXX.XXX

vrrp vrid 2 priority 120

vrrp vrid 2 preempt-mode timer delay 10

其中vrrp語句指定vrrp 類似與hsrp

使用vrrp要注意的是華為不支援pvst

隻能一台完全是主,一台完全是備份

在主vrrp裝置上要指定

stp instance 0 root primary

stp TC-protection enable

stp enable

在從vrrp裝置上要指定

stp instance 0 root secondary

stp TC-protection enable

stp enable

交換機下面綁acl

首先進入接口模式,輸入qos指令

[shzb-crsw-s6506-1-GigabitEthernet1/0/1]qos

在輸入如下指令

[shzb-crsw-s6506-1-qoss-GigabitEthernet1/0/1]packet-filter inbound ip-group 3000

華為交換機隻能指定inbound方向

啟用ospf

[shzb-crsw-s6506-1]ospf 100

[shzb-crsw-s6506-1-ospf-100]area 0

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]network XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

配置ospf重釋出

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]quit

[shzb-crsw-s6506-1-ospf-100]import-route static

建立link-group(類似與cisco的channel-group)

link-aggregation group 1 mode manual

然後進入接口

port link-aggregation group 1

啟用VRRP之前必須輸入

vrrp ping-enable

使得客戶能ping網關個人總結的一些華為指令

個人總結的一些華為指令

删除裝置配置

reset saved-configuration

重新開機

reboot

看目前配置檔案

display current-configuration

改裝置名

sysname

儲存配置

save

進入特權模式

sysview

華為隻有2層模式 不像cisco enale之後還要conf t

定義acl

acl nubmere XXXX(3000以上)進入以後

rule permit/deny IP/TCP/UDP等 source XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向)

destination XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向) eq

注意 華為預設沒有deny any any

防火牆上端口加載ACL

[Quidway-Ethernet0/0]firewall packet-filter 3000 inbound

防火牆上新增加使用者

local-user XXX(使用者名) password simple XXX(密碼)

local-user XXX service-type ppp

删除某條指令

undo(類似與cisco的no)

靜态路由

ip route-static 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX

對vpdn使用者設定acl的接口

inte***ce Virtual-Template1

檢視路由表

display ip routing-table

設定telnet密碼

user-inte***ce vty 0 4

user privilege level 3

set authentication password simple XXX

啟動/關閉

啟動 un shut

關閉 shut

動态nat設定

acl number 3000

rule 0 permit ip source XXX.XXX.XXX.XXX

rule 1 permit ip source XXX.XXX.XXX.XXX

rule 2 permit ip source XXX.XXX.XXX.XXX

inte***ce Ethernet1/0

description ====To-Internet(WAN)====

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

nat outbound 3000

ipsec policy policy1

利用acl來做 符合acl的IP位址可以出去(注意 此處的ACL隐含了deny any any)不符合的IP位址不可以出去

建立vlan

[shzb-crsw-s6506-1]vlan 100

華為vlan不支援name

将port放入vlan

建立了vlan後 進入vlan模式

[shzb-crsw-s6506-1-vlan100]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/8

表示從G1/0/1 到1/0/8放入VLAN 100

建立trunk

inte***ce GigabitEthernet1/0/1

duplex full

speed 1000

* port link-type trunk

* port trunk permit vlan all

port link-aggregation group 1

帶*号的是建立trunk鍊路的語句

vlan位址指定

inte***ce Vlan-inte***ce2

description server

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

vrrp vrid 2 virtual-ip XXX.XXX.XXX.XXX

vrrp vrid 2 priority 120

vrrp vrid 2 preempt-mode timer delay 10

其中vrrp語句指定vrrp 類似與hsrp

使用vrrp要注意的是華為不支援pvst

隻能一台完全是主,一台完全是備份

在主vrrp裝置上要指定

stp instance 0 root primary

stp TC-protection enable

stp enable

在從vrrp裝置上要指定

stp instance 0 root secondary

stp TC-protection enable

stp enable

交換機下面綁acl

首先進入接口模式,輸入qos指令

[shzb-crsw-s6506-1-GigabitEthernet1/0/1]qos

在輸入如下指令

[shzb-crsw-s6506-1-qoss-GigabitEthernet1/0/1]packet-filter inbound ip-group 3000

華為交換機隻能指定inbound方向

啟用ospf

[shzb-crsw-s6506-1]ospf 100

[shzb-crsw-s6506-1-ospf-100]area 0

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]network XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

配置ospf重釋出

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]quit

[shzb-crsw-s6506-1-ospf-100]import-route static

建立link-group(類似與cisco的channel-group)

link-aggregation group 1 mode manual

然後進入接口

port link-aggregation group 1

啟用VRRP之前必須輸入

vrrp ping-enable

删除裝置配置

reset saved-configuration

重新開機

reboot

看目前配置檔案

display current-configuration

改裝置名

sysname

儲存配置

save

進入特權模式

sysview

華為隻有2層模式 不像cisco enale之後還要conf t

定義acl

acl nubmere XXXX(3000以上)進入以後

rule permit/deny IP/TCP/UDP等 source XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向)

destination XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向) eq

注意 華為預設沒有deny any any

防火牆上端口加載ACL

[Quidway-Ethernet0/0]firewall packet-filter 3000 inbound

防火牆上新增加使用者

local-user XXX(使用者名) password simple XXX(密碼)

local-user XXX service-type ppp

删除某條指令

undo(類似與cisco的no)

靜态路由

ip route-static 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX

對vpdn使用者設定acl的接口

inte***ce Virtual-Template1

檢視路由表

display ip routing-table

設定telnet密碼

user-inte***ce vty 0 4

user privilege level 3

set authentication password simple XXX

啟動/關閉

啟動 un shut

關閉 shut

動态nat設定

acl number 3000

rule 0 permit ip source XXX.XXX.XXX.XXX

rule 1 permit ip source XXX.XXX.XXX.XXX

rule 2 permit ip source XXX.XXX.XXX.XXX

inte***ce Ethernet1/0

description ====To-Internet(WAN)====

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

nat outbound 3000

ipsec policy policy1

利用acl來做 符合acl的IP位址可以出去(注意 此處的ACL隐含了deny any any)不符合的IP位址不可以出去

建立vlan

[shzb-crsw-s6506-1]vlan 100

華為vlan不支援name

将port放入vlan

建立了vlan後 進入vlan模式

[shzb-crsw-s6506-1-vlan100]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/8

表示從G1/0/1 到1/0/8放入VLAN 100

建立trunk

inte***ce GigabitEthernet1/0/1

duplex full

speed 1000

* port link-type trunk

* port trunk permit vlan all

port link-aggregation group 1

帶*号的是建立trunk鍊路的語句

vlan位址指定

inte***ce Vlan-inte***ce2

description server

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

vrrp vrid 2 virtual-ip XXX.XXX.XXX.XXX

vrrp vrid 2 priority 120

vrrp vrid 2 preempt-mode timer delay 10

其中vrrp語句指定vrrp 類似與hsrp

使用vrrp要注意的是華為不支援pvst

隻能一台完全是主,一台完全是備份

在主vrrp裝置上要指定

stp instance 0 root primary

stp TC-protection enable

stp enable

在從vrrp裝置上要指定

stp instance 0 root secondary

stp TC-protection enable

stp enable

交換機下面綁acl

首先進入接口模式,輸入qos指令

[shzb-crsw-s6506-1-GigabitEthernet1/0/1]qos

在輸入如下指令

[shzb-crsw-s6506-1-qoss-GigabitEthernet1/0/1]packet-filter inbound ip-group 3000

華為交換機隻能指定inbound方向

啟用ospf

[shzb-crsw-s6506-1]ospf 100

[shzb-crsw-s6506-1-ospf-100]area 0

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]network XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

配置ospf重釋出

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]quit

[shzb-crsw-s6506-1-ospf-100]import-route static

建立link-group(類似與cisco的channel-group)

link-aggregation group 1 mode manual

然後進入接口

port link-aggregation group 1

啟用VRRP之前必須輸入

vrrp ping-enable

使得客戶能ping網關個人總結的一些華為指令

個人總結的一些華為指令

删除裝置配置

reset saved-configuration

重新開機

reboot

看目前配置檔案

display current-configuration

改裝置名

sysname

儲存配置

save

進入特權模式

sysview

華為隻有2層模式 不像cisco enale之後還要conf t

定義acl

acl nubmere XXXX(3000以上)進入以後

rule permit/deny IP/TCP/UDP等 source XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向)

destination XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向) eq

注意 華為預設沒有deny any any

防火牆上端口加載ACL

[Quidway-Ethernet0/0]firewall packet-filter 3000 inbound

防火牆上新增加使用者

local-user XXX(使用者名) password simple XXX(密碼)

local-user XXX service-type ppp

删除某條指令

undo(類似與cisco的no)

靜态路由

ip route-static 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX

對vpdn使用者設定acl的接口

inte***ce Virtual-Template1

檢視路由表

display ip routing-table

設定telnet密碼

user-inte***ce vty 0 4

user privilege level 3

set authentication password simple XXX

啟動/關閉

啟動 un shut

關閉 shut

動态nat設定

acl number 3000

rule 0 permit ip source XXX.XXX.XXX.XXX

rule 1 permit ip source XXX.XXX.XXX.XXX

rule 2 permit ip source XXX.XXX.XXX.XXX

inte***ce Ethernet1/0

description ====To-Internet(WAN)====

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

nat outbound 3000

ipsec policy policy1

利用acl來做 符合acl的IP位址可以出去(注意 此處的ACL隐含了deny any any)不符合的IP位址不可以出去

建立vlan

[shzb-crsw-s6506-1]vlan 100

華為vlan不支援name

将port放入vlan

建立了vlan後 進入vlan模式

[shzb-crsw-s6506-1-vlan100]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/8

表示從G1/0/1 到1/0/8放入VLAN 100

建立trunk

inte***ce GigabitEthernet1/0/1

duplex full

speed 1000

* port link-type trunk

* port trunk permit vlan all

port link-aggregation group 1

帶*号的是建立trunk鍊路的語句

vlan位址指定

inte***ce Vlan-inte***ce2

description server

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

vrrp vrid 2 virtual-ip XXX.XXX.XXX.XXX

vrrp vrid 2 priority 120

vrrp vrid 2 preempt-mode timer delay 10

其中vrrp語句指定vrrp 類似與hsrp

使用vrrp要注意的是華為不支援pvst

隻能一台完全是主,一台完全是備份

在主vrrp裝置上要指定

stp instance 0 root primary

stp TC-protection enable

stp enable

在從vrrp裝置上要指定

stp instance 0 root secondary

stp TC-protection enable

stp enable

交換機下面綁acl

首先進入接口模式,輸入qos指令

[shzb-crsw-s6506-1-GigabitEthernet1/0/1]qos

在輸入如下指令

[shzb-crsw-s6506-1-qoss-GigabitEthernet1/0/1]packet-filter inbound ip-group 3000

華為交換機隻能指定inbound方向

啟用ospf

[shzb-crsw-s6506-1]ospf 100

[shzb-crsw-s6506-1-ospf-100]area 0

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]network XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

配置ospf重釋出

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]quit

[shzb-crsw-s6506-1-ospf-100]import-route static

建立link-group(類似與cisco的channel-group)

link-aggregation group 1 mode manual

然後進入接口

port link-aggregation group 1

啟用VRRP之前必須輸入

vrrp ping-enable

使得客戶能ping網關

個人總結的一些華為指令

删除裝置配置

reset saved-configuration

重新開機

reboot

看目前配置檔案

display current-configuration

改裝置名

sysname

儲存配置

save

進入特權模式

sysview

華為隻有2層模式 不像cisco enale之後還要conf t

定義acl

acl nubmere XXXX(3000以上)進入以後

rule permit/deny IP/TCP/UDP等 source XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向)

destination XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向) eq

注意 華為預設沒有deny any any

防火牆上端口加載ACL

[Quidway-Ethernet0/0]firewall packet-filter 3000 inbound

防火牆上新增加使用者

local-user XXX(使用者名) password simple XXX(密碼)

local-user XXX service-type ppp

删除某條指令

undo(類似與cisco的no)

靜态路由

ip route-static 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX

對vpdn使用者設定acl的接口

inte***ce Virtual-Template1

檢視路由表

display ip routing-table

設定telnet密碼

user-inte***ce vty 0 4

user privilege level 3

set authentication password simple XXX

啟動/關閉

啟動 un shut

關閉 shut

動态nat設定

acl number 3000

rule 0 permit ip source XXX.XXX.XXX.XXX

rule 1 permit ip source XXX.XXX.XXX.XXX

rule 2 permit ip source XXX.XXX.XXX.XXX

inte***ce Ethernet1/0

description ====To-Internet(WAN)====

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

nat outbound 3000

ipsec policy policy1

利用acl來做 符合acl的IP位址可以出去(注意 此處的ACL隐含了deny any any)不符合的IP位址不可以出去

建立vlan

[shzb-crsw-s6506-1]vlan 100

華為vlan不支援name

将port放入vlan

建立了vlan後 進入vlan模式

[shzb-crsw-s6506-1-vlan100]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/8

表示從G1/0/1 到1/0/8放入VLAN 100

建立trunk

inte***ce GigabitEthernet1/0/1

duplex full

speed 1000

* port link-type trunk

* port trunk permit vlan all

port link-aggregation group 1

帶*号的是建立trunk鍊路的語句

vlan位址指定

inte***ce Vlan-inte***ce2

description server

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

vrrp vrid 2 virtual-ip XXX.XXX.XXX.XXX

vrrp vrid 2 priority 120

vrrp vrid 2 preempt-mode timer delay 10

其中vrrp語句指定vrrp 類似與hsrp

使用vrrp要注意的是華為不支援pvst

隻能一台完全是主,一台完全是備份

在主vrrp裝置上要指定

stp instance 0 root primary

stp TC-protection enable

stp enable

在從vrrp裝置上要指定

stp instance 0 root secondary

stp TC-protection enable

stp enable

交換機下面綁acl

首先進入接口模式,輸入qos指令

[shzb-crsw-s6506-1-GigabitEthernet1/0/1]qos

在輸入如下指令

[shzb-crsw-s6506-1-qoss-GigabitEthernet1/0/1]packet-filter inbound ip-group 3000

華為交換機隻能指定inbound方向

啟用ospf

[shzb-crsw-s6506-1]ospf 100

[shzb-crsw-s6506-1-ospf-100]area 0

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]network XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

配置ospf重釋出

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]quit

[shzb-crsw-s6506-1-ospf-100]import-route static

建立link-group(類似與cisco的channel-group)

link-aggregation group 1 mode manual

然後進入接口

port link-aggregation group 1

啟用VRRP之前必須輸入

vrrp ping-enable

使得客戶能ping網關個人總結的一些華為指令

個人總結的一些華為指令

删除裝置配置

reset saved-configuration

重新開機

reboot

看目前配置檔案

display current-configuration

改裝置名

sysname

儲存配置

save

進入特權模式

sysview

華為隻有2層模式 不像cisco enale之後還要conf t

定義acl

acl nubmere XXXX(3000以上)進入以後

rule permit/deny IP/TCP/UDP等 source XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向)

destination XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向) eq

注意 華為預設沒有deny any any

防火牆上端口加載ACL

[Quidway-Ethernet0/0]firewall packet-filter 3000 inbound

防火牆上新增加使用者

local-user XXX(使用者名) password simple XXX(密碼)

local-user XXX service-type ppp

删除某條指令

undo(類似與cisco的no)

靜态路由

ip route-static 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX

對vpdn使用者設定acl的接口

inte***ce Virtual-Template1

檢視路由表

display ip routing-table

設定telnet密碼

user-inte***ce vty 0 4

user privilege level 3

set authentication password simple XXX

啟動/關閉

啟動 un shut

關閉 shut

動态nat設定

acl number 3000

rule 0 permit ip source XXX.XXX.XXX.XXX

rule 1 permit ip source XXX.XXX.XXX.XXX

rule 2 permit ip source XXX.XXX.XXX.XXX

inte***ce Ethernet1/0

description ====To-Internet(WAN)====

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

nat outbound 3000

ipsec policy policy1

利用acl來做 符合acl的IP位址可以出去(注意 此處的ACL隐含了deny any any)不符合的IP位址不可以出去

建立vlan

[shzb-crsw-s6506-1]vlan 100

華為vlan不支援name

将port放入vlan

建立了vlan後 進入vlan模式

[shzb-crsw-s6506-1-vlan100]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/8

表示從G1/0/1 到1/0/8放入VLAN 100

建立trunk

inte***ce GigabitEthernet1/0/1

duplex full

speed 1000

* port link-type trunk

* port trunk permit vlan all

port link-aggregation group 1

帶*号的是建立trunk鍊路的語句

vlan位址指定

inte***ce Vlan-inte***ce2

description server

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

vrrp vrid 2 virtual-ip XXX.XXX.XXX.XXX

vrrp vrid 2 priority 120

vrrp vrid 2 preempt-mode timer delay 10

其中vrrp語句指定vrrp 類似與hsrp

使用vrrp要注意的是華為不支援pvst

隻能一台完全是主,一台完全是備份

在主vrrp裝置上要指定

stp instance 0 root primary

stp TC-protection enable

stp enable

在從vrrp裝置上要指定

stp instance 0 root secondary

stp TC-protection enable

stp enable

交換機下面綁acl

首先進入接口模式,輸入qos指令

[shzb-crsw-s6506-1-GigabitEthernet1/0/1]qos

在輸入如下指令

[shzb-crsw-s6506-1-qoss-GigabitEthernet1/0/1]packet-filter inbound ip-group 3000

華為交換機隻能指定inbound方向

啟用ospf

[shzb-crsw-s6506-1]ospf 100

[shzb-crsw-s6506-1-ospf-100]area 0

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]network XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

配置ospf重釋出

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]quit

[shzb-crsw-s6506-1-ospf-100]import-route static

建立link-group(類似與cisco的channel-group)

link-aggregation group 1 mode manual

然後進入接口

port link-aggregation group 1

啟用VRRP之前必須輸入

vrrp ping-enable

使得客戶能ping網關

個人總結的一些華為指令

删除裝置配置

reset saved-configuration

重新開機

reboot

看目前配置檔案

display current-configuration

改裝置名

sysname

儲存配置

save

進入特權模式

sysview

華為隻有2層模式 不像cisco enale之後還要conf t

定義acl

acl nubmere XXXX(3000以上)進入以後

rule permit/deny IP/TCP/UDP等 source XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向)

destination XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向) eq

注意 華為預設沒有deny any any

防火牆上端口加載ACL

[Quidway-Ethernet0/0]firewall packet-filter 3000 inbound

防火牆上新增加使用者

local-user XXX(使用者名) password simple XXX(密碼)

local-user XXX service-type ppp

删除某條指令

undo(類似與cisco的no)

靜态路由

ip route-static 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX

對vpdn使用者設定acl的接口

inte***ce Virtual-Template1

檢視路由表

display ip routing-table

設定telnet密碼

user-inte***ce vty 0 4

user privilege level 3

set authentication password simple XXX

啟動/關閉

啟動 un shut

關閉 shut

動态nat設定

acl number 3000

rule 0 permit ip source XXX.XXX.XXX.XXX

rule 1 permit ip source XXX.XXX.XXX.XXX

rule 2 permit ip source XXX.XXX.XXX.XXX

inte***ce Ethernet1/0

description ====To-Internet(WAN)====

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

nat outbound 3000

ipsec policy policy1

利用acl來做 符合acl的IP位址可以出去(注意 此處的ACL隐含了deny any any)不符合的IP位址不可以出去

建立vlan

[shzb-crsw-s6506-1]vlan 100

華為vlan不支援name

将port放入vlan

建立了vlan後 進入vlan模式

[shzb-crsw-s6506-1-vlan100]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/8

表示從G1/0/1 到1/0/8放入VLAN 100

建立trunk

inte***ce GigabitEthernet1/0/1

duplex full

speed 1000

* port link-type trunk

* port trunk permit vlan all

port link-aggregation group 1

帶*号的是建立trunk鍊路的語句

vlan位址指定

inte***ce Vlan-inte***ce2

description server

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

vrrp vrid 2 virtual-ip XXX.XXX.XXX.XXX

vrrp vrid 2 priority 120

vrrp vrid 2 preempt-mode timer delay 10

其中vrrp語句指定vrrp 類似與hsrp

使用vrrp要注意的是華為不支援pvst

隻能一台完全是主,一台完全是備份

在主vrrp裝置上要指定

stp instance 0 root primary

stp TC-protection enable

stp enable

在從vrrp裝置上要指定

stp instance 0 root secondary

stp TC-protection enable

stp enable

交換機下面綁acl

首先進入接口模式,輸入qos指令

[shzb-crsw-s6506-1-GigabitEthernet1/0/1]qos

在輸入如下指令

[shzb-crsw-s6506-1-qoss-GigabitEthernet1/0/1]packet-filter inbound ip-group 3000

華為交換機隻能指定inbound方向

啟用ospf

[shzb-crsw-s6506-1]ospf 100

[shzb-crsw-s6506-1-ospf-100]area 0

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]network XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

配置ospf重釋出

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]quit

[shzb-crsw-s6506-1-ospf-100]import-route static

建立link-group(類似與cisco的channel-group)

link-aggregation group 1 mode manual

然後進入接口

port link-aggregation group 1

啟用VRRP之前必須輸入

vrrp ping-enable

使得客戶能ping網關個人總結的一些華為指令

個人總結的一些華為指令

删除裝置配置

reset saved-configuration

重新開機

reboot

看目前配置檔案

display current-configuration

改裝置名

sysname

儲存配置

save

進入特權模式

sysview

華為隻有2層模式 不像cisco enale之後還要conf t

定義acl

acl nubmere XXXX(3000以上)進入以後

rule permit/deny IP/TCP/UDP等 source XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向)

destination XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向) eq

注意 華為預設沒有deny any any

防火牆上端口加載ACL

[Quidway-Ethernet0/0]firewall packet-filter 3000 inbound

防火牆上新增加使用者

local-user XXX(使用者名) password simple XXX(密碼)

local-user XXX service-type ppp

删除某條指令

undo(類似與cisco的no)

靜态路由

ip route-static 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX

對vpdn使用者設定acl的接口

inte***ce Virtual-Template1

檢視路由表

display ip routing-table

設定telnet密碼

user-inte***ce vty 0 4

user privilege level 3

set authentication password simple XXX

啟動/關閉

啟動 un shut

關閉 shut

動态nat設定

acl number 3000

rule 0 permit ip source XXX.XXX.XXX.XXX

rule 1 permit ip source XXX.XXX.XXX.XXX

rule 2 permit ip source XXX.XXX.XXX.XXX

inte***ce Ethernet1/0

description ====To-Internet(WAN)====

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

nat outbound 3000

ipsec policy policy1

利用acl來做 符合acl的IP位址可以出去(注意 此處的ACL隐含了deny any any)不符合的IP位址不可以出去

建立vlan

[shzb-crsw-s6506-1]vlan 100

華為vlan不支援name

将port放入vlan

建立了vlan後 進入vlan模式

[shzb-crsw-s6506-1-vlan100]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/8

表示從G1/0/1 到1/0/8放入VLAN 100

建立trunk

inte***ce GigabitEthernet1/0/1

duplex full

speed 1000

* port link-type trunk

* port trunk permit vlan all

port link-aggregation group 1

帶*号的是建立trunk鍊路的語句

vlan位址指定

inte***ce Vlan-inte***ce2

description server

ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

vrrp vrid 2 virtual-ip XXX.XXX.XXX.XXX

vrrp vrid 2 priority 120

vrrp vrid 2 preempt-mode timer delay 10

其中vrrp語句指定vrrp 類似與hsrp

使用vrrp要注意的是華為不支援pvst

隻能一台完全是主,一台完全是備份

在主vrrp裝置上要指定

stp instance 0 root primary

stp TC-protection enable

stp enable

在從vrrp裝置上要指定

stp instance 0 root secondary

stp TC-protection enable

stp enable

交換機下面綁acl

首先進入接口模式,輸入qos指令

[shzb-crsw-s6506-1-GigabitEthernet1/0/1]qos

在輸入如下指令

[shzb-crsw-s6506-1-qoss-GigabitEthernet1/0/1]packet-filter inbound ip-group 3000

華為交換機隻能指定inbound方向

啟用ospf

[shzb-crsw-s6506-1]ospf 100

[shzb-crsw-s6506-1-ospf-100]area 0

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]network XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

配置ospf重釋出

[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]quit

[shzb-crsw-s6506-1-ospf-100]import-route static

建立link-group(類似與cisco的channel-group)

link-aggregation group 1 mode manual

然後進入接口

port link-aggregation group 1

啟用VRRP之前必須輸入

vrrp ping-enable

使得客戶能ping網關

H3C S3100

華為交換機配置

端口表示方法E1/0/1

顯示系統版本資訊:display version

顯示診斷資訊:display diagnostic-information

顯示系統目前配置:display current-configuration

顯示系統儲存配置: display saved-configuration

顯示接口資訊:display interface

顯示路由資訊:display ip routing-table

顯示VLAN資訊:display vlan

顯示生成樹資訊:display stp

顯示MAC位址表:display mac-address

顯示ARP表資訊:display arp

顯示系統CPU使用率:display cpu

顯示系統記憶體使用率:display memory

顯示系統日志:display log

顯示系統時鐘:display clock

驗證配置正确後,使用儲存配置指令:save

删除某條指令,一般使用指令: undo

system-view進入配置模式

操作完畢後save儲存配置

quit退出接口模式到系統視圖

按Tab鍵可以自動跳出完整指令

1、建立VLAN

vlan 2

删除VLAN

undo vlan 2

2、把端口劃入VLAN

int e1/0/2

port access vlan 3

端口退出vlan(在vlan裡删除端口)

inter vlan 10

undo port e 1/0/1

3、設定trunk端口

port link-type trunk(access為普通端口)

4、設定SNMP

# 設定團體名為mgr,并且可以進行讀寫通路。

[Sysname] snmp-agent community write mgr

# 删除團體名comaccess。

[Sysname] undo snmp-agent community comaccess

時間同步

[Sysname] interface Vlan-interface1

[Sysname-Vlan-interface1] ntp-service broadcast-client

使用者:

local-user <>

password  simple/cipher <>

services-type  terminal/telnet/ssh

配置了認證登入後,必須配置使用者的類型,否則會出現超級終端上登入不了的情況,

同時配level 3,否則telnet後沒有相應的操作權限

5、配console

user-interface aux 0

authentication-mode scheme/password

local-user 使用者名

password cipher 密碼

service-type telnet terminal level 3

q

配Telnet

user-interface vty 0 4

authentication-mode scheme【方案】

save

一般步驟:

先建立使用者

設定密碼

設定使用者類型

配置console加密

配置telnet加密

6、更改主機名

sysname name

7、設定端口名稱 端口描述

8、設定交換機管理位址

interface Vlan-interface 1

ip address 129.12.0.1 255.255.255.0

9、備份檔案

tftp 1.1.1.1 get abc.txt efg.txt

tftp 1.1.1.1 put config.cfg temp.cfg

10、配置靜态路由:

ip route 129.1.0.0 255.255.0.0 10.0.0.2

11、恢複出廠配置

<H3C>reset saved-configuration

<H3C>reboot

出廠配置沒有使用者名和密碼,恢複出廠設定後設定的使用者名和密碼依然存在;

12、配置生成樹(預防環路發生)

stp enable

3COM交換機配置指令詳解

1、配置檔案相關指令

[Quidway]display current-configuration         ;顯示目前生效的配置

[Quidway]display saved-configuration           ;顯示flash中配置檔案,即下次上電啟動時所用的配置檔案

<Quidway>reset saved-configuration           ;檫除舊的配置檔案

<Quidway>reboot                                    ;交換機重新開機

<Quidway>display version                          ;顯示系統版本資訊

2、基本配置

[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          ;靜态路由=網關

3、telnet配置

[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                      ;使用者級别

4、端口配置

[Quidway-Ethernet0/1]duplex {half|full|auto}                ;配置端口工作狀态

[Quidway-Ethernet0/1]speed {10|100|auto}                ;配置端口工作速率

[Quidway-Ethernet0/1]flow-control                      ;配置端口流控

[Quidway-Ethernet0/1]mdi {across|auto|normal}                ;配置端口平接扭接

[Quidway-Ethernet0/1]port link-type {trunk|access|hybrid}    ;設定端口工作模式

[Quidway-Ethernet0/1]undo shutdown                      ;激活端口

[Quidway-Ethernet0/2]quit                            ;退出系統視圖

5、鍊路聚合配置

[DeviceA] link-aggregation group 1 mode manual     ;建立手工聚合組1

[DeviceA] interface ethernet 1/0/1                             ;将以太網端口Ethernet1/0/1加入聚合組1

[DeviceA-Ethernet1/0/1] port link-aggregation group 1

[DeviceA-Ethernet1/0/1] interface ethernet 1/0/2              ;将以太網端口Ethernet1/0/1加入聚合組1

[DeviceA-Ethernet1/0/2] port link-aggregation group 1

[DeviceA] link-aggregation group 1 service-type tunnel        # 在手工聚合組的基礎上建立Tunnel業務環回組。

[DeviceA] interface ethernet 1/0/1                                    # 将以太網端口Ethernet1/0/1加入業務環回組。

[DeviceA-Ethernet1/0/1] undo stp

[DeviceA-Ethernet1/0/1] port link-aggregation group 1

6、端口鏡像

[Quidway]monitor-port <interface_type interface_num>        ;指定鏡像端口

[Quidway]port mirror <interface_type interface_num>      ;指定被鏡像端口

[Quidway]port mirror int_list observing-port int_type int_num ;指定鏡像和被鏡像

7、VLAN配置

[Quidway]vlan 3                                        ;建立VLAN

[Quidway-vlan3]port ethernet 0/1 to ethernet 0/4      ;在VLAN中增加端口

配置基于access的VLAN

[Quidway-Ethernet0/2]port access vlan 3               ;目前端口加入到VLAN         

注意:預設情況下,端口的鍊路類型為Access類型,所有Access端口均屬于且隻屬于VLAN1

配置基于trunk的VLAN

[Quidway-Ethernet0/2]port link-type trunk                          ;設定目前端口為trunk

[Quidway-Ethernet0/2]port trunk permit vlan {ID|All}      ;設trunk允許的VLAN             

注意:所有端口預設情況下都是允許VLAN1的封包通過的

[Quidway-Ethernet0/2]port trunk pvid vlan 3         ;設定trunk端口的PVID

配置基于Hybrid端口的VLAN

[Quidway-Ethernet0/2]port link-type hybrid                  ;配置端口的鍊路類型為Hybrid類型

[Quidway-Ethernet0/2]port hybrid vlan vlan-id-list { tagged | untagged }     ;允許指定的VLAN通過目前Hybrid端口

注意:預設情況下,所有Hybrid端口隻允許VLAN1通過

[Quidway-Ethernet0/2]port hybrid pvid vlan vlan-id              ;設定Hybrid端口的預設VLAN                                   

注意:預設情況下,Hybrid端口的預設VLAN為VLAN1

VLAN描述

[Quidway]description string                           ;指定VLAN描述字元

[Quidway]description                               ;删除VLAN描述字元

[Quidway]display vlan [vlan_id]                            ;檢視VLAN設定

私有VLAN配置

[SwitchA-vlanx]isolate-user-vlan enable               ;設定主vlan

[SwitchA]Isolate-user-vlan <x> secondary <list>         ;設定主vlan包括的子vlan

[Quidway-Ethernet0/2]port hybrid pvid vlan <id>         ;設定vlan的pvid

[Quidway-Ethernet0/2]port hybrid pvid                  ;删除vlan的pvid

[Quidway-Ethernet0/2]port hybrid vlan vlan_id_list untagged  ;設定無辨別的vlan

如果包的vlan id與PVId一緻,則去掉vlan資訊. 預設PVID=1。

是以設定PVID為所屬vlan id, 設定可以互通的vlan為untagged.

8、STP配置

[Quidway]stp {enable|disable}                               ;設定生成樹,預設關閉

[Quidway]stp mode rstp                                         ;設定生成樹模式為rstp

[Quidway]stp priority 4096                              ;設定交換機的優先級

[Quidway]stp root {primary|secondary}                  ;設定為根或根的備份

[Quidway-Ethernet0/1]stp cost 200                     ;設定交換機端口的花費

MSTP配置:

# 配置MST域名為info,MSTP修訂級别為1,VLAN映射關系為VLAN2~VLAN10映射到生成樹執行個體1上,VLAN20~VLAN30映射生成樹執行個體2上。

<Sysname> system-view

[Sysname] stp region-configuration

[Sysname-mst-region] region-name info

[Sysname-mst-region] instance 1 vlan 2 to 10

[Sysname-mst-region] instance 2 vlan 20 to 30

[Sysname-mst-region] revision-level 1

[Sysname-mst-region] active region-configuration

9、MAC位址表的操作

在系統視圖下添加MAC位址表項

[Quidway]mac-address { static | dynamic | blackhole } mac-address interface interface-type interface-number vlan vlan-id  ;添加MAC位址表項

在添加MAC位址表項時,指令中interface參數指定的端口必須屬于vlan參數指定的VLAN,否則将添加失敗。

如果vlan參數指定的VLAN是動态VLAN,在添加靜态MAC位址之後,會自動變為靜态VLAN。

在以太網端口視圖下添加MAC位址表項

[Quidway-Ethernet0/2]mac-address { static | dynamic | blackhole } mac-address vlan vlan-id

在添加MAC位址表項時,目前的端口必須屬于指令中vlan參數指定的VLAN,否則将添加失敗;

如果vlan參數指定的VLAN是動态VLAN,在添加靜态MAC位址之後,會自動變為靜态VLAN。

[Quidway]mac-address timer { aging age | no-aging }   ;設定MAC位址表項的老化時間

注意:預設情況下,MAC位址表項的老化時間為300秒,使用參數no-aging時表示不對MAC位址表項進行老化。

MAC位址老化時間的配置對所有端口都生效,但位址老化功能隻對動态的(學習到的或者使用者配置可老化的)MAC位址表項起作用。

[Quidway-Ethernet0/2]mac-address max-mac-count count   ;設定端口最多可以學習到的MAC位址數量

注意:預設情況下,沒有配置對端口學習MAC位址數量的限制。反之,如果端口啟動了MAC位址認證和端口安全功能,則不能配置該端口的最大MAC位址學習個數。

[Quidway-Ethernet0/2]port-mac start-mac-address    ;配置以太網端口MAC位址的起始值

在預設情況下,E126/E126A交換機的以太網端口是沒有配置MAC位址的,是以當交換機在發送二層協定封包(例如STP)時,由于無法取用發送端口的MAC位址,

将使用該協定預置的MAC位址作為源位址填充到封包中進行發送。在實際組網中,由于多台裝置都使用相同的源MAC位址發送二層協定封包,會造成在某台裝置的不

同端口學習到相同MAC位址的情況,可能會對MAC位址表的維護産生影響。

[Quidway]display mac-address       ;顯示位址表資訊

[Quidway]display mac-address aging-time         ;顯示位址表動态表項的老化時間

[Quidway]display port-mac            ;顯示使用者配置的以太網端口MAC位址的起始值

10、GVRP配置

[SwitchA] gvrp      # 開啟全局GVRP

[SwitchA-Ethernet1/0/1] gvrp     # 在以太網端口Ethernet1/0/1上開啟GVRP

[SwitchE-Ethernet1/0/1] gvrp registration { fixed | forbidden | normal }   #  配置GVRP端口注冊模式    預設為normal

[SwitchA] display garp statistics [ interface interface-list ]    ;顯示GARP統計資訊

[SwitchA] display garp timer [ interface interface-list ]       ;顯示GARP定時器的值

[SwitchA] display gvrp statistics [ interface interface-list ]    ;顯示GVRP統計資訊

[SwitchA] display gvrp status                                             ;顯示GVRP的全局狀态資訊

[SwitchA] display gvrp statusreset garp statistics [ interface interface-list ]    ;清除GARP統計資訊

11、DLDP配置

[SwitchA] interface gigabitethernet 1/1/1        # 配置端口工作在強制全雙工模式,速率為1000Mbits/s。

[SwitchA-GigabitEthernet1/1/1] duplex full

[SwitchA-GigabitEthernet1/1/1] speed 1000

[SwitchA] dldp enable       # 全局開啟DLDP。

[SwitchA] dldp interval 15    # 設定發送DLDP封包的時間間隔為15秒。

[SwitchA]  dldp work-mode { enhance | normal }   # 配置DLDP協定的工作模式為加強模式。     預設為normal

[SwitchA] dldp unidirectional-shutdown  { auto | manual }    # 配置DLDP單向鍊路操作模式為自動模式。  預設為auto

[SwitchA] display dldp 1     # 檢視DLDP狀态。

當光纖交叉連接配接時,可能有兩個或三個端口處于Disable狀态,剩餘端口處于Inactive狀态。

當光纖一端連接配接正确,一端未連接配接時:

如果DLDP的工作模式為normal,則有收光的一端處于Advertisement狀态,沒有收光的一端處于Inactive狀态。

如果DLDP的工作模式為enhance,則有收光的一端處于Disable狀态,沒有收光的一端處于Inactive狀态。

dldp reset指令在全局下可以重置所有端口的DLDP狀态,在接口下可以充值該端口的DLDP狀态

12、端口隔離配置

通過端口隔離特性,使用者可以将需要進行控制的端口加入到一個隔離組中,實作隔離組中的端口之間二層、三層資料的隔離,既增強了網絡的安全性,也為使用者

提供了靈活的組網方案。

[Sysname] interface ethernet1/0/2   # 将以太網端口Ethernet1/0/2加入隔離組。

[Sysname-Ethernet1/0/2] port isolate

[Sysname]display isolate port   # 顯示隔離組中的端口資訊

配置隔離組後,隻有隔離組内各個端口之間的封包不能互通,隔離組内端口與隔離組外端口以及隔離組外端口之間的通信不會受到影響。

端口隔離特性與以太網端口所屬的VLAN無關。

當彙聚組中的某個端口加入或離開隔離組後,本裝置中同一彙聚組内的其它端口,均會自動加入或離開該隔離組。

對于既處于某個聚合組又處于某個隔離組的一組端口,其中的一個端口離開聚合組時不會影響其他端口,即其他端口仍将處于原聚合組和原隔離組中。

如果某個聚合組中的端口同時屬于某個隔離組,當在系統視圖下直接删除該聚合組後,該聚合組中的端口仍将處于該隔離組中。

當隔離組中的某個端口加入聚合組時,該聚合組中的所有端口,将會自動加入隔離組中。

13、端口安全配置

[Switch] port-security enable   # 啟動端口安全功能

[Switch] interface Ethernet 1/0/1  # 進入以太網Ethernet1/0/1端口視圖

[Switch-Ethernet1/0/1] port-security max-mac-count 80  # 設定端口允許接入的最大MAC位址數為80

[Switch-Ethernet1/0/1] port-security port-mode autolearn  # 配置端口的安全模式為autolearn

[Switch-Ethernet1/0/1] mac-address security 0001-0002-0003 vlan 1   # 将Host 的MAC位址0001-0002-0003作為Security MAC添加到VLAN 1中

[Switch-Ethernet1/0/1] port-security intrusion-mode disableport-temporarily   # 設定Intrusion Protection特性被觸發後,暫時關閉該端口

[Switch]port-security timer disableport 30       # 關閉時間為30秒。

14、端口綁定配置

通過端口綁定特性,網絡管理者可以将使用者的MAC位址和IP位址綁定到指定的端口上。進行綁定操作後,交換機隻對從該端口收到的指定MAC位址和IP地

址的使用者發出的封包進行轉發,提高了系統的安全性,增強了對網絡安全的監控。

[SwitchA-Ethernet1/0/1] am user-bind mac-addr 0001-0002-0003 ip-addr 10.12.1.1   # 将Host 1的MAC位址和IP位址綁定到Ethernet1/0/1端口。

有的交換機上綁定的配置不一樣

[SwitchA] interface ethernet 1/0/2

[SwitchA-Ethernet1/0/2] user-bind ip-address 192.168.0.3 mac-address 0001-0203-0405

端口過濾配置

[SwitchA] interface ethernet1/0/1      # 配置端口Ethernet1/0/1的端口過濾功能。

[SwitchA-Ethernet1/0/1] ip check source ip-address mac-address

[SwitchA] dhcp-snooping        # 開啟DHCP Snooping功能。

[SwitchA] interface ethernet1/0/2       # 設定與DHCP伺服器相連的端口Ethernet1/0/2為信任端口。

[SwitchA-Ethernet1/0/2] dhcp-snooping trust

在端口Ethernet1/0/1上啟用IP過濾功能,防止用戶端使用僞造的不同源IP位址對伺服器進行攻擊

15、BFD配置

Switch A、Switch B、Switch C互相可達,在Switch A上配置靜态路由可以到達Switch C,并使能BFD檢測功能。

# 在Switch A上配置靜态路由,并使能BFD檢測功能,通過BFD echo封包方式實作BFD功能。

<SwitchA> system-view

[SwitchA] bfd echo-source-ip 123.1.1.1

[SwitchA] interface vlan-interface 10

[SwitchA-vlan-interface10] bfd min-echo-receive-interval 300

[SwitchA-vlan-interface10] bfd detect-multiplier 7  

[SwitchA-vlan-interface10] quit

[SwitchA] ip route-static 120.1.1.1 24 10.1.1.100 bfd echo-packet

# 在Switch A上打開BFD功能調試資訊開關。

<SwitchA> debugging bfd event

<SwitchA> debugging bfd scm

<SwitchA> terminal debugging

在Switch A上可以打開BFD功能調試資訊開關,斷開Hub和Switch B之間的鍊路,驗證配置結果。驗證結果顯示,

Switch A能夠快速感覺Switch A與Switch B之間鍊路的變化。

16、QinQ配置

Provider A、Provider B之間通過Trunk端口連接配接,Provider A屬于營運商網絡的VLAN1000,Provider B屬于營運商網絡的VLAN2000。

Provider A和Provider B之間,營運商采用其他廠商的裝置,TPID值為0x8200。

希望配置完成後達到下列要求:

Customer A的VLAN10的封包可以和Customer B的VLAN10的封包經過營運商網絡的VLAN1000轉發後互通;Customer A的VLAN20的封包可以

和Customer C的VLAN20的封包經過營運商網絡的VLAN2000轉發後互通。

[ProviderA] interface ethernet 1/0/1   # 配置端口為Hybrid端口,且允許VLAN10,VLAN20,VLAN1000和VLAN2000的封包通過,并且在發送時去掉外層Tag。

[ProviderA-Ethernet1/0/1] port link-type hybrid

[ProviderA-Ethernet1/0/1] port hybrid vlan 10 20 1000 2000 untagged

[ProviderA-Ethernet1/0/1] qinq vid 1000     # 将來自VLAN10的封包封裝VLAN ID為1000的外層Tag。

[ProviderA-Ethernet1/0/1-vid-1000] raw-vlan-id inbound 10

[ProviderA-Ethernet1/0/1-vid-1000] quit

[ProviderA-Ethernet1/0/1] qinq vid 2000    # 将來自VLAN20的封包封裝VLAN ID為2000的外層Tag。

[ProviderA-Ethernet1/0/1-vid-2000] raw-vlan-id inbound 20

[ProviderA] interface ethernet 1/0/2    # 配置端口的預設VLAN為VLAN1000。

[ProviderA-Ethernet1/0/2] port access vlan 1000

[ProviderA-Ethernet1/0/2] qinq enable   # 配置端口的基本QinQ功能,将來自VLAN10的封包封裝VLAN ID為1000的外層Tag。

[ProviderA] interface ethernet 1/0/3   # 配置端口為Trunk端口,且允許VLAN1000和VLAN2000的封包通過。

[ProviderA-Ethernet1/0/3] port link-type trunk

[ProviderA-Ethernet1/0/3] port trunk permit vlan 1000 2000

[ProviderA-Ethernet1/0/3] qinq ethernet-type 8200   # 為與公共網絡中的裝置進行互通,配置端口添加外層Tag時采用的TPID值為0x8200。

[ProviderB] interface ethernet 1/0/1   # 配置端口為Trunk端口,且允許VLAN1000和VLAN2000的封包通過。

[ProviderB-Ethernet1/0/1] port link-type trunk

[ProviderB-Ethernet1/0/1] port trunk permit vlan 1000 2000

[ProviderB-Ethernet1/0/1] qinq ethernet-type 8200   # 為與公共網絡中的裝置進行互通,配置端口添加外層Tag時采用的TPID值為0x8200。

[ProviderB-Ethernet1/0/1] quit

[ProviderB] interface ethernet 1/0/2   # 配置端口的預設VLAN為VLAN2000。

[ProviderB-Ethernet1/0/2] port access vlan 2000

[ProviderB-Ethernet1/0/2] qinq enable   # 配置端口的基本QinQ功能,将來自VLAN20的封包封裝VLAN ID為2000的外層Tag。