華為S5700系列交換機(jī),是我們項目中用的較多的一款,其中24與48口應(yīng)用較多。現(xiàn)在將華為交換機(jī)的一些常用配置整理一下,進(jìn)行記錄。如有錯誤,請指正。 1 允許telnet(遠(yuǎn)程登錄)允許華為交換機(jī)能telnet,設(shè)置密碼為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交換機(jī)遠(yuǎn)程登錄 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 創(chuàng)建VLAN為交換機(jī)劃分VLAN1001,VLAN1002, 設(shè)置vlan1001,接口IP地址為172.16.1.254(即網(wǎng)關(guān)地址),子網(wǎng)掩碼為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 創(chuàng)建鏈路聚合端口將45、46創(chuàng)建鏈路聚合1,使用RJ45 將47、48創(chuàng)建鏈路聚合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 【說明】每個端口可能需要執(zhí)行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 在交換機(jī)上配置DHCP Server(1)vlan2002的網(wǎng)關(guān)地址是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 # 8 在交換機(jī)中指定WDS服務(wù)如果網(wǎng)絡(luò)中有WDS(Windows部署服務(wù)),如果要為各個VLAN,允許從交換機(jī)通過DHCP獲得IP地址,并且能從使用其他VLAN中的WDS部署系統(tǒng)(網(wǎng)絡(luò)拓?fù)淙鐖D所示),則華為交換機(jī)DHCP可以進(jìn)行如下的配置。 本示例配置了VLAN2001~VLAN2006,其中服務(wù)器屬于VLAN2006,為VLAN2001~2006配置DHCP,并且允許這些VLAN中的計算機(jī),能使用172.18.96.1的WDS安裝、部署系統(tǒng)。其中172.18.96.1是Windows Server 2016 數(shù)據(jù)中心版。 sysname HW5700 # vlan batch 2001 to 2006 # ip pool vlan2001 gateway-list 172.18.91.254 network 172.18.91.0 mask 255.255.255.0 dns-list 172.18.96.1 next-server 172.18.96.1 option 66 ip-address 172.18.96.1 option 67 ascii Boot\x86\wdsnbp.com bootfile Boot\wdsnbp.com # interface Vlanif2001 description 1_JiFang ip address 172.18.91.254 255.255.255.0 dhcp select global # # interface Vlanif2006 description Server ip address 172.18.96.254 255.255.255.0 dhcp select global # 9 指定DHCP服務(wù)器(在交換機(jī)上配置DHCP中繼)【說明】:在交換機(jī)上指定DHCP中繼(DHCP服務(wù)器是Windows Server中的DHCP)這是在早期華為或華三交換機(jī)上的配置,具體那個型號我記不清了,現(xiàn)在這些配置我基本上已經(jīng)不用了,只是在這收集整理一下。 # 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 # 以下是摘錄的華為官方幫助文檔內(nèi)容 # 在接口下使能DHCP中繼功能。 [SwitchA] dhcp enable //使能DHCP服務(wù),缺省未使能 [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服務(wù)器的IP地址 [SwitchA-Vlanif100] quit 10 配置靜態(tài)路由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 10 配置SNMPsnmp-agent snmp-agent local-engineid Admin@123 snmp-agent community write cipher Admin@123 snmp-agent sys-info version all |
|