CCNP实验:三层交换实现VLAN间DHCP中继代理

多试试:多试试-计算机技术与软件


文章作者:Slyar 文章来源:Slyar Home (www.slyar.com) 转载请注明,谢谢合作。

【实验环境】

Cisco Packet Tracer 5.3.2

【实验目的】

使用三层交换+DHCP中继代理技术解决多个VLAN共享同一DHCP服务器问题。

由于划分了VLAN,可以有效减少ARP欺骗及广播风暴的影响,如果结合上DAI等技术就可以将ARP欺骗攻击的危害降到最低,这里由于模拟器无法做DAI,实验以后用真机做。这里多个VLAN使用同一个DHCP服务器,既是以后DAI的前提,同时也解决了随意修改IP带来的地址冲突问题。

【实验拓扑】

【实验描述】

模拟学校实验室,使用一台DHCP服务器(8.8.8.8 in VLAN 100),一台3560三层交换机,下面连接4个C2950接入层交换机,在3560上划分4个VLAN,将接入层交换机端口分别加入VLAN,各主机均使用DHCP自动获取IP地址。

【实验步骤】

1、配置DHCP服务器,设置服务器IP地址为8.8.8.8/24,网关地址为8.8.8.254。DHCP IP地址池如下划分:

由于PT模拟器自身的问题,默认地址池无法改名,真机环境下默认地址池即VLAN 10的地址池,各VLAN的网关分别为192.168.10.254、192.168.20.254、192.168.30.254、192.168.40.254,起始IP修改为不同,方便等会验证。

2、配置三层交换机,创建VLAN,将端口加入对应VLAN,其中DHCP服务器所在的端口加入VLAN 100(不选择VLAN 1是从安全方面着想)

interface FastEthernet0/1
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/2
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/3
switchport access vlan 30
switchport mode access
!
interface FastEthernet0/4
switchport access vlan 40
switchport mode access
!
interface FastEthernet0/24
switchport access vlan 100
switchport mode access
!

3、启用三层交换的路由功能,配置相应的Vlan端口以及DHCP中继。

DHCP中继的配置十分简单,只要在每个VLAN下使用"ip helper-address"指定DHCP服务器的地址即可,由于我们在DHCP服务器上配置了多个地址池(即DHCP作用域),因此中继数据包中的网关IP字段(GIADDR)中的地址会标识从哪个DHCP作用域提供IP地址租约,通常情况下会选择网关地址一致的作用域。

ip routing

interface Vlan10
ip address 192.168.10.254 255.255.255.0
ip helper-address 8.8.8.8
!
interface Vlan20
ip address 192.168.20.254 255.255.255.0
ip helper-address 8.8.8.8
!
interface Vlan30
ip address 192.168.30.254 255.255.255.0
ip helper-address 8.8.8.8
!
interface Vlan40
ip address 192.168.40.254 255.255.255.0
ip helper-address 8.8.8.8
!
//由DHCP中继的原理,三层交换机一定要有到DHCP服务器的路由信息
interface Vlan100
ip address 8.8.8.254 255.255.255.0
!

4、查看三层交换路由信息

Switch#sh ip ro
8.0.0.0/24 is subnetted, 1 subnets
C       8.8.8.0 is directly connected, Vlan100
C    192.168.10.0/24 is directly connected, Vlan10
C    192.168.20.0/24 is directly connected, Vlan20
C    192.168.30.0/24 is directly connected, Vlan30
C    192.168.40.0/24 is directly connected, Vlan40

5、验证DHCP分配状况

PC0:192.168.10.1/24

PC1:192.168.20.2/24

PC2:192.168.30.50/24

PC3:192.168.40.100/24



移步至个人小站:www.very321.com

  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值