<返回更多

DHCP中继实战配置

2020-08-31    
加入收藏

一、配置拓扑

DHCP中继实战配置

 

二、 关键配置

1、配置VLAN、Trunk

1)、SW1的配置

SW1#show vlan brief

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Et0/3

10 VLAN0010 active

20 VLAN0020 active

interface Ethernet0/0 //交换机互联接口配置为Trunk

switchport trunk encapsulation dot1q

switchport mode trunk

DHCP服务端口配置为Access vlan30

interface Ethernet0/1

switchport access vlan 30

switchport mode access

2、SW1的VLANIF配置

DHCP中继实战配置

 

3、SW2的配置

划分接口VLAN:

interface Ethernet0/1

switchport access vlan 10

switchport mode access

interface Ethernet0/2

switchport access vlan 20

switchport mode access

配置Trunk:

interface Ethernet0/0

switchport trunk encapsulation dot1q

switchport mode trunk

4、DHCP服务器配置

ip dhcp pool VLAN10 //配置地址池分配IP地址段及掩码DNS

network 192.168.10.0 255.255.255.0

default-router 192.168.10.254

dns-server 8.8.8.8

lease 7

ip dhcp pool VLAN20 //配置地址池分配IP地址段及掩码DNS

network 192.168.20.0 255.255.255.0

default-router 192.168.20.254

dns-server 8.8.8.8

lease 7

ip dhcp excluded-address 192.168.10.254 //排除地址

ip dhcp excluded-address 192.168.20.254

配置DHCP中继:

interface Vlan10

ip address 192.168.10.254 255.255.255.0

ip helper-address 192.168.30.1

interface Vlan20

ip address 192.168.20.254 255.255.255.0

ip helper-address 192.168.30.1

三、DHCP测试

PC1可以正常获取IP地址

DHCP中继实战配置

 

PC2可以正常获取IP地址

PC2(config-if)#

*Aug 29 07:58:03.838: %DHCP-6-ADDRESS_ASSIGN: Interface Ethernet0/2 assigned DHCP address 192.168.20.1, mask 255.255.255.0, hostname PC2

DHCP中继实战配置
声明:本站部分内容来自互联网,如有版权侵犯或其他问题请与我们联系,我们将立即删除或处理。
▍相关推荐
更多资讯 >>>