2021-10-13 華為交換機(jī)路由HCNA命令總結(jié)

進(jìn)入系統(tǒng)視圖:system-view

進(jìn)入某一個接口:interface g0/0/0? (接口名稱)

在用戶視圖中查看配置信息:display current-configuration

在用戶視圖中查看接口信息:display interface brief

接口中配置IP地址:ip address 10.0.0.1 24

接口中消除IP地址 :undo ip address 10.0.0.1 24

配置banner信息:1、遠(yuǎn)程登陸信息:header login information "welcome to AR1"? 2、本地登錄 header shell information "welcome to AR1"

設(shè)置console需要密碼登錄:

1、進(jìn)入console接口:user-interface console 0

2、使用 authentication-mode password 命令配置密碼長度

3、指定密碼長度

4、輸入 set authentication password cipher huawei 命令設(shè)置密碼

配置console超時時間:

1、進(jìn)入console接口:user-interface console 0

2、配置超時時間:idle-timeout 30 30? 30分鐘30秒以后超時

設(shè)置用戶名密碼登錄設(shè)備:

1、進(jìn)入console接口:user-interface console 0

2、設(shè)置密碼類型為3A:authentication-mode aaa

3、quit 到系統(tǒng)視圖

4、輸入 aaa 進(jìn)入 3A模式

5、設(shè)置密碼:local-user (用戶名) password cipher (密碼)? ? 如:local-user huawei password cipher huawei

6、設(shè)置服務(wù)類型:local-user huawei service-type terminal? (因?yàn)檫@里設(shè)置的是console口,所以選擇terminal,如果是telnet,就選擇telnet)

7、設(shè)置用戶級別(權(quán)限):local-user huawei privilege level 3? (可以選擇0-15,3-15是所有權(quán)限都可以使用)

設(shè)置telnet密碼登錄:

第一種:

1、[AR1] user-interface vty 0 4?

2、authentication-mode password 設(shè)置模式為密碼模式

3、set authentication password cipher huawei? 設(shè)置密碼為huawei

4、user privilege level 3? 設(shè)置用戶權(quán)限為3

第二種:

1、[AR1] user-interface vty 0 4 進(jìn)入用戶接口

2、[AR1-ui-vty0-4] authentication-mode aaa? 設(shè)置模式為 aaa

3、[AR1-ui-vty0-4] quit? 退出

4、[AR1] aaa? 進(jìn)入aaa 模式

5、[AR1-aaa] local-user huawei password cipher huawei? 設(shè)置用戶為huawei ,密碼為 huawei

6、[AR1-aaa] local-user huawei privilege level 3? 設(shè)置權(quán)限為 3

7、[AR1-aaa] local-user huawei service-type telnet? 設(shè)置服務(wù)類型為 telnet

設(shè)置ssh登錄:

1、aaa? 進(jìn)入aaa模式

2、[AR1-aaa] local-user huawei password cipher huawei privilege level 3? 創(chuàng)建賬戶密碼都為huawei ,權(quán)限等級為3

3、[AR1-aaa] local-user huawei service-type ssh? 設(shè)置服務(wù)類型為ssh

4、quit

4、[AR1] ssh user huawei authentication-type password 設(shè)置ssh用戶認(rèn)證模式為password

5、[AR1]stelnet server enable 開啟ssh服務(wù)

6、[AR1]rsa local-key-pair create? 創(chuàng)建rsa密鑰

7、[AR1]user-interface vty 0 4 設(shè)置幾個用戶登錄

8、[AR1-ui-vty0-4]authentication-mode aaa 設(shè)置模式為aaa

9、[AR1-ui-vty0-4]protocol inbound ssh 綁定協(xié)議為ssh

10、[AR2]ssh client first-time enable 在登錄端開啟ssh客戶端

11、[AR2]stelnet 10.0.0.1 ssh連接

VLSM 可變長子網(wǎng)劃分

CIDR 無類域間路由:減少路由表的規(guī)模,增強(qiáng)了網(wǎng)絡(luò)擴(kuò)展性

例:172.16.16.0/24

? ? ? 172.16.17.0/24

? ? ? 172.16.18.0/24

? ? ? 172.16.19.0/24

172.16.00010000.0

172.16.00010001.0

172.16.00010010.0

172.16.00010011.0

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

172.16.00010000.0=172.16.16.0/22

全雙工配置:duplex full / half? full--開啟(全雙工) half --關(guān)閉(半雙工)

