DHCP API¶
DHCP configuration classes.
DHCPConfig¶
DHCPConfig
¶
Bases: UCISection
DHCP configuration manager.
Source code in src/wrtkit/dhcp.py
add_dhcp(dhcp)
¶
get_commands()
¶
Get all UCI commands for DHCP configuration.
Source code in src/wrtkit/dhcp.py
DHCPSection¶
DHCPSection
¶
Bases: UCISection
Represents a DHCP configuration section.
Source code in src/wrtkit/dhcp.py
Usage Example¶
from wrtkit import UCIConfig
from wrtkit.dhcp import DHCPSection
config = UCIConfig()
# Create DHCP section
section = DHCPSection("lan")\
.with_interface("lan")\
.with_start(100)\
.with_limit(150)\
.with_leasetime("12h")
config.dhcp.add_dhcp(section)