(华为)DHCP与VLAN结合的应用

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了(华为)DHCP与VLAN结合的应用相关的知识,希望对你有一定的参考价值。

技术分享图片
1.通过搭建的拓扑图来实现PC的IP地址自动获取
2.配置思路:
⑴首先将PC机调到DHCP自动获取状态;
技术分享图片
⑵创建相应的VLAN,将VLAN放入对应的端口;
<Huawei>system-view
[SW2]vlan batch 10 20 30
[SW2]interface Eth0/0/2
[SW2-Ethernet0/0/2]port link-type access
[SW2-Ethernet0/0/2]port default vlan 10
[SW2]interface Eth0/0/3
[SW2-Ethernet0/0/3]port link-type access
[SW2-Ethernet0/0/3]port default vlan 20
[SW2]interface Eth0/0/1
[SW2-Ethernet0/0/1]port link-type trunk
[SW2-Ethernet0/0/1]port trunk allow-pass vlan all
<Huawei>system-view
[SW3]vlan batch 10 20 30
[SW3]interface Eth0/0/2
[SW3-Ethernet0/0/2]port link-type access
[SW3-Ethernet0/0/2]port default vlan 30
[SW3]interface Eth0/0/1
[SW3-Ethernet0/0/1]port link-type trunk
[SW3-Ethernet0/0/1]port trunk allow-pass vlan all

⑶在三层交换机上创建DHCP地址池,并开启;
<Huawei>system-view
[SW1]vlan batch 10 20 30
[SW1]interface 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]int g0/0/2
[SW1-GigabitEthernet0/0/2]port link-type trunk
[SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[SW1]interface Vlanif 10
[SW1-Vlanif10]ip address 192.168.1.254 24
[SW1-Vlanif10]int vl20
[SW1-Vlanif20]ip address 192.168.2.254 24
[SW1-Vlanif20]int vl30
[SW1-Vlanif30]ip address 192.168.3.254 24
[SW1]dhcp enable
[SW1]ip pool vlan10
[SW1-ip-pool-vlan10]network 192.168.1.0 mask 24
[SW1-ip-pool-vlan10]gateway-list 192.168.1.254
[SW1-ip-pool-vlan10]dns-list 8.8.8.8
[SW1]ip pool vlan20
[SW1-ip-pool-vlan20]network 192.168.2.0 mask 24
[SW1-ip-pool-vlan20]gateway-list 192.168.2.254
[SW1-ip-pool-vlan20]dns-list 8.8.8.8
[SW1]ip pool vlan30
[SW1-ip-pool-vlan30]network 192.168.3.0 mask 24
[SW1-ip-pool-vlan30]gateway-list 192.168.3.254
[SW1-ip-pool-vlan30]dns-list 8.8.8.8
[SW1]interface Vlanif 10
[SW1-Vlanif10]dhcp select global
[SW1-Vlanif10]int vl20
[SW1-Vlanif20]dhcp select global
[SW1-Vlanif20]int vl30
[SW1-Vlanif30]dhcp select global
技术分享图片
技术分享图片

⑷ 验证;注意:华为获取的IP地址是从254往下开始分配的,思科是从1往上开始分配的;
PC1:
技术分享图片
PC2:
技术分享图片
PC3:
技术分享图片

以上是关于(华为)DHCP与VLAN结合的应用的主要内容,如果未能解决你的问题,请参考以下文章

华为 DHCP 实现全网VLAN互通

华为三层交换机VRRP与DHCP综合实验详解

华为创建于全局的DHCP设置

华为三层交换机dhcp配置命令

使三层交换机实现DHCP功能--华为

华为三层路由器dhcp的架设