DHCP Client in Junos vMX

DHCP Client in Junos vMX

This is just a quick lab note about successfully enabling DHCP client mode on the management and revenue ports fxp0 and 0/0/x on a vMX running 17.1R1. Background is a cloud deployment, where the interface IP addresses are dynamically assigned via DHCP to the interfaces of the virtual instance.

lab@vMX1> show version 
Hostname: vMX1
Model: vmx
Junos: 17.1R1.8

Management port fxp0 configuration:

lab@vMX1> show configuration interfaces fxp0
unit 0 {
  description oob-mgmt;
  family inet {
    dhcp;
  }
}

Revenue port xe–0/0/0 configuration:

lab@vMX1> show configuration interfaces xe-0/0/0  
unit 0 {
    description xe0;
    family inet {
        dhcp;
    }
}

BTW in order to have the interface named xe instead of the vMX default ge, use the following knob:

lab@vMX1> show configuration chassis
chassis {
    fpc 0 {
        pic 0 {
            interface-type xe;
        }
        performance-mode;
    }
}

Once active, the interfaces successfully learn their IP addresses:

lab@vMX1> show interfaces xe-0/0/0 terse            
Interface               Admin Link Proto    Local                 Remote
xe-0/0/0                up    up
xe-0/0/0.0              up    up   inet     192.168.1.41/24 
                                   multiservice
lab@vMX1> show interfaces fxp0 
Physical interface: fxp0, Enabled, Physical link is Up
  Interface index: 64, SNMP ifIndex: 1
  Type: Ethernet, Link-level type: Ethernet, MTU: 1514, Speed: 1000mbps
  Device flags   : Present Running
  Interface flags: SNMP-Traps
  Link type      : Full-Duplex
  Current address: 52:54:00:12:34:56, Hardware address: 52:54:00:12:34:56
  Last flapped   : 2017-04-09 16:44:18 UTC (02:16:37 ago)
    Input packets : 23
    Output packets: 314

  Logical interface fxp0.0 (Index 4) (SNMP ifIndex 13)
    Description: oob-mgmt
    Flags: Up SNMP-Traps 0x4004000 Encapsulation: ENET2
    Input packets : 20
    Output packets: 314
    Protocol inet, MTU: 1500
    Max nh cache: 75000, New hold nh limit: 75000, Curr nh cnt: 1,
    Curr new hold cnt: 0, NH drop cnt: 0
      Flags: Sendbcast-pkt-to-re, Is-Primary
      Addresses, Flags: Is-Default Is-Preferred Is-Primary
        Destination: 172.17/16, Local: 172.17.9.50, Broadcast: 172.17.255.255

But that’s not all, the actual DHCP binding states are available too:

lab@vMX1> show dhcp client binding 
IP address        Hardware address   Expires     State      Interface
192.168.1.41    02:09:c0:a8:14:a1  82066  BOUND  xe-0/0/0.0          
172.17.9.50     52:54:00:12:34:56   2871  BOUND  fxp0.0              

lab@vMX1> 

lab@vMX1> show dhcp client binding detail 

Client Interface/Id: xe-0/0/0.0
     Hardware Address:             02:09:c0:a8:14:a1
     State:                        BOUND(LOCAL_CLIENT_STATE_BOUND)
     Lease Expires:                2017-04-10 18:58:16 UTC
     Lease Expires in:             79276 seconds
     Lease Start:                  2017-04-09 18:58:16 UTC
     Server Identifier:            192.168.1.1
     Client IP Address:            192.168.1.41
     Update Server                 No

DHCP options:
    Name: dhcp-lease-time, Value: 1 day
    Name: server-identifier, Value: 192.168.1.1
    Name: router, Value: [ 192.168.1.1 ]
    Name: name-server, Value: [ 192.168.1.1 ]
    Name: subnet-mask, Value: 255.255.255.0
    Name: domain-name, Value: fritz.box

Client Interface/Id: fxp0.0
     Hardware Address:             52:54:00:12:34:56
     State:                        BOUND(LOCAL_CLIENT_STATE_BOUND)
     Lease Expires:                2017-04-09 21:51:57 UTC
     Lease Expires in:             3297 seconds
     Lease Start:                  2017-04-09 20:51:57 UTC
     Server Identifier:            172.17.0.1
     Client IP Address:            172.17.9.50
     Update Server                 No

DHCP options:
    Name: dhcp-lease-time, Value: 1 hour
    Name: server-identifier, Value: 172.17.0.1
    Name: router, Value: [ 172.17.0.1 ]
    Name: name-server, Value: [ 172.17.0.1 ]
    Name: subnet-mask, Value: 255.255.0.0
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: