码迷,mamicode.com
首页 > 其他好文 > 详细

简单的DHCP分配,加子网划分实验

时间:2018-12-03 21:02:47      阅读:390      评论:0      收藏:0      [点我收藏+]

标签:ace   完全   端口   分享图片   验证   配置   lob   ges   int   

实验名称:简单的DHCP 分配,加子网划分实验
实验拓扑:
技术分享图片
实验要求:
给定了192.168.100.0/24 网段, 划分位4个子网,分配给vlan 10~40。
所有pc机都能获取到ip地址、网关、dns地址。租期为3天。

实验步骤:
1、
计算子网,将192.168.100.0/24 划分为4个网段,分别为:
网段:192.168.100.0/26 网关: 192.168.100.62
网段: 192.168.100.64/26 网关: 192.168.100.126
网段: 192.168.100.128/26 网关: 192.168.100.190
网段: 192.168.100.192/26 网关: 192.168.100.254
子网掩码为:255.255.255.192

2、 

#配置交换机SW1 :
vlan batch 10 20 30 40
interface e0/0/1
port link-type access
port de vlan 10
interface e0/0/2
port link-type access
port de vlan 20
interface e0/0/3
port link-type access
port de vlan 30
interface e0/0/4
port link-type access
port de vlan 40
interface g0/0/1
port link-type trunk
port trunk a vlan 10 20 30 40

 3、 
  #配置交换机sw2(与sw1配置完全相同)
    vlan batch 10 20 30 40 
interface e0/0/1
  port link-type access 
  port de vlan 10
interface e0/0/2
  port link-type access 
  port de vlan 20
interface e0/0/3
  port link-type access 
  port de vlan 30
interface e0/0/4
  port link-type access 
  port de vlan 40

interface g0/0/1
port link-type trunk
port trunk a vlan 10 20 30 40

  4、
  #配置作为DHCP服务器的SW3 :
 vlan batch 10 20 30 40 
dhcp enable             /开启DHCP服务
  ip pool vlan-10       
     network 192.168.100.0 mask 255.255.255.192
     gateway-list 192.168.100.62
     dns-list 8.8.8.8
     lease day 3
 ip pool vlan-20
     network 192.168.100.64 mask 255.255.255.192
     gateway-list 192.168.100.126
     dns-list 8.8.8.8
     lease day 3
 ip pool vlan-30
     network 192.168.100.128 mask 255.255.255.192
     gateway-list 192.168.190.126
     dns-list 8.8.8.8
     lease day 3
 ip pool vlan-40
     network 192.168.100.192 mask 255.255.255.192
     gateway-list 192.168.100.254
     dns-list 8.8.8.8
     lease day 3         /配置4个vlan 网段的地址池

 interface vlan 10
    ip address 192.168.100.62 255.255.255.192
    dhcp select global
interface vlan 20
     ip address 192.168.100.126 255.255.255.192
   dhcp select global
interface vlan 30
   ip address 192.168.100.190 255.255.255.192
  dhcp select global
interface vlan 40
   ip address 192.168.100.254 255.255.255.192
   dhcp select global     /配置4个网关,并指定dhcp服务器
port-group 1
 group-member g0/0/1 g0/0/2
  port link-type trunk
  port trunk a vlan 10 20 30 40    /配置连接sw1和sw2的端口

        验证:
        获取到了IP

        ![](http://i2.51cto.com/images/blog/201812/03/8e76a6f6975c17369e087859f830ef27.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)

简单的DHCP分配,加子网划分实验

标签:ace   完全   端口   分享图片   验证   配置   lob   ges   int   

原文地址:http://blog.51cto.com/14029008/2325593

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!