Static-Mapping

This scenario check the functionality of the option static-mapping

Test DHCP Server Static Mapping

Description

This scenario will check the functionality of static-mapping option. This option will give a specific lease to the MAC received configured for the DHCP server. So the server will configure the option with this MAC and then the client will check it has received de IP address.

Scenario

Step 1: Set the following configuration in DUT1:

set interfaces ethernet eth0 mac 10:00:00:00:00:05

Step 2: Set the following configuration in DUT1:

set interfaces ethernet eth0 address dhcp

Step 3: Set the following configuration in DUT0:

set interfaces ethernet eth0 address 10.0.0.100/24
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 static-mapping test ip-address 10.0.0.5
set service dhcp-server shared-network dhcp subnet 10.0.0.0/24 static-mapping test mac-address 10:00:00:00:00:05

Step 4: Run command service dhcp-client renew interface eth0 at DUT1 and expect this output:

Show output
Renewing DHCP lease on interface eth0...

Step 5: Run command service dhcp-client renew interface eth0 at DUT1 and expect this output:

Show output
Renewing DHCP lease on interface eth0...

Step 6: Ping IP address 10.0.0.100 from DUT1:

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

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

Step 7: Run command interfaces ethernet eth0 show at DUT1 and check if output contains the following tokens:

10.0.0.5/24
Show output
-----------------------------------------------------------------
Name           IP Address           Admin  Oper  Vrf  Description
-----------------------------------------------------------------
eth0  10.0.0.5/24                   up     up
      fe80::dcad:beff:feef:6c10/64

Step 8: Run command service dhcp-client show leases interface eth0 at DUT1 and check if output contains the following tokens:

10.0.0.5
Show output
Interface:     eth0
IP address:    10.0.0.5
Subnet mask:   255.255.255.0
Routers:
Name-servers:
Domain-name:
NTP servers:
DHCP server:   10.0.0.100
Lease time:    43200
Expiry date:   Tue Dec 03 10:09:25 2024
Reason:        REBOOT