Skip to content

Instantly share code, notes, and snippets.

@SteveBarnes-BH
Forked from yosshy/dhcp_server.py
Created August 21, 2022 09:08
Show Gist options
  • Save SteveBarnes-BH/336ee7a41660c92c351ef4e4197d9bbc to your computer and use it in GitHub Desktop.
Save SteveBarnes-BH/336ee7a41660c92c351ef4e4197d9bbc to your computer and use it in GitHub Desktop.
DHCP Server with Python Scapy
from scapy.all import DHCP_am
from scapy.base_classes import Net
dhcp_server = DHCP_am(iface='eth1', domain='example.com',
pool=Net('192.168.10.0/24'),
network='192.168.10.0/24',
gw='192.168.10.254',
renewal_time=600, lease_time=3600)
dhcp_server()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment