用华为模拟器ENSP构造校园网(第二天)配置总网络拓扑DHCP中继

下面我们来配置我们总的网络拓扑,(网络拓扑图雏形,,后续会加上去很多)

第一步我们配置总的网络拓扑图的DHCP中继:

先看一下我的网络设计雏形拓扑图:

用华为模拟器ENSP构造校园网(第二天)配置总网络拓扑DHCP中继_第1张图片

这个是我的网络设计雏形图

下面直接配置网络的DHCP中继:

先配置SW1的vlan和IP设置服务器的网关:

The device is running!

先配置基本的配置:

Sw1:配置sw2的配置:配置sw2的配置:

sys(进入配置模式)
[Huawei]sys sw1(改名)
[sw1]un in en(关闭提示)
[sw1]vlan batch 2 3 4(创建vlna 2 3 4)
[sw1]display this (显示配置)
#
sysname sw1
#
undo info-center enable
#
vlan batch 2 to 4
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
return
[sw1]dhcp enable (开启DHCP配置)
[sw1]int GigabitEthernet 0/0/3(进入端口3)	
[sw1-GigabitEthernet0/0/3]port link-type trunk(配置端口为主干模式)
[sw1-GigabitEthernet0/0/3]port trunk allow-pass vlan all (允许所有vlan通过)
[sw1-GigabitEthernet0/0/3]q
[sw1]int g	
[sw1]int GigabitEthernet 0/0/7	
[sw1-GigabitEthernet0/0/7]port link-type trunk 	
[sw1-GigabitEthernet0/0/7]port trunk allow-pass vlan all 
[sw1-GigabitEthernet0/0/7]q
[sw1]int g	
[sw1]int GigabitEthernet 0/0/2	
[sw1-GigabitEthernet0/0/2]port link-type trunk [sw1-GigabitEthernet0/0/2]port trunk allow-pass vlan all 
[sw1-GigabitEthernet0/0/2]q
[sw1]int g	
[sw1]

配置sw2的配置:

sys
[Huawei]sys sw 2	
[sw2]vlan batch 2 3 4
[sw2]dhcp enable
[sw2]un in en
[sw2]int GigabitEthernet 0/0/7	
[sw2-GigabitEthernet0/0/7]port link-type trunk 
[sw2-GigabitEthernet0/0/7]port trunk allow-pass vlan al
[sw2-GigabitEthernet0/0/7]port trunk allow-pass vlan all
[sw2-GigabitEthernet0/0/7]q
[sw2]int g	
[sw2]int GigabitEthernet 0/0/2	
[sw2-GigabitEthernet0/0/2]port link-type trunk 
[sw2-GigabitEthernet0/0/2]port trunk allow-pass vlan all 	
[sw2-GigabitEthernet0/0/2]q
[sw2]	
[sw2]int g	
[sw2]int GigabitEthernet 0/0/3	
[sw2-GigabitEthernet0/0/3]port link-type trunk 
[sw2-GigabitEthernet0/0/3]port trunk allow-pass vlan all 
[sw2-GigabitEthernet0/0/3]q

 

下面来配置一下sw3:

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys sw3
[sw3]un in en
Info: Information center is disabled.
[sw3]int g	
[sw3]int GigabitEthernet 0/0/1
[sw3-GigabitEthernet0/0/1]port link-type trunk 
[sw3-GigabitEthernet0/0/1]port trunk allow-pass vlan all 
[sw3-GigabitEthernet0/0/1]q
[sw3]int e	
[sw3]int Eth	
[sw3]int Ethernet0/0/1
[sw3-Ethernet0/0/1]port link-type access 	
[sw3-Ethernet0/0/1]q
[sw3]int e	
[sw3]int Eth	
[sw3]int Ethernet0/0/2	
[sw3-Ethernet0/0/2]port link-type access 
[sw3-Ethernet0/0/2]q
[sw3]int e	
[sw3]int Eth	
[sw3]int Ethernet0/0/3	
[sw3-Ethernet0/0/3]port link-type access 
[sw3-Ethernet0/0/3]q
[sw3]vlan b	
[sw3]vlan batch 2 3 4
[sw3]

 

 下面配置以下sw4:

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys sw4
[sw4]int g	
[sw4]int GigabitEthernet 0/0/1	
[sw4-GigabitEthernet0/0/1]port link-type trunk 
[sw4-GigabitEthernet0/0/1]port trunk allow-pass vlan all 
[sw4-GigabitEthernet0/0/1]
[sw4-GigabitEthernet0/0/1]q	
[sw4]int Ethernet0/0/3	
[sw4-Ethernet0/0/3]port link-type trunk 
[sw4-Ethernet0/0/3]port trunk allow-pass vlan all
[sw4-Ethernet0/0/3]q	
[sw4]vlan batch 2 3 4(创建vlan)
[sw4]int Ethernet0/0/1	(进入端口1)
[sw4-Ethernet0/0/1]port link-type access (配置接口为连接模式)
[sw4-Ethernet0/0/1]port default vlan 2(允许通过vlan2)
[sw4-Ethernet0/0/1]q
[sw4]int Ethernet0/0/2
[sw4-Ethernet0/0/2]port link-type access 
[sw4-Ethernet0/0/2]

[sw4]

下面配置sw5:

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys sw5
[sw5]vlan batch 2 3 4	
[sw5]un in en
[sw5]int Eth	
[sw5]int Ethernet0/0/3
[sw5-Ethernet0/0/3]port link-type trunk 
[sw5-Ethernet0/0/3]port trunk allow-pass vlan all 
[sw5-Ethernet0/0/3]q
[sw5]int g	
[sw5]int GigabitEthernet 0/0/1	
[sw5-GigabitEthernet0/0/1]port link-type trunk 
[sw5-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[sw5-GigabitEthernet0/0/1]q	
[sw5]int Eth	
[sw5]int Ethernet0/0/1	
[sw5-Ethernet0/0/1]port link-type access 
[sw5-Ethernet0/0/1]port default vlan 3
[sw5-Ethernet0/0/1]q
[sw5]
[sw5]int Ethernet0/0/2
[sw5-Ethernet0/0/2]port link-type access 
[sw5-Ethernet0/0/2]

下面来配置sw6:

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys sw6
[sw6]un in en
[sw6]interface 	
[sw6]interface g	
[sw6]interface GigabitEthernet 0/0/1
[sw6-GigabitEthernet0/0/1]port link-type trunk 
[sw6-GigabitEthernet0/0/1]port trunk allow-pass vlan all 
[sw6-GigabitEthernet0/0/1]q
[sw6]int Eth	
[sw6]int Ethernet0/0/1	
[sw6-Ethernet0/0/1]port link-type access 
[sw6-Ethernet0/0/1]port default vlan 3
[sw6-Ethernet0/0/1]q
[sw6]int Eth	
[sw6]int Ethernet0/0/2	
[sw6-Ethernet0/0/2]port link-type access 	
[sw6-Ethernet0/0/2]q
[sw6]

 

 

上面这些是我们在配置DHCP乃至所有网络配置的基础

下面呢来配置一下我们的vlan的IP作为服务器的网关:

配置sw1:

sys
Enter system view, return user view with Ctrl+Z.
[sw1]int g	
[sw1]int GigabitEthernet 0/0/1
[sw1-GigabitEthernet0/0/1]port link-type trunk 	
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan all 
[sw1-GigabitEthernet0/0/1]q	
[sw1]int Vlanif 2
[sw1-Vlanif2]ip ad 192.168.2.254 24
[sw1-Vlanif2]q
[sw1]int v	
[sw1]int Vlanif 3	
[sw1-Vlanif3]ip address 192.168.3.254 24
[sw1-Vlanif3]q
[sw1]int Vlanif 4
[sw1-Vlanif4]ip address 192.168.4.254 24
[sw1-Vlanif4]q
[sw1]

下面来配置一下sw2:

sys
[sw2]int g	
[sw2]int GigabitEthernet 0/0/1	
[sw2-GigabitEthernet0/0/1]port link-type trunk 
[sw2-GigabitEthernet0/0/1]port trunk allow-pass vlan all 
[sw2]int Vlanif 2	
[sw2-Vlanif2]ip ad 192.168.2.254 24
[sw2-Vlanif2]q	
[sw2]int Vlanif 3
[sw2-Vlanif3]ip ad 192.168.3.254 24
[sw2-Vlanif3]q
[sw2]int Vlanif 4
[sw2-Vlanif4]ip ad 192.168.4.254 24
[sw2-Vlanif4]q
[sw2]

 

 不会的可以留言交流:

你可能感兴趣的:(ENSP,网络拓扑图,华为,网络协议,网络,蓝桥杯,负载均衡)