1. 程式人生 > >(華為)DHCP與VLAN結合的應用

(華為)DHCP與VLAN結合的應用

def 通過 f11 ani 3.2 ext 應用 lan vpd

技術分享圖片
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結合的應用