Advisor

This scenario shows how to configure service dhcp-relay and bind it to a system advisor. Depending on the system advisor status, dhcp-relay instances will be active or not.

../../../../_images/toplogy.svg

Test DHCP Relay

Description

This example shows how to configure a DHCP relay instance in DUT0 with a system advisor that enables/disables it on-the-fly.

Scenario

Step 1: Set the following configuration in DUT0:

set interfaces ethernet eth0 vif 100 address 10.0.0.2/24
set interfaces ethernet eth1 vif 200 address 20.0.0.2/24
set service dhcp-relay INS advisor ENABLE_INS
set service dhcp-relay INS downstream-interface eth1.200
set service dhcp-relay INS server 10.0.0.1
set service dhcp-relay INS upstream-interface eth0.100
set system advisor ENABLE_INS test false
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1:

set interfaces ethernet eth0 vif 100 address 10.0.0.1/24
set protocols static route 0.0.0.0/0 next-hop 10.0.0.2
set service dhcp-server shared-network dummy subnet 10.0.0.1/32
set service dhcp-server shared-network remote subnet 20.0.0.0/24 start 20.0.0.50 stop 20.0.0.50
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Set the following configuration in DUT2:

set interfaces ethernet eth0 vif 200 address dhcp
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 4: Ping IP address 10.0.0.1 from DUT0:

admin@DUT0$ ping 10.0.0.1 count 1 size 56 timeout 1
Show output
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=0.267 ms

--- 10.0.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.267/0.267/0.267/0.000 ms

Step 5: Run command interfaces ethernet show at DUT2 and check if output does not contain the following tokens:

20.0.0.50
Show output
-----------------------------------------------
Name  IP Address  Admin  Oper  Vrf  Description
-----------------------------------------------
eth0              down   down
eth1              down   down

Step 6: Modify the following configuration lines in DUT0:

set system advisor ENABLE_INS test true

Step 7: Run command service dhcp-client renew interface eth0.200 at DUT2 and expect this output:

Show output
Renewing DHCP lease on interface eth0.200...

Step 8: Run command interfaces ethernet show at DUT2 and check if output contains the following tokens:

20.0.0.50
Show output
---------------------------------------------------------------------
  Name             IP Address           Admin  Oper  Vrf  Description
---------------------------------------------------------------------
    eth0  fe80::dcad:beff:feef:6c30/64  up     up
eth0.200  20.0.0.50/24                  up     up
          fe80::dcad:beff:feef:6c30/64
    eth1                                down   down