恢復(fù)雙工模式為缺省值:undo duplex

開啟接口自動協(xié)商功能(默認(rèn)開啟):negotiation auto? 關(guān)閉:undo negotiation auto

創(chuàng)建VLAN

1、[Huawei] vlan 2 創(chuàng)建vlan 2

2、[Huawei-vlan2] int g0/0/2 進(jìn)入g0/0/2 端口

3、[Huawei-GigabitEthernet0/0/2] port link-type access 把端口改為接入端口(連接終端的一般都是接入端口)

4、[Huawei-GigabitEthernet0/0/2] port default vlan 2 把端口加入vlan 2

5、[Huawei-GigabitEthernet0/0/2] display vlan 展示 vlan口

去除vlan

1、access 口:undo port default vlan

2、trunk口:undo port trunk allow-pass vlan 2

1、去除接口類型:undo port link-type

Access 端口收報(bào)文:如果收到對端設(shè)備發(fā)送的幀是untagged(不帶VLAN標(biāo)簽),交換機(jī)將強(qiáng)制加上該端口的PVID。

? ? ? ? ? ? ? 如果收到對端設(shè)備發(fā)送的幀是tagged(帶VLAN標(biāo)簽),交換機(jī)會檢查該標(biāo)簽的VLAN ID。當(dāng)VLAN ID與

? ? ? ? ? ? ? 該端口的PVID相同時,接受該報(bào)文,當(dāng)VLAN ID與該端口的PV ID不同時,丟棄。

Access 端口發(fā)報(bào)文:先將報(bào)文的VLAN 信息剝離,然后在發(fā)送出去,ACCESS端口放往對端的設(shè)備的以太網(wǎng)數(shù)據(jù)幀永遠(yuǎn)都是不帶標(biāo)簽的幀

TRUNK? :用與交換機(jī)之間的連接,相同vlan互通

TRUNK 端口收報(bào)文:如果幀不包含VLAN信息,將添加上端口的PVID;如果該幀包含VLAN信息,則不改變

TRUNK 端口發(fā)報(bào)文:該幀的VLAN ID是否在Trunk允許的發(fā)送列表中,如果在才發(fā)送,反之不發(fā)送,然后比較將要發(fā)送報(bào)文的VLAN信息和端口的PVID,

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 如果不相等則直接發(fā)送。如果兩者相等則剝離VLAN信息,再發(fā)送

1、[SW2]int g0/0/3

2、[SW2-GigabitEthernet0/0/3]port link-type trunk? ? 配置為trunk口

