华为配置实例.docx
《华为配置实例.docx》由会员分享,可在线阅读,更多相关《华为配置实例.docx(24页珍藏版)》请在冰点文库上搜索。
华为配置实例
集团标准化办公室:
[VV986T-J682P28-JP266L8-68PNN]
华为配置实例
同网段内配置基于接口地址池的DHCP服务器示例
组网需求
如所示,某企业有两个处于同一网络内的办公室,为了节省资源,两个办公室内的主机由SwitchA作为DHCP服务器统一分配IP地址。
办公室1所属的网段为,主机都加入VLAN10,办公室1使用DNS服务和NetBIOS服务,地址租期30天;办公室2所属的网段为,主机都加入VLAN11,办公室2不使用DNS服务和NetBIOS服务,地址租期20天。
配置思路
基于VLANIF接口地址池的DHCP服务器的配置思路如下:
1.在SwitchA上创建两个接口地址池并配置地址池相关属性,实现DHCP服务器可以根据不同需求,从不同的接口地址池中选择合适的IP地址及其配置参数分配给办公室主机。
2.在SwitchA上配置VLANIF接口基于接口地址池的地址分配方式,实现DHCP服务器从基于接口的地址池中选择IP地址分配给办公室主机。
操作步骤
1.使能DHCP服务
2.system-view
3.[HUAWEI]sysnameSwitchA
[SwitchA]dhcpenable
4.配置接口加入VLAN
#配置GE0/0/1接口加入VLAN10。
[SwitchA]vlanbatch10to11
[SwitchA]interfacegigabitethernet0/0/1
[SwitchA-GigabitEthernet0/0/1]porthybridpvidvlan10
[SwitchA-GigabitEthernet0/0/1]porthybriduntaggedvlan10
[SwitchA-GigabitEthernet0/0/1]quit
#配置GE0/0/2加接口入VLAN11。
[SwitchA]interfacegigabitethernet0/0/2
[SwitchA-GigabitEthernet0/0/2]porthybridpvidvlan11
[SwitchA-GigabitEthernet0/0/2]porthybriduntaggedvlan11
[SwitchA-GigabitEthernet0/0/2]quit
5.配置VLANIF接口IP地址
#配置VLANIF10接口地址。
[SwitchA]interfacevlanif10
[SwitchA-Vlanif10]ipaddress24
[SwitchA-Vlanif10]quit
#配置VLANIF11接口地址。
[SwitchA]interfacevlanif11
[SwitchA-Vlanif11]ipaddress24
[SwitchA-Vlanif11]quit
6.使能VLANIF接口地址池
#配置VLANIF10接口下的客户端从接口地址池中获取IP地址。
[SwitchA]interfacevlanif10
[SwitchA-Vlanif10]dhcpselectinterface
[SwitchA-Vlanif10]quit
#配置VLANIF11接口下的客户端从接口地址池中获取IP地址。
[SwitchA]interfacevlanif11
[SwitchA-Vlanif11]dhcpselectinterface
[SwitchA-Vlanif11]quit
7.配置接口地址池的DNS服务和NetBIOS服务
#配置VLANIF10接口地址池下的DNS服务和NetBIOS服务。
[SwitchA]interfacevlanif10
[SwitchA-Vlanif10]dhcpserverdomain-name
[SwitchA-Vlanif10]dhcpserverdns-listdhcpservernbns-listdhcpserverexcluded-ip-addressdhcpserverexcluded-ip-addressdhcpservernetbios-typeb-node
[SwitchA-Vlanif10]quit
8.配置接口地址池中地址租用期限
#配置VLANIF10接口地址租用期限为30天。
[SwitchA]interfacevlanif10
[SwitchA-Vlanif10]dhcpserverleaseday30
[SwitchA-Vlanif10]quit
#配置VLANIF11接口地址租用期限为20天。
[SwitchA]interfacevlanif11
[SwitchA-Vlanif11]dhcpserverleaseday20
[SwitchA-Vlanif11]quit
9.验证配置结果
在SwitchA上使用displayippool命令用来查看接口地址池配置情况。
[SwitchA]displayippoolinterfacevlanif10
Pool-name:
Vlanif10
Pool-No:
0
Lease:
30Days0Hours0Minutes
Domain-name:
DNS-server0:
NBNS-server0:
Netbios-type:
b-node
Position:
InterfaceStatus:
Unlocked
Gateway-0:
Mask:
VPNinstance:
--
-----------------------------------------------------------------------------
StartEndTotalUsedIdle(Expired)ConflictDisable
-----------------------------------------------------------------------------
2531250(0)02
-----------------------------------------------------------------------------
[SwitchA]displayippoolinterfacevlanif11
Pool-name:
Vlanif11
Pool-No:
1
Lease:
20Days0Hours0Minutes
Domain-name:
-
DNS-server0:
-
NBNS-server0:
-
Netbios-type:
-
Position:
InterfaceStatus:
Unlocked
Gateway-0:
Mask:
VPNinstance:
--
-----------------------------------------------------------------------------
StartEndTotalUsedIdle(Expired)ConflictDisable
-----------------------------------------------------------------------------
2533250(0)00
-----------------------------------------------------------------------------
配置文件
SwitchA的配置文件
#
sysnameHUAWEI
#
vlanbatch10to11
#
dhcpenable
#
interfaceVlanif10
ipaddressdhcpselectinterface
dhcpserverexcluded-ip-addressdhcpserverleaseday30hour0minute0
dhcpserverdns-listdhcpservernetbios-typeb-node
dhcpservernbns-listdhcpserverdomain-name
#
interfaceVlanif11
ipaddressdhcpselectinterface
dhcpserverleaseday20hour0minute0
#
interfaceGigabitEthernet0/0/1
porthybridpvidvlan10
porthybriduntaggedvlan10
#
interfaceGigabitEthernet0/0/2
porthybridpvidvlan11
porthybriduntaggedvlan11
#
return
headerDefinetheloginbanner
httpHTTP
hwtacacsSetthestatusoftheHWTACACS(HuaweiTerminal
AccessControllerAccessControlSystem)service
hwtacacs-serverSetHWTACACSserver
icmpSpecifyICMPconfigurationinformation
icmp-replyEnableICMPreplyfast
igmp-snoopingSpecifyparametersforIGMP-Snooping
info-centerSpecifyinformationcenterconfiguration
information
interfaceSpecifytheinterfaceconfigurationview
ipIPinformation
ipv6EnableIPv6functionality
l2-topologyLayer2topology
l2protocol-tunnelLayer2protocoltunnel
lacpLinkaggregationcontrolprotocol
lldpLinkLayerDiscoveryProtocol
load-balanceSpecifyloadbalancemode
loopback-detectLoopbackdetectfunction
mac-addressMac-address
mac-authenMACauthenticateconfigureinformation
mac-forced-forwardingMac-ForcedForwarding
mac-learningMAClearning
mac-limitMAClimit
mac-spoofing-defendMACspoofingdefend
madMulti-activedetection
management-portManagementport
matchedIsCommandcanbematchedbyuppertemplate
mld-snoopingSpecifyparametersforMLD-Snooping
monitor-linkMonitorlinkconfigurationinformation
multicastMulticastconfigurationinformation
napNAPprotocol
ndNeighbordiscovery
nqaNetworkQualityAnalysis(NQA)
nqa-jitterSwitchNQAjitterversion
nqa-serverSpecifyNQAechoserver
ntp-serviceSpecifyNTP(NetworkTimeProtocol)configuration
information
oam-mgrOam-mgrview
observe-portConfigureobserveportfeature
pingPingfunction
poePoweroverEthernet
portPort
port-groupPort-group
port-isolatePortisolate
pppoePPPOE
qosQoSconfiguration
radius-serverAddordeleteRADIUSservertemplate
rmonSpecifyRMONconfiguration
route-policyRoute-policy
route-policy-changeSpecifyroutepolicychangeparameter
routerConfigurerouterinformation
rpsSetRPSstatus
rrppRapidringprotectionprotocol
rsaSpecifyRSAmoduleconfigurationinformation
saviSourceAddressValidationImprovement
scpSetSCPserver
screen-widthSetscreenwidth
sepSmartethernetprotection
setSetthemodeofpowermanagement
sflowSFlowmodule
sftpSetSFTPserviceattribute
slaveBackupswitchfrommastertoslave
sleepSetdevicetosleepmode
smart-linkSmartlinkconfigurationinformation
snmp-agentSpecifySNMP(SimpleNetworkManagementProtocol)
configurationinformation
sshSettheSSH(secureshell)configurationattribute
sslSecuritysocketlayer
stackStack
stack-portStackport
startupStartupconfiguration
stelnetSetStelnetserviceattribute
stpSpecifySpanningTreeProtocol(STP)configuration
information
suppressionSuppression,includebroadcast-suppression,
multicast-suppressionandunicast-suppression
sys-netidSystem-netid
sysnameSpecifythehostname
tcpSpecifyTCP(TransmissionControlProtocol)
configurationinformation
telnetSetthestatusoftheTelnetservice
temperatureDevicetemperature
tftpEstablishaTFTPconnection
tftp-serverTFTPserver
time-rangeSpecifytime-rangeconfigurationinformation
traceTraceroute(switch)tohostonDataLinkLayer
trafficSpecifytrafficconfigurationinformation
traffic-filterFilterpacketsbasedonacl
traffic-limitLimittherateofthepacketsbasedonacl
traffic-mirrorMirrorpacketsbasedonacl
traffic-policyApplyspecifictrafficpolicy
traffic-redirectRedirectpacketsbasedonacl
traffic-remarkRemarkpacketsbasedonacl
traffic-secureFilterpacketsbasedonacl
traffic-statisticCountpacketsbasedonacl
transceiverTransceiver
user-bindUserbind
user-interfaceConfiguretheuserterminalinterface
vlanVirtualLAN
voice-vlanVoiceVLAN
[xinhao]undovl
[xinhao]undovlan10
[xinhao]
[xinhao]
[xinhao]qu
[xinhao]quit
Jan14200023:
57:
30xinhaoDS/4/DATASYNC_CFGCHANGE:
OIDconfigurationshavebeenchanged.Thecurrentchangenumberis23,thecha
ngeloopcountis0,andthemaximumnumberofrecordsis
di
displayvlan
Thetotalnumberofvlansis:
2
--------------------------------------------------------------------------------
U:
Up;D:
Down;TG:
Tagged;UT:
Untagged;
MP:
Vlan-mapping;ST:
Vlan-stacking;
#:
ProtocolTransparent-vlan;*:
Management-vlan;
--------------------------------------------------------------------------------
VIDTypePorts
--------------------------------------------------------------------------------
1commonUT:
GE0/0/1(D)GE0/0/2(D)GE0/0/3(D)GE0/0/4(D)
GE0/0/5(D)GE0/0/6(D)GE0/0/7(D)GE0/0/8(D)
GE0/0/9(D)GE0/0/10(D)GE0/0/11(D)GE0/0/12(D)
GE0/0/13(D)GE0/0/14(D)GE0/0/15(D)GE0/0/16(D)
GE0/0/17(D)GE0/0/18(D)GE0/0/19(D)GE0/0/20(D)
GE0/0/21(D)GE0/0/22(D)GE0/0/23(D)GE0/0/24(D)
GE0/0/25(D)GE0/0/26(D)GE0/0/27(D)GE0/0/28(D)
757commonUT:
GE0/0/24(D)
VIDStatusPropertyMAC-LRNStatisticsDescription
--------------------------------------------------------------------------------
1enabledefaultenabledisableVLAN0001
757enabledefaultenabledisableVLAN0757
save
save
Thecurrentconfigurationwillbewrittentothedevice.
Areyousuretocontinue[Y/N]y
Nowsavingthecurrentconfigurationtotheslot0.
Jan14200023:
57:
55xinhao%%01CFM/4/SAVE(l)[1]:
TheuserchoseYwhendeciding
whethertosavetheconfigurationtothedevice.
Savetheconfigurationsuccessfully.
ssy
sys
system-view
Entersystemview,returnuserviewwithCtrl+Z.
[xinhao]int
[xinhao]interfaceg
[xinhao]interfaceGigabitEthernet0/0/1
[xinhao-GigabitEthernet0/0/1]port
[xinhao-GigabitEthernet0/0/1]porthy
[xinhao-GigabitEthernet0/0/1]porthybridpvid
[xinhao-GigabitEthernet0/0/1]porthybridpvidvl
[xinhao-GigabitEthernet0/0/1]porthybridpvidvlan757
[xinhao-GigabitEthernet0/0/1]
Jan15200000:
03:
20xinhaoDS/4/DATASYNC_CFGCHANGE:
OIDconfigurationshav