Skip to content

ripnet/clab-dhcp-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ripnet/clab-dhcp-client

A lightweight, Alpine-based DHCP client container specifically designed for testing ISP-style networking in containerlab.

🚀 Features

  • This can be used with ripnet/clab-kea-dhcp as a DHCP server.
  • This client is optimized to test IPv4, IPv6 WAN (IA_NA), and IPv6 Prefix Delegation (IA_PD) simultaneously.
  • Prefix Delegation verification: Requests a /56 (or any size) and automatically carves it into two /64 subnets assigned to dummy0 and dummy1.
  • Management isolation: Automatically removes default routes from eth0 (the docker interface) to ensure all traffic is routed via the data link (eth1)

🛠 Usage in Containerlab

Add the following node to your containerlab yaml

nodes:
  client1:
    kind: linux
    image: ghcr.io/ripnet/clab-dhcp-client:latest

Connect it to your router:

links:
  - endpoints: ["router:eth1", "client1:eth1"]

🔍 How to Verify

Once the lab is deployed, you can verify that the client successfully received its assignments by running:

  1. Verify that eth1 has both an IPv4 address and a Global IPv6 address.
docker exec -it clab-repo-client1 ip addr show eth1
  1. Check Prefix Delegation (The LAN test) This client is configured to take the first two subnets from the ISP's delegated prefix and assign them to virtual interfaces.
docker exec -it clab-repo-client1 ip -6 addr show dummy0
docker exec -it clab-repo-client1 ip -6 addr show dummy1

If dummy0 and dummy1 show addresses like 2001:db8:cafe::1/64 and 2001:db8:cafe:1::1/64, your PD setup is working perfectly!

  1. Check Routing

Verify that the default gateway was learned via Router Advertisements (RA) from your relay/router:

docker exec -it clab-repo-client1 ip -6 route show

🛠 Manual Release/Renew

To test the DHCP server's state machine without restarting the containerlab lab:

Release Leases:

docker exec -it clab-repo-client1 dhcpcd -k eth1

Renew/Request New:

docker exec -it clab-repo-client1 dhcpcd -n eth1

About

Multi-protocol DHCP client for containerlab testing

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors