華為交換機特性與配置?1 允許telnet(遠程登錄)允許華為交換機能telnet,設置密碼為Admin@123,我來為大家科普一下關于華為交換機特性與配置?下面希望有你要的答案,我們一起來看看吧!
1 允許telnet(遠程登錄)
允許華為交換機能telnet,設置密碼為Admin@123
telnet server en
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user huawei password cipher Admin@123
local-user huawei privilege level 15
local-user huawei service-type telnet terminal
local-user admin password cipher Admin@123
local-user admin service-type http
#
user-interface con 0
authentication-mode password
set authentication password cipher Admin@123
user-interface vty 0 4
protocol inbound telnet
authentication-mode aaa
user-interface vty 16 20
#
華為S5720S交換機遠程登錄
telnet server enable
aaa
authentication-scheme default
authentication-scheme radius
authentication-mode radius
authorization-scheme default
accounting-scheme default
local-aaa-user password policy administrator
password expire 0
domain default
authentication-scheme radius
radius-server default
domain default_admin
authentication-scheme default
local-user admin password irreversible-cipher Admin@123
local-user admin privilege level 15
local-user admin service-type terminal http
local-user huawei password irreversible-cipher Admin@123
local-user huawei privilege level 15
local-user huawei service-type telnet terminal
user-interface con 0
authentication-mode password
set authentication password cipher Admin@123
user-interface vty 0 4
protocol inbound telnet
authentication-mode aaa
user-interface vty 16 20
2 創建VLAN
為交換機劃分VLAN1001,VLAN1002,
設置vlan1001,接口IP地址為172.16.1.254(即網關地址),子網掩碼為255.255.255.0
将g0/0/1~g0/0/24配置為vlan1001
防止arp***
vlan 1001
interface vlan 1001
ip addr 172.16.1.254 24
arp anti-attack gateway-duplicate enable
arp anti-attack rate-limit enable
arp-miss anti-attack rate-limit enable
port-group group1
group-member g0/0/1 to g0/0/24
port link-type access
port default vlan 1001
loopback-detect enable
arp anti-attack rate-limit enable
arp-miss anti-attack rate-limit enable
quit
批量将多個端口添加到Access
port-group group-member GigabitEthernet0/0/17 to GigabitEthernet0/0/22
port link-type access
port default vlan 2006
quit
3 将多個端口添加到Trunk
将25~44端口劃分為Trunk端口
port-group group2
group-member g0/0/25 to g0/0/44
port link-type trunk
port trunk allow-pass vlan 2 to 4094
loopback-detect enable
quit
# 批量将1~16端口添加到Trunk
port-group group-member GigabitEthernet0/0/1 to GigabitEthernet0/0/16
port link-type trunk
port trunk allow-pass vlan 2 to 4094
quit
4 創建鍊路聚合端口
将45、46創建鍊路聚合1,使用RJ45
将47、48創建鍊路聚合2,使用光纖
clear configuration inte g0/0/45
clear configuration inte g0/0/46
clear configuration inte g0/0/47
clear configuration inte g0/0/48
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
mode lacp
interface Eth-Trunk2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
mode lacp
interface GigabitEthernet0/0/45
eth-trunk 1
interface GigabitEthernet0/0/46
eth-trunk 1
interface GigabitEthernet0/0/47
eth-trunk 2
combo-port fiber
interface GigabitEthernet0/0/48
eth-trunk 2
combo-port fiber
【說明】每個端口可能需要執行undo shutdown以激活端口。
5 VLAN端口重新配置為Trunk
原配置如下:
interface GigabitEthernet0/0/17
port link-type access
port default vlan 128
将g0/0/17端口配置為Trunk端口命令
undo port default vlan
undo port link-type
port link-type trunk
port trunk allow-pass vlan all
6 Trunk端口重新配置為VLAN
原配置如下
interface GigabitEthernet0/0/11
port link-type trunk
port trunk allow-pass vlan 2 to 4094
将g0/0/11端口配置為VLAN140命令
undo port trunk allow-pass vlan all
port trunk allow-pass vlan 1
port link-type access
port default vlan 140
7 在交換機上配置DHCP Server
(1)vlan2002的網關地址是172.18.92.254,DHCP地址池中排除172.18.92.200~252、172.18.92.253、DHCP的地址租約是1小時、DNS的地址是172.18.96.1
vlan batch 2001 to 2003
ip pool vlan2002
gateway-list 172.18.92.254
network 172.18.92.0 mask 255.255.255.0
excluded-ip-address 172.18.92.200 172.18.92.253
lease day 0 hour 1 minute 0
dns-list 172.18.96.1
#
interface Vlanif2002
ip address 172.18.92.254 255.255.255.0
dhcp select global
#
9 指定DHCP服務器(在交換機上配置DHCP中繼)
【說明】:在交換機上指定DHCP中繼(DHCP服務器是Windows Server中的DHCP)這是在早期華為或華三交換機上的配置,具體那個型号我記不清了,現在這些配置我基本上已經不用了,隻是在這收集整理一下。
#
dhcp enable
#
dhcp server group dhcpgroup1
dhcp-server 172.30.5.3 0
dhcp-server 172.30.5.15 1
#
interface Vlanif2052
ip address 172.28.52.254 255.255.255.0
dhcp select relay
dhcp relay server-select dhcpgroup1
#
以下是摘錄的華為官方幫助文檔内容
# 在接口下使能DHCP中繼功能。
[SwitchA] dhcp enable //使能DHCP服務,缺省未使能
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] ip address 10.10.20.1 24
[SwitchA-Vlanif100] dhcp select relay //使能DHCP中繼功能,缺省未使能
[SwitchA-Vlanif100] dhcp relay server-ip 192.168.20.2 //配置DHCP中繼代理的DHCP服務器的IP地址
[SwitchA-Vlanif100] quit
10 配置靜态路由
ip route-static 0.0.0.0 0.0.0.0 172.18.96.253
ip route-static 172.18.0.0 255.255.0.0 172.18.96.251
ip route-static 172.30.30.0 255.255.255.0 172.18.96.250
11 配置SNMP
snmp-agent
snmp-agent local-engineid Admin@123
snmp-agent community write cipher Admin@123
snmp-agent sys-info version all
12 為交換機配置堆疊模式
在本示例中将2台S6720S-26Q-EI-24S的交換機,使用40GB QSFP電纜以“堆疊”方式連接在一起。配置為堆疊模式後,兩台交換機相當于“一台”交換機使用。如下圖所示,這是堆疊電纜以及兩台交換機的連接方式。在本示例中,使用兩條40GB的QSFP電纜将兩台交換機的第1個、第2個40GE交叉連接在一起(交換機1的40GE端口1連接交換機2的40GE端口2,交換機1的40GE端口2連接交換機2的40GE端口1)。
圖 兩台交換機組成堆疊模式
在配置“堆疊”之前,先不要連接40GFB QSFP電纜,另外兩台交換機需要相同配置。首先介紹第1台交換機的配置。
# 配置交換機1的業務口40GE0/0/1、40GE0/0/2為物理成員端口,并加入到相應的邏輯堆疊端口。
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] interface stack-port 0/1
[SwitchA-stack-port0/1] port interface 40GE0/0/1 enable
[SwitchA-stack-port0/1] quit
[SwitchA] interface stack-port 0/2
[SwitchA-stack-port0/2] port interface 40GE0/0/2 enable
[SwitchA-stack-port0/2] quit
# 配置交換機2的業務口40GE0/0/1、40GE0/0/2為物理成員端口,并加入到相應的邏輯堆疊端口。
<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] interface stack-port 0/1
[SwitchB-stack-port0/1] port interface 40GE0/0/1 enable
[SwitchB-stack-port0/1] quit
[SwitchB] interface stack-port 0/2
[SwitchB-stack-port0/2] port interface 40GE0/0/2 enable
[SwitchB-stack-port0/2] quit
接下來配置堆疊ID和堆疊優先級。堆疊ID缺省值為0,堆疊優先級缺省值為100。
[SwitchA] stack slot 0 priority 200 //修改主交換機的堆疊優先級為200,大于其他成員交換機。堆疊ID采用缺省值0。
[SwitchB] stack slot 0 renumber 1 //堆疊優先級采用缺省值100。修改堆疊ID為1。
最後關閉交換機電源開關,将兩台交換機下電,按照圖1-4所示,使用40GB QSFP電纜連接後再上電。
采用堆疊之後,交換機1的1~24端口用XGigabitEthernet0/0/1~XGigabitEthernet0/0/24代表;交換機2的1~24端口用XGigabitEthernet1/0/1~XGigabitEthernet1/0/24代表;交換機1的2個40GB用40GE0/0/1、40GE0/0/2代表;交換機2的2個40GB用40GE1/0/1、40GE1/0/2代表。
使用dis stack命令查看堆疊狀态,如圖所示。‘13 清除堆疊端口配置
在配置交換機堆疊時,如果錯誤配置了交換機的堆疊端口,需要将端口清除配置,可以采用如下的命令。
例如将交換機的G1/0/25與G1/0/26添加到stack-port 1/1,命令如下:
interface stack-port 1/1
port interface GigabitEthernet1/0/25 enable
port interface GigabitEthernet1/0/26 enable
interface stack-port 1/2
port interface GigabitEthernet1/0/27 enable
port interface GigabitEthernet1/0/28 enable
如果要清除這個配置,需要執行如下的配置:
interface stack-port 1/1
shutdown interface GigabitEthernet1/0/25
shutdown interface GigabitEthernet1/0/26
undo port interface GigabitEthernet1/0/25 enable
undo port interface GigabitEthernet1/0/26 enable
interface GigabitEthernet1/0/25
undo shutdown
interface GigabitEthernet1/0/26
undo shutdown’
更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!