3、[SW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 3? 允許vlan2 vlan3 通過

display port vlan active 查看端口信息

hybrid 端口 具有access和trunk特點(diǎn)(默認(rèn)端口類型)

? ? ? ? undo info-center enable 關(guān)閉配置彈窗信息

實(shí)現(xiàn)access端口功能:

1、[SW1-GigabitEthernet0/0/1] port hybrid pvid vlan 2? ? 經(jīng)過這個端口的幀打上vlan2標(biāo)簽

2、[SW1-GigabitEthernet0/0/1] port hybrid untagged vlan 2 經(jīng)過這個口出去的數(shù)據(jù)幀去掉van2標(biāo)簽

實(shí)現(xiàn)trunk端口功能:

1、[SW1-GigabitEthernet0/0/3]port link-type hybrid

2、[SW1-GigabitEthernet0/0/3]port hybrid tagged vlan 2 3

生成樹:STP通過阻塞端口來消除環(huán)路,并能實(shí)現(xiàn)鏈路備份作用

生成樹協(xié)議運(yùn)行生成樹算法(STA).生成樹算法很復(fù)雜,但是其過程可以歸納為以下3個步驟:

(1)選擇根網(wǎng)橋

(2)選擇根端口

(3)選擇指定端口

配置生成樹協(xié)議:交換機(jī)默認(rèn)開啟STP生成樹協(xié)議

1、[SW2] stp mode stp 開啟生成樹STP協(xié)議

2、[SW2] stp mode stp 更改生成樹模式為STP?

3、[SW3] display stp brief 查看stp生成樹端口信息

4、[SW1] display stp 查看生成樹協(xié)議信息

5、指定誰是根橋,備份根橋

6、[SW1] stp priority 4096? 設(shè)置生成樹STP優(yōu)先級為4096

配置快速生成樹RSTP:

單臂路由實(shí)現(xiàn)vlan間路由:

1、交換機(jī)接路由器端配置trunk

2、路由器配置

3、[AR1]int g0/0/0.2? 配置子接口

4、[AR1-GigabitEthernet0/0/0.2]dot1q termination vid 2

5、[AR1-GigabitEthernet0/0/0.2]ip address 192.168.2.1 24

6、[AR1-GigabitEthernet0/0/0.2]arp broadcast enable

7、[AR1]int g0/0/0.3

8、[AR1-GigabitEthernet0/0/0.3]dot1q termination vid 3

9、[AR1-GigabitEthernet0/0/0.3]ip address 192.168.3.1 24

10、[AR1-GigabitEthernet0/0/0.3]arp broadcast enable

11、[AR1]display ip routing-table 查看路由表

三層交換機(jī)實(shí)現(xiàn)vlan間路由

1、[SW1]interface Vlanif 2? 配置邏輯接口

2、[SW1-Vlanif2]ip add 192.168.2.1 24

3、[SW1]interface Vlanif 3

4、[SW1-Vlanif3]ip add 192.168.3.1 24

二層鏈路聚合:手工負(fù)載分擔(dān)模式

1、[SW2]interface Eth-Trunk 1

2、[SW2-Eth-Trunk1]trunkport g0/0/3 把接口加入Eth-Trunk 1

3、[SW2-Eth-Trunk1]trunkport g0/0/4

4、[SW2-Eth-Trunk1]trunkport g0/0/5

5、[SW2-Eth-Trunk1]trunkport g0/0/6

6、[SW2-Eth-Trunk1]port link-type trunk

7、[SW2-Eth-Trunk1]port trunk allow-pass vlan 2 3

8、[SW2-GigabitEthernet0/0/6] undo shutdown 打開端口

9、[SW2]clear configuration g0/0/3 清理端口配置

LACP鏈路聚合

1、[SW1]interface Eth-Trunk 1 創(chuàng)建Eth-Trunk端口

2、[SW1-Eth-Trunk1]mode lacp-static 模式改為lacp

3、[SW1-Eth-Trunk1]trunkport g0/0/3 把端口加入Eth-Trunk

4、[SW1-Eth-Trunk1]trunkport g0/0/4 把端口加入Eth-Trunk.

5、[SW1-Eth-Trunk1]trunkport g0/0/5 把端口加入Eth-Trunk

6、[SW1-Eth-Trunk1]trunkport g0/0/6 把端口加入Eth-Trunk

7、[SW1]int g0/0/3 進(jìn)入接口

8、[SW1-GigabitEthernet0/0/3]undo shutdown 激活接口

9、[SW1]interface Eth-Trunk 1 進(jìn)入Eth-Trunk端口

10、[SW1-Eth-Trunk1]port link-type trunk 把 Eth-Trunk端口模式改為trunk

11、[SW1-Eth-Trunk1]port trunk? allow-pass vlan 2 3 允許 vlan 2 3 通過

12、[SW1]lacp priority 100 把優(yōu)先級改為100 改為主動端

13、[SW1-Eth-Trunk1]max active-linknumber 2 活動端口最多允許2個端口

14、[SW1-GigabitEthernet0/0/3]lacp priority 100 把端口優(yōu)先級改為100,就是把3端口指定為活動端口

15、[SW1-GigabitEthernet0/0/4]lacp priority 100

三層交換機(jī)實(shí)現(xiàn)鏈路聚合

1、[Huawei]interface Eth-Trunk 1 創(chuàng)建Eth-Trunk端口

2、[Huawei-Eth-Trunk1]undo portswitch 關(guān)閉二層接口

3、[Huawei-Eth-Trunk1]ip add 10.0.0.3 24 配置IP地址

4、[Huawei-Eth-Trunk1]trunkport g0/0/0 把g0/0/0加入Eth-Trunk口

5、[Huawei-Eth-Trunk1]trunkport g0/0/1 把g0/0/1加入Eth-Trunk口

路由

1、什么是路由:路由是指導(dǎo)IP報(bào)文發(fā)送的路徑信息

靜態(tài)路由配置:

1、[Huawei]int g0/0/1

2、[Huawei-GigabitEthernet0/0/0]ip address 12.1.1.2 24 配置接口IP地址

3、[Huawei] ip route-static 192.168.1.0(目標(biāo)網(wǎng)段) 255.255.255.0 12.1.1.1(下一跳網(wǎng)關(guān))? 配置靜態(tài)路由

4、靜態(tài)路由選擇最長匹配原則

靜態(tài)路由負(fù)載均衡:

1、連接另外兩根線以上,端口都配置IP

2、ip route-static 192.168.1.0(目標(biāo)網(wǎng)段) 255.255.255.0 21.1.1.1(下一跳網(wǎng)關(guān))

靜態(tài)路由備份路由:調(diào)整路由優(yōu)先級(默認(rèn)60)

1、ip route-static 192.168.1.0? 255.255.255.0? 12.1.1.1 preference 100

默認(rèn)路由原理及配置

默認(rèn)路由優(yōu)先級最低

1、ip route-static 0.0.0.0 0.0.0.0 12.1.1.1

2、ip route-static 0.0.0.0 0.0.0.0 23.1.1.3

OSPF協(xié)議工作原理

OSPF(開放最短路徑優(yōu)先)屬于IGP內(nèi)部網(wǎng)關(guān)路由協(xié)議,協(xié)議基于鏈路狀態(tài)算法。

OSPF直接運(yùn)行于IP協(xié)議之上,使用IP協(xié)議號89.

OSPF單區(qū)域配置

1、interface LoopBack 0? 進(jìn)入回環(huán)接口

2、[Huawei-LoopBack0]ip address 2.2.2.2 24 配置回環(huán)接口 IP 地址

3、[Huawei-GigabitEthernet0/0/1]int g0/0/0

4、[Huawei-GigabitEthernet0/0/0]ip address 23.1.1.2 24

5、[Huawei]ospf 100 router-id 2.2.2.2 配置osfp 進(jìn)程ID和router-id

6、[Huawei-ospf-100]area 0 進(jìn)入?yún)^(qū)域0

