Static-Mapping
This scenario checks whether the static-mapping
option works.
Test DHCP Server Static Mapping
Description
This scenario will check if the static-mapping
option works.
This option will give a specific lease to the MAC received, configured for the DHCP server.
The server will then configure the option with this MAC and the client will then 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' set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 2: Modify the following configuration lines 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' set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
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 1Show 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.259 ms --- 10.0.0.100 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.259/0.259/0.259/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/24Show output
----------------------------------------------------------------- Name IP Address Admin Oper Vrf Description ----------------------------------------------------------------- eth0 10.0.0.5/24 up up fe80::dcad:beff:feef:6c20/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 Oct 08 01:08:17 2024 Reason: REBOOT