1. 程式人生 > >華為DHCP+VLANDHCP RELAY配置重點

華為DHCP+VLANDHCP RELAY配置重點

拓撲如下:

1、SW和Router均需開啟DHCP enable,以及配置對應的vlan

2、DHCP RELAY資訊配置在SW裡面

3、DHCP POOL配置在Router裡面

4、Router裡面需要配置預設路由,閘道器指向SW的vlan10閘道器

5、連線dhcp客戶端的乙太網介面均需配置好vlan模式。

 

SW配置:

vlan batch 10 20 30
dhcp enable
interface Vlanif10
 ip address 12.1.1.1 255.255.255.0
#
interface Vlanif20
 ip address 192.168.20.1 255.255.255.0
 dhcp select relay


 dhcp relay server-ip 12.1.1.2
#
interface Vlanif30
 ip address 172.17.30.1 255.255.255.0
 dhcp select relay
 dhcp relay server-ip 12.1.1.2

interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 10
#
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 20
#
interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 30
#

Router配置:
vlan batch 10 20 30

dhcp enable
#
ip pool vlan20
 gateway-list 192.168.20.1
 network 192.168.20.0 mask 255.255.255.0
 excluded-ip-address 192.168.20.2 192.168.20.100
 dns-list 192.168.20.1
#
ip pool vlan30
 gateway-list 172.17.30.1
 network 172.17.30.0 mask 255.255.255.0
 lease day 8 hour 0 minute 0
 dns-list 172.17.30.1
#
interface GigabitEthernet0/0/0
 ip address 12.1.1.2 255.255.255.0
 dhcp select global


#
ip route-static 0.0.0.0 0.0.0.0 12.1.1.1