通過(guò)consule進(jìn)行配置:
# 設(shè)置系統(tǒng)的日期矢劲、時(shí)間和時(shí)區(qū)
<HUAWEI>clock timezone BJ ?add 08:00:00
<HUAWEI>clock datetime 08:00:00 2018-04-12
# 設(shè)置設(shè)備名稱(chēng)和管理IP地址
[~HUAWEI]?system-view
[~HUAWEI] sysname Server
[*HUAWEI] commit
[~Server] interface meth 0/0/0
[*Server-MEth0/0/0] ip address x.x.x.x x
[*Server-MEth0/0/0] quit
# 設(shè)置Telnet用戶(hù)的級(jí)別和認(rèn)證方式
[*Server] undo telnet server disable ? ? ?// telnet enable
[*Server] user-interface vty 0 4
[*Server-ui-vty0-4] user privilege level 3
[*Server-ui-vty0-4] authentication-mode aaa
[*Server-ui-vty0-4] quit
[*Server] aaa
[*Server-aaa] local-user xxx password irreversible-cipher xxxxxx
[*Server-aaa] local-user xxx level 3
[*Server-aaa] local-user xxx service-type telnet
[*Server-aaa] commit
[~Server-aaa] quit
#配置Telnet登錄設(shè)備
1.配置服務(wù)器的端口號(hào)以及使能服務(wù)器功能?
[~HUAWEI]?system-view
[~HUAWEI] sysname Telnet Server
[*HUAWEI] commit
[~Telnet Server] undo telnet server disable
[*Telnet Server] telnet server port xxxx
2.配置VTY用戶(hù)界面的相關(guān)參數(shù)
# 配置VTY用戶(hù)界面的最大個(gè)數(shù)饮潦。
[*Telnet Server] user-interface maximum-vty 8
[*Telnet Server] commit
# 配置允許用戶(hù)登錄設(shè)備的主機(jī)地址凛膏。
[*Telnet Server] acl 2001
[*Telnet Server-acl4-basic-2001] rule permit source x.x.x.x x
[*Telnet Server-acl4-basic-2001] rule deny source? x.x.x.x x
[*Telnet Server-acl4-basic-2001] quit
[*Telnet Server] user-interface vty 0 7
[*Telnet Server-ui-vty0-7] acl 2001 inbound
# 配置VTY用戶(hù)界面的用戶(hù)驗(yàn)證方式窃肠。
[*Telnet Server-ui-vty0-7] authentication-mode aaa
[*Telnet Server-ui-vty0-7] quit
3.配置登錄用戶(hù)的相關(guān)信息
# 配置登錄驗(yàn)證方式狂窑。
[*Telnet Server] aaa
[*Telnet Server-aaa] local-user xxx ?password irreversible-cipher xxxxxx
[*Telnet Server-aaa] local-user xxx service-type telnet
[*Telnet Server-aaa] local-user xxx ?level 3
[*Telnet Server-aaa] commit
[~Telnet Server-aaa] quit
2.在服務(wù)器端創(chuàng)建SSH用戶(hù)趟章。
# 配置VTY用戶(hù)界面。
[~SSH Server] user-interface vty 0 4? //進(jìn)入VTY 0~VTY 4用戶(hù)界面視圖
[~SSH Server-ui-vty0-4] authentication-mode aaa? //配置登錄用戶(hù)界面的認(rèn)證方式為AAA認(rèn)證
[*SSH Server-ui-vty0-4] user privilege level 3? //配置用戶(hù)級(jí)別為3
[*SSH Server-ui-vty0-4] protocol inbound ssh? //配置VTY用戶(hù)界面支持SSH協(xié)議
[*SSH Server-ui-vty0-4] quit
# 創(chuàng)建SSH用戶(hù)xxx秃踩,配置其認(rèn)證方式為password。
[*SSH Server] aaa
[*SSH Server-aaa] local-user xxx password irreversible-cipher xxxx //配置本地用戶(hù)名和密碼
[*SSH Server-aaa] local-user xxx ?level 3? //配置本地用戶(hù)名的級(jí)別為3
[*SSH Server-aaa] local-user xxx ?service-type ssh? //配置本地用戶(hù)的服務(wù)方式為SSH
[*SSH Server-aaa] quit
[*SSH Server] ssh user xxx authentication-type password? //配置SSH用戶(hù)c的認(rèn)證方式為密碼認(rèn)證
配置本地用戶(hù)的服務(wù)類(lèi)型
[~HUAWEI]??system-view
[~HUAWEI] aaa
[~HUAWEI-aaa] local-user xxx@vipdomain password irreversible-cipher xxxx
[*HUAWEI-aaa] local-user xxx@vipdomain service-type telnet
[*HUAWEI-aaa] commit
開(kāi)啟FTP服務(wù)器功能?
[~HUAWEI]system-view
[~HUAWEI] ftp server enable
[*HUAWEI] aaa
[*HUAWEI-aaa] local-user xxx password irreversible-cipher xxx
[*HUAWEI-aaa] local-user xxx evel 3
[*HUAWEI-aaa] local-user xxx service-type ftp? ? ? ? //設(shè)置用戶(hù)接入類(lèi)型為ftp业筏。
[*HUAWEI-aaa] local-user xxx ftp-directory flash: //設(shè)置用戶(hù)FTP目錄為flash:/
[*HUAWEI-aaa] commit
[~HUAWEI-aaa] return save
Warning: The current configuration will be written to the device. Continue? [Y/N]: y
# 交換機(jī)堆疊配置 ? (華為交換機(jī))
堆疊原理
角色選舉
堆疊建立時(shí)憔杨,成員交換機(jī)之間相互發(fā)送堆疊競(jìng)爭(zhēng)報(bào)文。通過(guò)競(jìng)爭(zhēng)蒜胖,一臺(tái)成為主交換機(jī)消别,負(fù)責(zé)管理整個(gè)堆疊系統(tǒng);另一臺(tái)則成為備交換機(jī)台谢,作為主交換機(jī)的備份交換機(jī)寻狂。
主交換機(jī)選舉規(guī)則如下(依次從第一條開(kāi)始判斷,直至找到最優(yōu)的交換機(jī)才停止比較):
運(yùn)行狀態(tài)比較朋沮,最先完成啟動(dòng)的交換機(jī)優(yōu)先競(jìng)爭(zhēng)為主交換機(jī)蛇券。
堆疊優(yōu)先級(jí)比較,堆疊優(yōu)先級(jí)高的交換機(jī)優(yōu)先競(jìng)爭(zhēng)為主交換機(jī)樊拓。
軟件版本比較纠亚,軟件版本高的交換機(jī)優(yōu)先競(jìng)爭(zhēng)為主交換機(jī)。
主控板數(shù)量比較筋夏,有2塊主控板的交換機(jī)比只有1塊主控板的交換機(jī)優(yōu)先競(jìng)爭(zhēng)為主交換機(jī)蒂胞。
橋MAC地址比較,橋MAC地址小的交換機(jī)優(yōu)先競(jìng)爭(zhēng)為主交換機(jī)条篷。
配置沖突檢測(cè)
堆疊建立時(shí)骗随,如果主交換機(jī)上有備交換機(jī)的離線配置,則有可能產(chǎn)生配置沖突的情況赴叹。此時(shí)可能導(dǎo)致堆疊無(wú)法建立鸿染,主要的配置沖突場(chǎng)景如下:
對(duì)于主控板直連方式的堆疊:
備交換機(jī)所有的SIP口在主交換機(jī)上都有Shutdown配置。
對(duì)于業(yè)務(wù)板直連方式的堆疊:
端口配置合并時(shí)乞巧,同一堆疊端口下的堆疊物理成員端口數(shù)量超出規(guī)格限制涨椒。
備交換機(jī)所有的堆疊物理成員端口在主交換機(jī)上都有Shutdown或與堆疊沖突的配置。
備交換機(jī)的堆疊端口在主交換機(jī)上有Shutdown或與堆疊沖突的配置摊欠。
同一堆疊端口下的堆疊物理成員端口的類(lèi)型不同丢烘。
#交換機(jī)堆疊配置
[~HUAWEI]system-view
[~HUAWEI] stack
[~HUAWEI-stack] stack member 1? ? ? //配置堆疊成員ID
[*HUAWEI-stack] stack priority 150? ? ? //配置堆疊優(yōu)先級(jí)
[*HUAWEI-stack] stack domain 10? ? ? //配置堆疊域編號(hào)
[*HUAWEI-stack] stack link-type mainboard-direct? ? ? //配置堆疊連接方式
[*HUAWEI-stack] quit
[*HUAWEI] commit
[~HUAWEI] port-group group1
[*HUAWEI-port-group-group1] group-member 10ge 1/0/1 to 10ge 1/0/2
[*HUAWEI-port-group-group1] group-member 10ge 2/0/1 to 10ge 2/0/2
[*HUAWEI-port-group-group1] shutdown? ? ? //先將需要加入堆疊邏輯端口的物理口Shutdown
[*HUAWEI-port-group-group1] quit
[*HUAWEI] commit
[~HUAWEI] interface stack-port 1 //創(chuàng)建堆疊邏輯端口
[*HUAWEI-Stack-Port1] port member-group interface 10ge 1/0/1 to 1/0/2? ? ? //為堆疊邏輯端口添加成員端口
[*HUAWEI-Stack-Port1] port member-group interface 10ge 2/0/1 to 2/0/2
[*HUAWEI-Stack-Port1] quit
[*HUAWEI] commit
[~HUAWEI] port-group group1[~HUAWEI-port-group-group1] undo shutdown //打開(kāi)被關(guān)閉的成員端口[*HUAWEI-port-group-group1] quit[*HUAWEI] commit[~HUAWEI] quit save //保存配置
Warning: The current configuration will be written to the device. Continue? [Y/N]: y
[~HUAWEI] stack
[~HUAWEI-stack] stack enable? ? ? //使能堆疊功能
Warning: Make sure that one or more dual-active detection methods are configured once the conversion is complete and the device ente
rs the stack mode.
Current configuration will be converted to the next startup saved-configuration file of stack mode.
System will reboot. Continue? [Y/N]: y
[~HUAWEI]system-view
[~HUAWEI] stack
[~HUAWEI-stack] stack member 1 renumber 2 inherit-config? ? ? //配置堆疊成員ID
Warning: The stack configuration of member ID 1 will be inherited to member ID 2 after the device resets. Continue? [Y/N]: y
[*HUAWEI-stack] stack member 1 priority 150? ? ? //配置堆疊優(yōu)先級(jí)
[*HUAWEI-stack] stack member 1 domain 10? ? ? //配置堆疊域編號(hào)
[*HUAWEI-stack] quit
[*HUAWEI] commit
[~HUAWEI] port-group group1
[*HUAWEI-port-group-group1] group-member 10ge 1/0/1 to 10ge 1/0/4
[*HUAWEI-port-group-group1] shutdown? ? ? //先將需要加入堆疊邏輯端口的物理口Shutdown
[*HUAWEI-port-group-group1] quit
[*HUAWEI] commit
[~HUAWEI] interface stack-port 1/1? ? ? //創(chuàng)建堆疊邏輯端口
[*HUAWEI-Stack-Port1/1] port member-group interface 10ge 1/0/1 to 1/0/2
[*HUAWEI-Stack-Port1/1] quit
[*HUAWEI] interface stack-port 1/2
[*HUAWEI-Stack-Port1/2] port member-group interface 10ge 1/0/3 to 1/0/4
[*HUAWEI-Stack-Port1/2] quit
[*HUAWEI] commit
[~HUAWEI] port-group group1
[~HUAWEI-port-group-group1] undo shutdown //打開(kāi)被關(guān)閉的成員端口
[*HUAWEI-port-group-group1] quit
[*HUAWEI] commit[~HUAWEI] quitsave //保存配置
Warning:?
The current configuration will be written to the device. Continue??
[Y/N]: y
?reboot //重啟設(shè)備
Warning: The system will reboot. Continue? [Y/N]: y
配置接口切換到三層模式單接口切換:接口視圖下執(zhí)行命令undo portswitch柱宦,配置接口切換到三層模式些椒。缺省情況下,以太網(wǎng)接口處于二層模式掸刊。# 將接口10GE1/0/1切換為三層模式免糕。
?[~HUAWEI]?system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo portswitch
[*HUAWEI-10GE1/0/1] commit
# 批量切換接口10GE1/0/1~10GE1/0/3到三層模式。
[~HUAWEI]system-view
[~HUAWEI] undo portswitch batch 10ge 1/0/1 to 1/0/3
[*HUAWEI] commit
# 配置管理接口METH0/0/0的IP地址。?
[~HUAWEI]system-view
[~HUAWEI] interface meth 0/0/0
[~HUAWEI-MEth0/0/0] ip address 10.1.1.1 24
[*HUAWEI-MEth0/0/0] commit
# 配置子接口10GE1/0/1.1的IP地址石窑,通過(guò)的報(bào)文外層Tag為100牌芋。
[~HUAWEI]?system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo portswitch
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] interface 10ge 1/0/1.1
[*HUAWEI-10GE1/0/1.1] ip address 10.1.1.1 24
[*HUAWEI-10GE1/0/1.1] dot1q termination vid 100
[*HUAWEI-10GE1/0/1.1] commit
# 配置接口10GE1/0/1工作在自協(xié)商模式。
[~HUAWEI]system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo negotiation disable
[*HUAWEI-10GE1/0/1] commit
# 自協(xié)商模式下配置10GE1/0/1電接口速率為1000MBit/s松逊。?
[~HUAWEI]system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] speed auto 1000
[*HUAWEI-10GE1/0/1] commit
# 非自協(xié)商模式下配置10GE1/0/1電接口速率為1000MBit/s躺屁。
[~HUAWEI]?system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] negotiation disable
[*HUAWEI-10GE1/0/1] speed 1000
[*HUAWEI-10GE1/0/1] commit
示例:開(kāi)啟接口10GE1/0/1的流量控制功能。
[~HUAWEI]??system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] flow-control? //開(kāi)啟流量控制功能经宏,默認(rèn)情況是關(guān)閉狀態(tài)
[*HUAWEI-10GE1/0/1] commit
示例:開(kāi)啟接口10GE1/0/1的流量控制自協(xié)商功能犀暑。
[~HUAWEI]?system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo negotiation disable? //開(kāi)啟自協(xié)商功能,默認(rèn)情況下是開(kāi)啟自協(xié)商功能
[*HUAWEI-10GE1/0/1] flow-control negotiation? //開(kāi)啟流量控制自協(xié)商功能烁兰,默認(rèn)情況下是關(guān)閉狀態(tài)
[*HUAWEI-10GE1/0/1] commit
配置端口組
配置臨時(shí)端口組:
[~HUAWEI]system-view
[~HUAWEI] port-group group-member 10ge 1/0/1 to 10ge 1/0/3
[~HUAWEI-port-group]
配置永久端口組:
[~HUAWEI]??system-view
[~HUAWEI] port-group portgroup1
[*HUAWEI-port-group-portgroup1] group-member 10ge 1/0/1 to 10ge 1/0/3
[*HUAWEI-port-group-portgroup1] commit
配置端口隔離# 配置GE1/0/1的端口隔離功能耐亏。
[~HUAWEI]??system-view
[~HUAWEI] interface ge 1/0/1
[~HUAWEI-GE1/0/1] port-isolate enable group 1
[*HUAWEI-GE1/0/1] quit
[*HUAWEI] commit
# 配置GE1/0/2的端口隔離功能。
[~HUAWEI] interface ge 1/0/2
[~HUAWEI-GE1/0/2] port-isolate enable group 1
[*HUAWEI-GE1/0/2] quit
[*HUAWEI] commit
配置子接口?
[~HUAWEI]?system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo portswitch? ? ? ? ? ? // 將當(dāng)前接口切換為三層模式
[*HUAWEI-10GE1/0/1] commit
[~HUAWEI-10GE1/0/1] quit
[~HUAWEI] interface 10ge 1/0/1.1? ? ? ? ? ? ? // 進(jìn)入子接口視圖
配置限制MAC地址學(xué)習(xí)功能# 配置接口10GE1/0/1最多允許學(xué)習(xí)30個(gè)MAC地址沪斟。
[~HUAWEI]?system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] mac-address limit maximum 30
[*HUAWEI-10GE1/0/1] commit
# 配置VLAN 10最多允許學(xué)習(xí)20個(gè)MAC地址广辰。
[~HUAWEI]??system-view
[~HUAWEI] vlan 10
[*HUAWEI-vlan10] mac-address limit maximum 20
[*HUAWEI-vlan10] commit
# 配置10GE1/0/1~10GE1/0/3加入Eth-Trunk1,且工作模式為手工負(fù)載分擔(dān)模式主之。
[~HUAWEI]?system-view
[~HUAWEI] interface eth-trunk 1
[*HUAWEI-Eth-Trunk1] mode manual load-balance
[*HUAWEI-Eth-Trunk1] trunkport interface 10ge 1/0/1 to 1/0/3
[*HUAWEI-Eth-Trunk1] commit
# 配置10GE1/0/1~10GE1/0/3加入Eth-Trunk1择吊,且工作模式為靜態(tài)LACP模式。?
[~HUAWEI]system-view
[~HUAWEI] interface eth-trunk 1
[*HUAWEI-Eth-Trunk1] mode lacp-static
[*HUAWEI-Eth-Trunk1] trunkport interface 10ge 1/0/1 to 1/0/3
[*HUAWEI-Eth-Trunk1] commit
# 配置10GE1/0/4~10GE1/0/6加入Eth-Trunk2槽奕,且工作模式為動(dòng)態(tài)LACP模式干发。
?[~HUAWEI]system-view
[~HUAWEI] interface eth-trunk 2
[*HUAWEI-Eth-Trunk2] mode lacp-dynamic
[*HUAWEI-Eth-Trunk2] trunkport interface 10ge 1/0/4 to 1/0/6
[*HUAWEI-Eth-Trunk2] commit
配置本地流量?jī)?yōu)先轉(zhuǎn)發(fā)Eth-Trunk接口視圖下,執(zhí)行命令undo local-preference disable史翘,使能Eth-Trunk接口流量本地優(yōu)先轉(zhuǎn)發(fā)功能枉长。
[~HUAWEI]?system-view
[~HUAWEI] interface eth-trunk 10
[*HUAWEI-Eth-Trunk10] undo local-preference disable
[*HUAWEI-Eth-Trunk10] commit
值越小,優(yōu)先級(jí)越高琼讽。# 配置系統(tǒng)LACP優(yōu)先級(jí)
[*HUAWEI]?system-view
[~HUAWEI] lacp priority 10
[*HUAWEI] commit
# 配置接口10GE1/0/1的LACP優(yōu)先級(jí)必峰。
?[*HUAWEI]?system-view
[~HUAWEI] interface eth-trunk 1
[*HUAWEI-Eth-Trunk1] trunkport 10ge 1/0/1
[*HUAWEI-Eth-Trunk1] mode lacp-static? //配置接口優(yōu)先級(jí)前,需首先保證接口已經(jīng)加入LACP模式的Eth-Trunk接口中
[*HUAWEI-Eth-Trunk1] quit
[*HUAWEI] interface 10ge 1/0/1
[*HUAWEI-10GE1/0/1] lacp priority 1
[*HUAWEI-10GE1/0/1] commit
不同速率的接口加入鏈路聚合組
# 配置10GE1/0/1和40GE1/0/1兩種速率的接口加入Eth-Trunk1钻蹬。
?[~HUAWEI]system-view
[~HUAWEI] interface eth-trunk 1
[*HUAWEI-Eth-Trunk1] mode lacp-static
[*HUAWEI-Eth-Trunk1] lacp mixed-rate link enable
[*HUAWEI-Eth-Trunk1] trunkport 10ge 1/0/1
[*HUAWEI-Eth-Trunk1] trunkport 40ge 1/0/1
[*HUAWEI-Eth-Trunk1] commit
# 配置接口10GE1/0/1禁止VLAN 1報(bào)文通過(guò)吼蚁。?
[~HUAWEI]system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] port link-type trunk
[*HUAWEI-10GE1/0/1] undo port trunk allow-pass vlan 1
[*HUAWEI-10GE1/0/1] commit
配置接口的缺省VLAN ID缺省情況下,接口的缺省VLAN都是VLAN 1问欠。
# 配置Access類(lèi)型接口的缺省VLAN為VLAN 3肝匆。
[~HUAWEI]system-view
[~HUAWEI] vlan batch 3
[*HUAWEI] interface 10ge 1/0/1
[*HUAWEI-10GE1/0/1] port link-type access
[*HUAWEI-10GE1/0/1] port default vlan 3
[*HUAWEI-10GE1/0/1] commit
# 配置Trunk類(lèi)型接口的缺省VLAN為VLAN 4。
[~HUAWEI]system-view
[~HUAWEI] vlan batch 4
[*HUAWEI] interface 10ge 1/0/1
[*HUAWEI-10GE1/0/1] port link-type trunk
[*HUAWEI-10GE1/0/1] port trunk pvid vlan 4
[*HUAWEI-10GE1/0/1] commit ? ??
# 配置Hybrid類(lèi)型接口的缺省VLAN為VLAN 5顺献。?
[~HUAWEI]system-view
[~HUAWEI] vlan batch 5
[*HUAWEI] interface 10ge 1/0/1
[*HUAWEI-10GE1/0/1] port link-type hybrid
[*HUAWEI-10GE1/0/1] port hybrid pvid vlan 5
[*HUAWEI-10GE1/0/1] commit
#VLAN透?jìng)髋渲梅椒?/p>
# 配置access接口透?jìng)鱒LAN 2旗国。
[~HUAWEI]system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] port link-type access
[*HUAWEI-10GE1/0/1] port default vlan 2
[*HUAWEI-10GE1/0/1] commit
# 配置trunk接口透?jìng)鱒LAN 2
[~HUAWEI]system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] port link-type trunk
[*HUAWEI-10GE1/0/1] port trunk allow-pass vlan 2
[*HUAWEI-10GE1/0/1] commit
# 配置hybrid接口以Untagged方式透?jìng)鱒LAN 2。
[~HUAWEI]system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] port link-type hybrid
[*HUAWEI-10GE1/0/1] port hybrid untagged vlan 2
[*HUAWEI-10GE1/0/1] commit
# 配置hybrid接口以Tagged方式透?jìng)鱒LAN 2注整。
[~HUAWEI]?system-view
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] port link-type hybrid
[*HUAWEI-10GE1/0/1] port hybrid tagged vlan 2
[*HUAWEI-10GE1/0/1] commit
配置DHCP中繼CE系列交換機(jī)DHCP中繼常用配置如下:
[~HUAWEI]??system-view
[~HUAWEI] dhcp enable? //使能DHCP功能
[*HUAWEI] vlan batch 100
[*HUAWEI] interface vlanif 100
[*HUAWEI-Vlanif100] ip address 10.10.20.1 24
[*HUAWEI-Vlanif100] dhcp select relay? //啟動(dòng)接口的DHCP中繼功能
[*HUAWEI-Vlanif100] quit
[*HUAWEI] commit
[~HUAWEI] dhcp relay server group dhcpgroup1 //創(chuàng)建DHCP服務(wù)器組并進(jìn)入DHCP服務(wù)器組視圖
[*HUAWEI-dhcp-relay-server-group-dhcpgroup1] server 10.10.10.1? //向DHCP服務(wù)器組中添加DHCP服務(wù)器
[*HUAWEI-dhcp-relay-server-group-dhcpgroup1] quit
[*HUAWEI] commit
[~HUAWEI] interface vlanif 100
[~HUAWEI-Vlanif100] dhcp relay binding server group dhcpgroup1? //指定接口對(duì)應(yīng)的DHCP服務(wù)器組
[*HUAWEI-Vlanif100] quit
[*HUAWEI] commit
配置DHCP服務(wù)器CE系列交換機(jī)DHCP服務(wù)器常用配置如下:
[~HUAWEI]??system-view
[~HUAWEI] dhcp enable //全局使能DHCP功能
[*HUAWEI] commit
[~HUAWEI] ip pool pool1 //創(chuàng)建全局地址池能曾,同時(shí)進(jìn)入全局地址池視圖
[*HUAWEI-ip-pool-pool1] gateway-list 10.1.1.1 //配置DHCP服務(wù)器全局地址池的出口網(wǎng)關(guān)地址
[*HUAWEI-ip-pool-pool1] network 10.1.1.0 mask 255.255.255.128 //配置全局地址池可動(dòng)態(tài)分配的IP地址范圍
[*HUAWEI-ip-pool-pool1] commit
[~HUAWEI-ip-pool-pool1] quit
#配置DNS服務(wù)器的IP地址CE系列交換機(jī)DNS服務(wù)器IP地址的配置如下:
[~HUAWEI]?system-view
[~HUAWEI] ip pool pool1 //創(chuàng)建全局地址池度硝,同時(shí)進(jìn)入全局地址池視圖
[*HUAWEI-ip-pool-pool1] dns-list 10.1.1.2
[*HUAWEI-ip-pool-pool1] commit
[~HUAWEI-ip-pool-pool1] quit
#排除不參與自動(dòng)分配的IP地址?
[~HUAWEI]system-view
[~HUAWEI] ip pool pool1
[*HUAWEI-ip-pool-pool1] gateway-list 10.1.1.1
[*HUAWEI-ip-pool-pool1] network 10.1.1.0 mask 24
[*HUAWEI-ip-pool-pool1] excluded-ip-address 10.1.1.100 10.1.1.200
[*HUAWEI-ip-pool-pool1] commit
[~HUAWEI-ip-pool-pool1] quit
####生成樹(shù)(STP)#############
配置思路
采用以下思路配置STP功能:
配置環(huán)網(wǎng)中的設(shè)備生成樹(shù)協(xié)議工作在STP模式。
配置根橋和備份根橋設(shè)備寿冕。
配置端口的路徑開(kāi)銷(xiāo)值蕊程,實(shí)現(xiàn)將該端口阻塞。
使能STP驼唱,實(shí)現(xiàn)破除環(huán)路藻茂。
操作步驟:
1、配置環(huán)網(wǎng)中的設(shè)備生成樹(shù)協(xié)議工作在STP模式玫恳。SwitchB捌治、SwitchC和SwitchD的配置與SwitchA差不多
[~HUAWEI]system-view
[~HUAWEI]sysnameSwitchA
[*HUAWEI]commit
[~SwitchA]stp mode stp
[*SwitchA]commit
配置根橋和備份根橋。
# 配置SwitchA為根橋纽窟。
[~SwitchA] stp root primary
[*SwitchA] commit
# 配置SwitchB為備份根橋肖油。
[~SwitchB] stp root secondary
[*SwitchB] commit
配置端口的路徑開(kāi)銷(xiāo)值,實(shí)現(xiàn)將該端口阻塞臂港。
# 配置SwitchA的端口路徑開(kāi)銷(xiāo)的計(jì)算方法為華為私有計(jì)算方法森枪。
[~SwitchA] stp pathcost-standard legacy
[*SwitchA] commit
# 配置SwitchB的端口路徑開(kāi)銷(xiāo)的計(jì)算方法為華為的私有計(jì)算方法。
[~SwitchB] stp pathcost-standard legacy
[*SwitchB] commit
# 配置SwitchC端口10GE1/0/1端口路徑開(kāi)銷(xiāo)值為20000审孽。
[~SwitchC] stp pathcost-standard legacy
[*SwitchC] interface 10ge 1/0/1
[*SwitchC-10GE1/0/1] stp cost 20000
[*SwitchC-10GE1/0/1] commit
[~SwitchC-10GE1/0/1] quit
# 配置SwitchD的端口路徑開(kāi)銷(xiāo)的計(jì)算方法為華為的私有計(jì)算方法县袱。
[~SwitchD] stp pathcost-standard legacy
[*SwitchD] commit
使能STP,實(shí)現(xiàn)破除環(huán)路佑力。
將與Server相連的端口去使能STP
# 配置SwitchB端口10GE1/0/2的STP去使能式散。
[~SwitchB]interface10ge1/0/2
[~SwitchB-10GE1/0/2]stp disable
[*SwitchB-10GE1/0/2]commit
[~SwitchB-10GE1/0/2]quit
# 配置SwitchC端口10GE1/0/2的STP去使能。
[~SwitchC]interface10ge1/0/2
[~SwitchC-10GE1/0/2]stp disable
[*SwitchC-10GE1/0/2]commit
[~SwitchC-10GE1/0/2]quit
?設(shè)備全局使能STP打颤。
[~SwitchA] stp enable
[*SwitchA] commit
[~SwitchB] stp enable
[*SwitchB] commit
[~SwitchC] stp enable
[*SwitchC] commit
[~SwitchD] stp enable
[*SwitchD] commit
######RSTP#######
配置思路
采用以下思路配置RSTP功能:
配置環(huán)網(wǎng)中的設(shè)備生成樹(shù)協(xié)議工作在RSTP模式暴拄。
配置根橋和備份根橋設(shè)備。
配置端口的路徑開(kāi)銷(xiāo)值编饺,實(shí)現(xiàn)將該端口阻塞乖篷。
使能RSTP,實(shí)現(xiàn)破除環(huán)路透且。
操作步驟
配置環(huán)網(wǎng)中的設(shè)備生成樹(shù)協(xié)議工作在RSTP模式撕蔼。SwitchB、SwitchC和SwitchD的配置與SwitchA差不多
[~HUAWEI]system-view
[~HUAWEI]sysnameSwitchA
[*HUAWEI]commit
[~SwitchA]stp mode rstp
[*SwitchA]commit
配置根橋和備份根橋秽誊。
# 配置SwitchA為根橋鲸沮。
[~SwitchA]stp root primary
[*SwitchA]commit
# 配置SwitchB為備份根橋。
[~SwitchB]stp root secondary
[*SwitchB]commit
配置端口的路徑開(kāi)銷(xiāo)值锅论,實(shí)現(xiàn)將該端口阻塞
# 配置SwitchA的端口路徑開(kāi)銷(xiāo)的計(jì)算方法為華為私有計(jì)算方法讼溺。
[~SwitchA]stp pathcost-standard legacy
[*SwitchA]commit
# 配置SwitchB的端口路徑開(kāi)銷(xiāo)的計(jì)算方法為華為的私有計(jì)算方法。
[~SwitchB]stp pathcost-standard legacy
[*SwitchB]commit
# 配置SwitchC端口10GE1/0/1端口路徑開(kāi)銷(xiāo)值為20000棍厌。
[~SwitchC]stp pathcost-standard legacy
[*SwitchC]interface10ge1/0/1
[*SwitchC-10GE1/0/1]stp cost 20000
[*SwitchC-10GE1/0/1]commit
[~SwitchC-10GE1/0/1]quit
# 配置SwitchD的端口路徑開(kāi)銷(xiāo)的計(jì)算方法為華為的私有計(jì)算方法肾胯。
[~SwitchD]stp pathcost-standard legacy
[*SwitchD]commit
使能RSTP,實(shí)現(xiàn)破除環(huán)路耘纱。
將與Server相連的端口去使能RSTP
# 配置SwitchB端口10GE1/0/2的RSTP去使能
[~SwitchB]interface10ge1/0/2
[~SwitchB-10GE1/0/2]stp disable
[*SwitchB-10GE1/0/2]commit
[~SwitchB-10GE1/0/2]quit
# 配置SwitchC端口10GE1/0/2的RSTP去使能敬肚。
[~SwitchC]interface10ge1/0/2
[~SwitchC-10GE1/0/2]stp disable
[*SwitchC-10GE1/0/2]commit
[~SwitchC-10GE1/0/2]quit
設(shè)備全局使能RSTP。
[~SwitchA]stp enable
[*SwitchA]commit
[~SwitchB]stp enable
[*SwitchB]commit
[~SwitchC]stp enable
[*SwitchC]commit
[~SwitchD]stp enable
[*SwitchD]commit
配置保護(hù)功能束析,如在根橋設(shè)備的指定端口配置根保護(hù)功能艳馒。
# 在SwitchA端口10GE1/0/1和10GE1/0/2上配置根保護(hù)功能。
[~SwitchA]interface10ge1/0/1
[~SwitchA-10GE1/0/1]stp root-protection
[*SwitchA-10GE1/0/1]quit
[*SwitchA]interface10ge1/0/2
[*SwitchA-10GE1/0/2]stp root-protection
[*SwitchA-10GE1/0/2]quit
[*SwitchA]commit
##### ? ?OSPF 配置示例 ######
配置OSPF基本功能:
# 配置SwitchA员寇。
[~HUAWEI]?system-view
[~HUAWEI] sysname SwitchA
[*HUAWEI] commit
[~SwitchA] router id 10.1.1.1
[*SwitchA] ospf 1
[*SwitchA-ospf-1] area 0
[*SwitchA-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255
[*SwitchA-ospf-1-area-0.0.0.0] quit
[*SwitchA-ospf-1] area 1
[*SwitchA-ospf-1-area-0.0.0.1] network 192.168.1.0 0.0.0.255
[*SwitchA-ospf-1-area-0.0.0.1] quit
[*SwitchA-ospf-1] commit
[~SwitchA-ospf-1] quit
# 配置SwitchB弄慰。
[~HUAWEI]?system-view
[~HUAWEI] sysname SwitchB
[*HUAWEI] commit
[~SwitchB] router id 10.2.2.2
[*SwitchB]ospf 1
[*SwitchB-ospf-1] area 0
[*SwitchB-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255
[*SwitchB-ospf-1-area-0.0.0.0]quit
[*SwitchB-ospf-1] area 2
[*SwitchB-ospf-1-area-0.0.0.2] network 192.168.2.0 0.0.0.255
[*SwitchB-ospf-1-area-0.0.0.2] quit
[*SwitchB-ospf-1] commit
[~SwitchB-ospf-1] quit
# 配置SwitchC。
[~HUAWEI]system-view
[~HUAWEI] sysname SwitchC
[*HUAWEI] commit
[~SwitchC] router id 10.3.3.3
[*SwitchC] ospf 1
[*SwitchC-ospf-1] area 1
[*SwitchC-ospf-1-area-0.0.0.1] network 192.168.1.0 0.0.0.255
[*SwitchC-ospf-1-area-0.0.0.1] network 172.16.1.0 0.0.0.255
[*SwitchC-ospf-1-area-0.0.0.1] commit
[~SwitchC-ospf-1-area-0.0.0.1] quit
[~SwitchC-ospf-1] quit
# 配置SwitchD蝶锋。
[~HUAWEI]system-view
[~HUAWEI] sysname SwitchD
[*HUAWEI] commit
[~SwitchD] router id 10.4.4.4
[*SwitchD] ospf 1
[*SwitchD-ospf-1] area 2
[*SwitchD-ospf-1-area-0.0.0.2] network 192.168.2.0 0.0.0.255
[*SwitchD-ospf-1-area-0.0.0.2] network 172.17.1.0 0.0.0.255
[*SwitchD-ospf-1-area-0.0.0.2] commit
[~SwitchD-ospf-1-area-0.0.0.2] quit
[~SwitchD-ospf-1] quit
# 配置SwitchE陆爽。
[~HUAWEI]?system-view
[~HUAWEI] sysname SwitchE
[*HUAWEI] commit
[~SwitchE] router id 10.5.5.5
[*SwitchE] ospf 1
[*SwitchE-ospf-1] area 1
[*SwitchE-ospf-1-area-0.0.0.1] network 172.16.1.0 0.0.0.255
[*SwitchE-ospf-1-area-0.0.0.1] commit
[~SwitchE-ospf-1-area-0.0.0.1] quit
[~SwitchE-ospf-1] quit
# 配置SwitchF。
[~HUAWEI]?system-view
[~HUAWEI] sysname SwitchF
[*HUAWEI] commit
[~SwitchF] router id 10.6.6.6
[*SwitchF] ospf 1
[*SwitchF-ospf-1] area 2
[*SwitchF-ospf-1-area-0.0.0.2] network 172.17.1.0 0.0.0.255
[*SwitchF-ospf-1-area-0.0.0.2] commit
[~SwitchF-ospf-1-area-0.0.0.2] quit
[~SwitchF-ospf-1] quit
++++++++++