欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

华为 ENSP 交换机上的子网划分示例过程和一些答案 - 实验代码

最编程 2024-04-29 11:38:41
...
<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable 
Info: Information center is disabled.
[Huawei]sysname CORE //命名设备
[CORE]vlan batch 10 20 30//创建vlan10 20 30 
Info: This operation may take a few seconds. Please wait for a moment...done.
[CORE]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.	
[CORE]interface GigabitEthernet 0/0/1	//设置此端口为ACCESS端口,并且属于vlan10
[CORE-GigabitEthernet0/0/1]port link-type access 
[CORE-GigabitEthernet0/0/1]port default vlan 10
[CORE-GigabitEthernet0/0/1]quit 

[CORE]interface GigabitEthernet 0/0/2	//设置此端口为ACCESS端口,并且属于vlan20
[CORE-GigabitEthernet0/0/2]port link-type access 
[CORE-GigabitEthernet0/0/2]port default vlan 20
[CORE-GigabitEthernet0/0/2]quit 

[CORE]interface GigabitEthernet 0/0/3	//设置此端口为ACCESS端口,并且属于vlan30
[CORE-GigabitEthernet0/0/3]port link-type access 	
[CORE-GigabitEthernet0/0/3]port default vlan 30
[CORE-GigabitEthernet0/0/3]quit 	

[CORE]interface Vlanif 10
[CORE-Vlanif10]ip address 192.168.1.1 25	 //配置vlanif虚拟网关地址是192.168.1.1,掩码25
[CORE-Vlanif10]dhcp select global //全局获取地址	
[CORE-Vlanif10]quit 

[CORE]interface Vlanif 20
[CORE-Vlanif20]ip address 192.168.1.129 26	//设置vlanif20网关地址,192.168.1.129 掩码26位
[CORE-Vlanif20]dhcp select global //全局获取地址	
[CORE-Vlanif20]quit 

[CORE]interface Vlanif 30	//设置vlanif30的网关地址,192.168.1.209 掩码是28位
[CORE-Vlanif30]ip address 192.168.1.209 28	
[CORE-Vlanif30]dhcp select global //全局获取地址		
[CORE-Vlanif30]quit 

[CORE]ip pool A //创建地址池A
Info:It's successful to create an IP address pool.	
[CORE-ip-pool-a]network 192.168.1.0 mask 25 //设置network和掩码
[CORE-ip-pool-a]gateway-list 192.168.1.1//设置网关
[CORE-ip-pool-a]dns-list  114.114.114.114
[CORE-ip-pool-a]quit 

[CORE]ip pool B
Info:It's successful to create an IP address pool.
[CORE-ip-pool-b]network 192.168.1.128 mask 26
[CORE-ip-pool-b]gateway-list 192.168.1.129
[CORE-ip-pool-b]dns-list  114.114.114.114
[CORE-ip-pool-b]quit

[CORE]ip pool C
Info:It's successful to create an IP address pool.
[CORE-ip-pool-c]network 192.168.1.208 mask 28
[CORE-ip-pool-c]gateway-list 192.168.1.209
[CORE-ip-pool-c]dns-list  114.114.114.114
[CORE-ip-pool-c]quit 
[CORE]

然后我们查看获取地址的情况