1. DHCP Relay的基本工作原理

dhcp relay 基本工作原理及配置_服务器

详解:DHCP CLIENT利用DHCP RELAY来从DHCP SERVER处获取IP地址等配置参数,DHCP RELAY与DHCP CLIENT位于同一个二层广播域,DHCP SERVER可以与DHCP RELAY位于同一个二层广播域,也可以与DHCP RELAY不在同一个广播域。

  1. 网络拓扑结构

dhcp relay 基本工作原理及配置_ip地址_02

  1. 配置实现

AR1:

<ar1>display current-configuration  

[V200R003C00]

#

sysname ar1

#

snmp-agent local-engineid 800007DB03000000000000

snmp-agent  

#

clock timezone China-Standard-Time minus 08:00:00

#

portal local-server load portalpage.zip

#

drop illegal-mac alarm

#

set cpu-usage threshold 80 restore 75

#

dhcp enable //第一步

#

ip pool dhcp1 //第二步

gateway-list 192.168.1.1  

network 192.168.1.0 mask 255.255.255.0  

excluded-ip-address 192.168.1.10  

lease day 8 hour 0 minute 0  

dns-list 114.114.114.114  

#

ip pool dhcp2

gateway-list 192.168.2.1  

network 192.168.2.0 mask 255.255.255.0  

excluded-ip-address 192.168.2.10  

lease day 8 hour 0 minute 0  

dns-list 114.114.114.114  

#

aaa  

authentication-scheme default

authorization-scheme default

accounting-scheme default

domain default  

domain default_admin  

local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$

local-user admin service-type http

#

firewall zone Local

priority 15

#

interface GigabitEthernet0/0/0 //第三步

ip address 10.1.1.1 255.255.255.252  

dhcp select global

#

interface GigabitEthernet0/0/1

#

interface GigabitEthernet0/0/2

#

interface NULL0

#

ip route-static 192.168.1.0 255.255.255.0 10.1.1.2

ip route-static 192.168.2.0 255.255.255.0 10.1.1.2

#

user-interface con 0

authentication-mode password

user-interface vty 0 4

user-interface vty 16 20

#

wlan ac

#

return

AR2:

<ar2>display current-configuration  

[V200R003C00]

#

sysname ar2

#

snmp-agent local-engineid 800007DB03000000000000

snmp-agent  

#

clock timezone China-Standard-Time minus 08:00:00

#

portal local-server load portalpage.zip

#

drop illegal-mac alarm

#

set cpu-usage threshold 80 restore 75

#

dhcp enable

#

dhcp server group dhcpgroup1  //第一步

dhcp-server 10.1.1.1 0 //指定DHCP server服务器//第二步

#

dhcp server group dhcpgroup2  

dhcp-server 10.1.1.1 0 //指定DHCP server服务器

#

aaa  

authentication-scheme default

authorization-scheme default

accounting-scheme default

domain default  

domain default_admin  

local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$

local-user admin service-type http

#

firewall zone Local

priority 15

#

interface GigabitEthernet0/0/0

ip address 10.1.1.2 255.255.255.252  

#

interface GigabitEthernet0/0/1 //第三步

ip address 192.168.2.1 255.255.255.0  

dhcp select relay

dhcp relay server-select dhcpgroup2

#

interface GigabitEthernet0/0/2

ip address 192.168.1.1 255.255.255.0  

dhcp select relay

dhcp relay server-select dhcpgroup1

#

interface NULL0

#

user-interface con 0

authentication-mode password

user-interface vty 0 4

user-interface vty 16 20

#

wlan ac

#

return

SW1:

<sw1>display current-configuration  

#

sysname sw1

#

vlan batch 10 20 30

#

cluster enable

ntdp enable

ndp enable

#

drop illegal-mac alarm

#

diffserv domain default

#

drop-profile default

#

aaa

authentication-scheme default

authorization-scheme default

accounting-scheme default

domain default

domain default_admin

local-user admin password simple admin

local-user admin service-type http

#

interface Vlanif1

#

interface MEth0/0/1

#

interface Ethernet0/0/1

port link-type access

port default vlan 10

#

interface Ethernet0/0/2

#

interface Ethernet0/0/3

#

interface Ethernet0/0/4

#

interface Ethernet0/0/5

#

interface Ethernet0/0/6

#

interface Ethernet0/0/7

#

interface Ethernet0/0/8

#

interface Ethernet0/0/9

#

interface Ethernet0/0/10

#

interface Ethernet0/0/11

#

interface Ethernet0/0/12

#

interface Ethernet0/0/13

#

interface Ethernet0/0/14

#

interface Ethernet0/0/15

#

interface Ethernet0/0/16

#

interface Ethernet0/0/17

#

interface Ethernet0/0/18

#

interface Ethernet0/0/19

#

interface Ethernet0/0/20

#

interface Ethernet0/0/21

#

interface Ethernet0/0/22

#

interface GigabitEthernet0/0/1

port link-type access

port default vlan 10

#

interface GigabitEthernet0/0/2

#

interface NULL0

#

user-interface con 0

user-interface vty 0 4

#

return

SW2:

<sw2>display CU  

<sw2>display current-configuration  

#

sysname sw2

#

vlan batch 10 20 30

#

cluster enable

ntdp enable

ndp enable

#

drop illegal-mac alarm

#

diffserv domain default

#

drop-profile default

#

aaa

authentication-scheme default

authorization-scheme default

accounting-scheme default

domain default

domain default_admin

local-user admin password simple admin

local-user admin service-type http

#

interface Vlanif1

#

interface MEth0/0/1

#

interface Ethernet0/0/1

port link-type access

port default vlan 20

#

interface Ethernet0/0/2

#

interface Ethernet0/0/3

#

interface Ethernet0/0/4

#

interface Ethernet0/0/5

#

interface Ethernet0/0/6

#

interface Ethernet0/0/7

#

interface Ethernet0/0/8

#

interface Ethernet0/0/9

#

interface Ethernet0/0/10

#

interface Ethernet0/0/11

#

interface Ethernet0/0/12

#

interface Ethernet0/0/13

#

interface Ethernet0/0/14

#

interface Ethernet0/0/15

#

interface Ethernet0/0/16

#

interface Ethernet0/0/17

#

interface Ethernet0/0/18

#

interface Ethernet0/0/19

#

interface Ethernet0/0/20

#

interface Ethernet0/0/21

#

interface Ethernet0/0/22

#

interface GigabitEthernet0/0/1

port link-type access

port default vlan 20

#

interface GigabitEthernet0/0/2

#

interface NULL0

#

user-interface con 0

user-interface vty 0 4

#

return