7、[Huawei-ospf-100-area-0.0.0.0]network 2.2.2.0 0.0.0.255 配置IP段和反掩碼

8、display ospf routing? 查看ospf路由信息

9、display ospf peer 查看ospf信息

OSPF中DR和BDR

DR:可以減少廣播型網(wǎng)絡(luò)中的鄰接關(guān)系的數(shù)量

reset ospf 100 process 調(diào)整ospf優(yōu)先級

1、[Huawei]ospf 100

2、[Huawei-ospf-100]bandwidth-reference 10000

調(diào)整cost最佳路由

OSPF多區(qū)域配置

1、interface LoopBack 0? 進(jìn)入回環(huán)接口

2、[Huawei-LoopBack0]ip address 2.2.2.2 24 配置回環(huán)接口 IP 地址

3、[Huawei-GigabitEthernet0/0/1]int g0/0/0

4、[Huawei-GigabitEthernet0/0/0]ip address 23.1.1.2 24

5、[Huawei]ospf 100 router-id 2.2.2.2 配置osfp 進(jìn)程ID和router-id

6、[Huawei-ospf-100]area 0 進(jìn)入?yún)^(qū)域0

7、[Huawei-ospf-100-area-0.0.0.0]network 2.2.2.0 0.0.0.255 配置IP段和反掩碼

6、[Huawei-ospf-100]area 1 進(jìn)入?yún)^(qū)域1

7、[Huawei-ospf-100-area-0.0.0.1]network 2.2.2.0 0.0.0.255 配置IP段和反掩碼

8、display ospf routing? 查看ospf路由信息

9、display ospf peer 查看ospf信息

配置DHCP服務(wù)器

DHCP接口地址:

1、[Huawei]dhcp enable? 開啟DHCP

2、[Huawei]int g0/0/0 進(jìn)入g0/0/0接口

3、[Huawei-GigabitEthernet0/0/0]dhcp select interface? 選擇接口作為DHCP

4、[Huawei-GigabitEthernet0/0/0]dhcp server dns-list 4.4.4.4 設(shè)置dns為4.4.4.4

5、[Huawei-GigabitEthernet0/0/0]dhcp server excluded-ip-address 192.168.1.2 192.168.1.10 除開192.168.1.2到192.168.1.10地址

6、[Huawei-GigabitEthernet0/0/0]dhcp server lease day 5 IP地址租期為5天

7、[Huawei]display ip pool? 顯示DHCP IP池

DHCP全局地址池配置

1、[Huawei]dhcp enable? 開啟DHCP

