"""

    实验:MX DHCP local server/static vlan/without AAA

    版本:1.0

    日期:03/25/2019

"""

 

实验拓扑:

拓扑DHCP.png

实验配置:

1.开启DHCP服务:

services {

        dhcp-local-server {

            group summer-dhcp-access {

                interface ge-0/0/2.100;    #指定本地DHCP server需要侦听的接口

2.配置接口:

interfaces {

    ge-0/0/2 {

        flexible-vlan-tagging;    #开启vlan-tagging 对端交换机配置trunk接口;

        unit 100 {

            vlan-id 100;    #Static vlan-id 100

            family inet {

                unnumbered-address lo0.0;    #以此地址为网关获取POOL地址;

        }

    }

    lo0 {

        unit 0 {

            family inet {

                address 1.1.1.2/32;

            }

        }

    }

}

3.地址池:

        pool p2 {

            family inet {

                network 1.1.1.0/24;

                range r1 {

                    low 1.1.1.10;

                    high 1.1.1.99;

                }

                dhcp-attributes {

                    maximum-lease-time 60;

                    name-server {

                        192.168.1.1;

                        192.168.1.2;

                    }

                    router {

                        1.1.1.2    #指定本地POOL的网关,这个地址同样需要出现在被调用的lo0接口上,出现多个lo0地址和多个pool的时候,依据这个网关地址来决断分配POOL。

3.实验验证:

root# run show subscribers  #查看用户                  

Interface           IP Address/VLAN ID                      User Name                      LS:RI

ge-0/0/2.100        1.1.1.10                                                          default:default      

ge-0/0/2.100        1.1.1.11                                                          default:default      

ge-0/0/2.100        1.1.1.12                                                          default:default      


[edit]

root# run show subscribers address 1.1.1.10 detail  #查看用户细节

Type: DHCP

IP Address: 1.1.1.100   #ip地址

IP Netmask: 255.255.255.0   #掩码

Logical System: default

Routing Instance: default   #路由实例和逻辑系统

Interface: ge-0/0/2.100    #接口

Interface type: Static  #接口类型(目前的实验没有调用dynamic profile 接口vlan是静态的)

Underlying Interface: ge-0/0/2.100  #物理接口

MAC Address: 50:00:00:0f:00:00  #MAC信息

State: Active

Radius Accounting ID: jnpr :1   #Radius 认证ID     #目前实验是without AAA;

Session ID: 1   #回话ID

VLAN Id: 100  #VLAN

Login Time: 2019-03-25 02:47:33 UTC  #登录时间

DHCP Options: len 51    #这个什么鬼 暂时还不知道

35 01 01 74 01 01 3d 07 01 50 00 00 0f 00 00 0c 07 63 6c 69

65 6e 74 31 3c 08 4d 53 46 54 20 35 2e 30 37 0b 01 0f 03 06

2c 2e 2f 1f 21 f9 2b 2b 02 dc 00


[edit]

root# run show dhcp server binding  #对应的清除命令 clear dhcp server binding _


IP address        Session Id  Hardware address   Expires     State      Interface

1.1.1.11          2           50:00:00:0a:00:00  53          BOUND      ge-0/0/2.100        

1.1.1.12          3           50:00:00:0c:00:00  41          BOUND      ge-0/0/2.100        

1.1.1.10          1           50:00:00:0f:00:00  54          BOUND      ge-0/0/2.100        


[edit]

root# run show dhcp server binding detail   #查看DHCP信息


Client IP Address:  1.1.1.11

     Hardware Address:             50:00:00:0a:00:00 

     State:                        BOUND(LOCAL_SERVER_STATE_BOUND)

     Lease Expires:                2019-03-25 03:10:28 UTC

     Lease Expires in:             30 seconds   #租期

     Lease Start:                  2019-03-25 02:47:46 UTC

     Last Packet Received:         2019-03-25 03:09:28 UTC

     Incoming Client Interface:    ge-0/0/2.100

     Client Interface Vlan Id:     100

     Server Identifier:            1.1.1.2

     Session Id:                   2

     Client Pool Name:             p2   #POOL的名字;

Client IP Address:  1.1.1.12

     Hardware Address:             50:00:00:0c:00:00

     State:                        BOUND(LOCAL_SERVER_STATE_BOUND)

     Lease Expires:                2019-03-25 03:10:50 UTC

     Lease Expires in:             52 seconds

     Lease Start:                  2019-03-25 02:51:29 UTC

     Last Packet Received:         2019-03-25 03:09:50 UTC

     Incoming Client Interface:    ge-0/0/2.100

     Client Interface Vlan Id:     100

     Server Identifier:            1.1.1.2

     Session Id:                   3    

     Client Pool Name:             p2

Client IP Address:  1.1.1.10

     Hardware Address:             50:00:00:0f:00:00

     State:                        BOUND(LOCAL_SERVER_STATE_BOUND)

     Lease Expires:                2019-03-25 03:10:29 UTC

     Lease Expires in:             31 seconds

     Lease Start:                  2019-03-25 02:47:33 UTC

     Last Packet Received:         2019-03-25 03:09:29 UTC

     Incoming Client Interface:    ge-0/0/2.100

     Client Interface Vlan Id:     100

     Server Identifier:            1.1.1.2

     Session Id:                   1

     Client Pool Name:             p2