DHCP中继代理配置

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DHCP中继代理配置相关的知识,希望对你有一定的参考价值。

实验目标

实现跨网段为主机自动分配IP地址等配置

实验环境

  1. GNS 3
  2. DHCP服务器能够为192.168.10.0 , 192.168.20.0两个网段自动分配IP地址

实验拓扑图

技术分享图片

配置命令

三层交换机sw1:

sw1#
sw1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
sw1(config)#vlan 10,20,100
sw1(config-vlan)#ex
sw1(config)#int f1/0
sw1(config-if)#sw mo tr
*Mar  1 00:02:37.515: %DTP-5-TRUNKPORTON: Port Fa1/0 has become dot1q trunk
sw1(config-if)#sw tr en dot
sw1(config-if)#ex
sw1(config)#int vlan10
*Mar  1 00:02:59.655: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up
sw1(config-if)#ip add 192.168.10.1 255.255.255.0
sw1(config-if)#no shut
sw1(config-if)#ip helper-address 192.168.100.2
sw1(config-if)#ex
sw1(config)#int vlan20
*Mar  1 00:03:38.203: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up
sw1(config-if)#ip add 192.168.20.1 255.255.255.0
sw1(config-if)#no shut
sw1(config-if)#ip helper-address 192.168.100.2
sw1(config-if)#ex
sw1(config)#int vlan100
*Mar  1 00:04:14.775: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan100, changed state to up
sw1(config-if)#ip add 192.168.100.1 255.255.255.0
sw1(config-if)#no shut
sw1(config-if)#ex
sw1(config)#do show vlan-sw b

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/1, Fa1/2, Fa1/3, Fa1/4
                                                Fa1/5, Fa1/6, Fa1/7, Fa1/8
                                                Fa1/9, Fa1/10, Fa1/11, Fa1/12
                                                Fa1/13, Fa1/14, Fa1/15
10   VLAN0010                         active    
20   VLAN0020                         active    
100  VLAN0100                         active    
1002 fddi-default                     act/unsup 
1003 token-ring-default               act/unsup 
1004 fddinet-default                  act/unsup 
1005 trnet-default                    act/unsup 
sw1(config)#

交换机sw2:

sw2>en
sw2#conf t
sw2(config)#no ip routing
sw2(config)#vlan 10,20,100
sw2(config-vlan)#ex
sw2(config)#int f1/1
sw2(config-if)#sw mo acc
sw2(config-if)#sw acc vlan 10
sw2(config-if)#ex
sw2(config)#int f1/2
sw2(config-if)#sw mo acc
sw2(config-if)#sw acc vlan 20
sw2(config-if)#ex
sw2(config)#int f1/3
sw2(config-if)#sw mo acc
sw2(config-if)#sw acc vlan 100
sw2(config-if)#ex
sw2(config)#int f1/0
sw2(config-if)#sw mo tr
*Mar  1 00:01:56.795: %DTP-5-TRUNKPORTON: Port Fa1/0 has become dot1q trunk
sw2(config-if)#sw tr en dot1q
sw2(config-if)#ex
sw2(config)#do show vlan-sw b

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/4, Fa1/5, Fa1/6, Fa1/7
                                                Fa1/8, Fa1/9, Fa1/10, Fa1/11
                                                Fa1/12, Fa1/13, Fa1/14, Fa1/15
10   VLAN0010                         active    Fa1/1
20   VLAN0020                         active    Fa1/2
100  VLAN0100                         active    Fa1/3
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup
sw2(config)#

实验结果

技术分享图片

以上是关于DHCP中继代理配置的主要内容,如果未能解决你的问题,请参考以下文章

DHCP中继代理配置

DHCP中继代理,配置dhcp,中继代理,跨越不同vlan,给不同vlan下的客户机提供dhcp服务

使用sever2008做DHCP中继代理

软件模拟DHCP中继代理的配置

三层交换机配置路由DHCP中继代理

linux基础服务1--dhcp中继代理