2、[Huawei]ip pool R1 創(chuàng)建一個IP池 名字為R1

3、[Huawei-ip-pool-R1]undo network 關(guān)閉network

4、[Huawei-ip-pool-R1]network 192.168.2.0 mask 24 通告192.168.2.0網(wǎng)段,掩碼24位

5、[Huawei-ip-pool-R1]gateway-list 192.168.2.1 網(wǎng)關(guān)為192.168.2.1

6、[Huawei-ip-pool-R1]dns-list 8.8.8.8 DNS是8.8.8.8

7、[Huawei-ip-pool-R1]excluded-ip-address 192.168.2.200 192.168.2.254 除去192.168.2.200到192.168.2.254

8、[Huawei-ip-pool-R1]lease day 10 租期為10天

9、[Huawei]int g0/0/0 進(jìn)入g0/0/0 接口

10、[Huawei-GigabitEthernet0/0/0]ip address 192.168.2.1 24 配IP地址

11、[Huawei-GigabitEthernet0/0/0]dhcp select global? 配置DHCP選擇全局

12、display ip pool 查看IP池

DHCP中繼代理

1、[LSW1]vlan 2

2、[LSW1-vlan2]int g0/0/2

3、[LSW1-GigabitEthernet0/0/2]port link-type access

4、[LSW1-GigabitEthernet0/0/2]port default vlan 2

5、[LSW1]vlan 3

6、[LSW1-GigabitEthernet0/0/3]port link-type access

7、[LSW1-GigabitEthernet0/0/3]port default vlan 3

8、[LSW1]interface Vlanif 1

9、[LSW1-Vlanif1]ip address 12.1.1.1 24

10、[LSW1-Vlanif1]interface vlanif 2

11、[LSW1-Vlanif2]ip address 192.168.2.1 24

12、[LSW1-Vlanif2]interface vlanif 3

13、[LSW1-Vlanif3]ip address 192.168.3.1 24

14、[LSW1-Vlanif3]ospf 1? 這里沒有配置routing-id

15、[LSW1-ospf-1]area 0

16、[LSW1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255

17、[LSW1-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255

18、[LSW1-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255

19、[LSW1]dhcp enable

20、[LSW1-Vlanif3]int vlanif 2

21、[LSW1-Vlanif2]dhcp select relay

22、[LSW1-Vlanif2]dhcp relay server-ip 12.1.1.2

23、[LSW1-Vlanif2]interface vlanif 3

24、[LSW1-Vlanif3]dhcp select relay

25、[LSW1-Vlanif3]dhcp relay server-ip 12.1.1.2

26、路由器當(dāng)作DHCP服務(wù)器配置如下:

dhcp enable

ip pool vlan2

gateway-list 192.168.2.1

network 192.168.2.0 mask 255.255.255.0

lease day 2 hour 0 minute 0

dns-list 4.4.4.4

ip pool vlan3

gateway-list 192.168.3.1

network 192.168.3.0 mask 255.255.255.0

lease day 3 hour 0 minute 0

dns-list 8.8.8.8

interface GigabitEthernet0/0/0

ip address 12.1.1.2 255.255.255.0

dhcp select global

ospf 1

area 0.0.0.0

? network 12.1.1.0 0.0.0.255

ACL 可以通過定義規(guī)則來允許或拒絕流量通過

基礎(chǔ)ACL

1、[Huawei]acl 2000? 進(jìn)入基礎(chǔ)acl

2、[Huawei-acl-basic-2000]rule deny source 192.168.1.0 0.0.0.255 配置acl規(guī)則

3、[Huawei]int g0/0/0 進(jìn)入g/0/0/0接口

4、[Huawei-GigabitEthernet0/0/0]traffic-filter inbound acl 2000 接口調(diào)用acl規(guī)則

高級ACL

1、[Huawei]acl 3000? 進(jìn)入基礎(chǔ)acl

2、[AR2-acl-adv-3000]rule deny tcp source 12.1.1.0 0.0.0.255 destination 23.1.1.0 0.0.0.0 destination-port eq 23 配置acl規(guī)則

3、[Huawei]int g0/0/0 進(jìn)入g/0/0/0接口

4、[Huawei-GigabitEthernet0/0/0]traffic-filter inbound acl 3000 接口調(diào)用acl規(guī)則

靜態(tài)NAT

1、[AR2-GigabitEthernet0/0/1]nat static global 12.1.1.12 inside 192.168.1.2? 配置nat

? ? ? [AR2-GigabitEthernet0/0/1]nat static global 12.1.1.13 inside 192.168.1.3

2、[AR2]display nat static 查看nat

動態(tài)NAT

1、[Huawei]nat address-group 1 12.1.1.20 12.1.1.30 創(chuàng)建一個地址池

2、[Huawei]acl 2000 創(chuàng)建基礎(chǔ)ACL

3、[Huawei-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255 允許網(wǎng)段通過

4、[Huawei-acl-basic-2000]rule deny? 阻止其它數(shù)據(jù)包

5、[Huawei-GigabitEthernet0/0/1]nat outbound 2000 address-group 1 no-pat? 轉(zhuǎn)換acl網(wǎng)段的地址到公網(wǎng)地址

NAPT

1、[Huawei]nat address-group 1 12.1.1.40 12.1.1.40 創(chuàng)建一個地址池

2、[Huawei]acl 2000 創(chuàng)建基礎(chǔ)ACL

3、[Huawei-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255 允許網(wǎng)段通過

4、[Huawei-acl-basic-2000]rule deny? 阻止其它數(shù)據(jù)包

5、[Huawei-GigabitEthernet0/0/1]nat outbound 2000 address-group 1轉(zhuǎn)換acl網(wǎng)段的地址到公網(wǎng)地址

Easy & ip

1、[Huawei]acl 2000 創(chuàng)建基礎(chǔ)ACL

2、[Huawei-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255 允許網(wǎng)段通過

3、[Huawei-acl-basic-2000]rule deny? 阻止其它數(shù)據(jù)包

4、[Huawei-GigabitEthernet0/0/1]nat outbound 2000

NAT Server

1、[AR1-GigabitEthernet0/0/1]nat server protocol icmp global 12.1.1.10 inside 192.168.1.2? 配置icmp協(xié)議

2、[AR1-GigabitEthernet0/0/1]nat server protocol tcp global 12.1.1.11 www inside 192.168.1.3 www? 配置www服務(wù)

pap認(rèn)證

認(rèn)證方:

1、[AR1]aaa

2、[AR1-aaa]local-user huawei password cipher huawei

3、[AR1-aaa]local-user huawei service-type ppp

4、[AR1]interface Serial 1/0/0

5、[AR1-Serial1/0/0]link-protocol ppp

6、[AR1-Serial1/0/0]ppp authentication-mode pap

7、[AR1-Serial1/0/0]ip address 12.1.1.1 24

被認(rèn)證方:

1、[AR2]interface Serial 1/0/0

2、[AR2-Serial1/0/0]ip address 12.1.1.2 24

3、[AR1-Serial1/0/0]link-protocol ppp

4、AR2-Serial1/0/0]ppp pap local-user huawei password cipher huawei

chap認(rèn)證

認(rèn)證方:

1、[Huawei]aaa

2、[Huawei-aaa]local-user huawei password cipher huawei

3、[Huawei-aaa]local-user huawei service-type ppp

4、[Huawei]interface Serial 1/0/0

5、[Huawei-Serial1/0/0]link-protocol ppp

6、[Huawei-Serial1/0/0]ppp authentication-mode chap

被認(rèn)證方:

1、[Huawei]interface Serial 1/0/0

2、[Huawei-Serial1/0/0]link-protocol ppp

3、[Huawei-Serial1/0/0]ppp chap user huawei

4、[Huawei-Serial1/0/0]ppp chap password cipher huawei

綜合實(shí)驗(yàn)

sw1

1、[Huawei-GigabitEthernet0/0/2]port link-type access

2、[Huawei-GigabitEthernet0/0/2]port default vlan 10

3、[Huawei-GigabitEthernet0/0/3]port link-type access

4、[Huawei-GigabitEthernet0/0/3]port default vlan 20

5、[Huawei-GigabitEthernet0/0/1]port link-type trunk

6、[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20

AR2

1、[AR2]int g0/0/1.10

2、[AR2-GigabitEthernet0/0/1.10]ip address 192.168.10.1 24

3、[AR2-GigabitEthernet0/0/1.10]dot1q termination vid 10

4、[AR2-GigabitEthernet0/0/1.10]arp broadcast enable

5、[AR2]int g0/0/1.20

6、[AR2-GigabitEthernet0/0/1.20]ip address 192.168.20.1 24

7、[AR2-GigabitEthernet0/0/1.20]dot1q termination vid 20

8、[AR2-GigabitEthernet0/0/1.20]arp broadcast enable

9、[AR2-GigabitEthernet0/0/0]ip address 10.1.12.1 24

ospf

10、[AR2]ospf 100

11、[AR2-ospf-100]area 0

12、[AR2-ospf-100-area-0.0.0.0]net 10.1.12.0 0.0.0.255

13、[AR2-ospf-100-area-0.0.0.0]net 192.168.10.0 0.0.0.255

14、[AR2-ospf-100-area-0.0.0.0]net 192.168.20.0 0.0.0.255

SW2

1、[SW2]vlan batch 30 40

2、[SW2]int g0/0/3

3、[SW2-GigabitEthernet0/0/3]port link-type access

4、[SW2-GigabitEthernet0/0/3]port default vlan 30

5、[SW2]int g0/0/4

6、[SW2-GigabitEthernet0/0/4]port link-type access

7、[SW2-GigabitEthernet0/0/4]port default vlan 40

8、[SW2-GigabitEthernet0/0/4]int g0/0/2

9、[SW2-GigabitEthernet0/0/2]port link-type trunk

10、[SW2-GigabitEthernet0/0/2]port trunk allow-pass vlan 30

11、[SW2]int vlanif 30

12、[SW2-Vlanif30]ip address 192.168.30.1 24

13、[SW2]int vlanif 40

14、[SW2-Vlanif40]ip address 192.168.40.1 24

15、[SW2]int vlanif 1

16、[SW2-Vlanif1]ip address 10.0.32.2 24

SW3

1、[SW3]vlan 30

2、[SW3]int g0/0/2

3、[SW3-GigabitEthernet0/0/2]port link-type access

4、[SW3-GigabitEthernet0/0/2]port default vlan 30

5、[SW3-GigabitEthernet0/0/2]int g0/0/1

6、[SW3-GigabitEthernet0/0/1]port link-type trunk

7、[SW3-GigabitEthernet0/0/1]port trunk allow-pass vlan 30

AR1

1、[AR1]int g0/0/1

2、[AR1-GigabitEthernet0/0/1]ip address 10.1.12.2

3、[AR1]int g0/0/2

4、[AR1-GigabitEthernet0/0/2]ip address 10.1.13.2 24

5、[AR1]ospf 100

6、[AR1-ospf-100]area 0

7、[AR1-ospf-100-area-0.0.0.0]net 10.1.12.0 0.0.0.255

8、[AR1-ospf-100-area-0.0.0.0]net 10.1.13.0 0.0.0.255

配置telnet連接,阻止vlan10? telnet AR1

9、[AR1]user-interface vty 0 4

10、[AR1-ui-vty0-4]authentication-mode aaa

11、[AR1-ui-vty0-4]q

12、[AR1]aaa

13、[AR1-aaa]local-user huawei password cipher huawei

14、[AR1-aaa]local-user huswei service-type telnet

15、[AR1-aaa]local-user huawei privilege level 3

16、[AR1]acl 3000

17、[AR1-acl-adv-3000]rule deny tcp source 192.168.10.0 0.0.0.255 destination 10.1.12.2 0.0.0.255 destination-port eq 23

18、[AR1-acl-adv-3000]rule deny tcp source 192.168.10.0 0.0.0.255 destination 10.1.13.2 0.0.0.255 destination-port eq 23

19、[AR1-acl-adv-3000]rule permit ip

20、[AR1]int g0/0/1

21、[AR1-GigabitEthernet0/0/1]traffic-filter inbound acl 3000

22、[AR1-GigabitEthernet0/0/1]int g0/0/2

23、[AR1-GigabitEthernet0/0/2]traffic-filter inbound acl 3000

AR3

1、[AR3]int g0/0/1

2、[AR3-GigabitEthernet0/0/1]ip address 10.1.32.2 24

3、[AR3-GigabitEthernet0/0/1]int g0/0/0

4、[AR3-GigabitEthernet0/0/0]ip address 10.1.13.3 24

5、[AR3]ospf 100

6、[AR3-ospf-100]area 0

7、[AR3-ospf-100-area-0.0.0.0]net 10.1.13.0 0.0.0.255

8、[AR3-ospf-100-area-0.0.0.0]net 10.1.32.0 0.0.0.255

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

推薦閱讀更多精彩內(nèi)容