Skip to content

Instantly share code, notes, and snippets.

@pcurylo
Created January 2, 2017 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcurylo/49bd81ea00dab4fde4193d348c75736a to your computer and use it in GitHub Desktop.
Save pcurylo/49bd81ea00dab4fde4193d348c75736a to your computer and use it in GitHub Desktop.
Add DHCPD to Kali
#!/usr/bin/env view
command prefixes: $ normal user; # sudo
file contents between ............
check if dhcpd installed
$ apt --list|grep isc-dhcp-server
if not, install it
# apt-get install isc-dhcp-server -y
edit daemon config - uncomment 4 lines, add eth0
# vi /etc/default/isc-dhcp-server
....................
DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf
DHCPDv4_PID=/var/run/dhcpd.pid
DHCPDv6_PID=/var/run/dhcpd6.pid
INTERFACESv4="eth0"
INTERFACESv6="eth0"
....................
edit configuration
# vi /etc/dhcp/dhcpd.conf
....................
option domain-name "kali.test";
option domain-name-servers 8.8.8.8, 8.8.4.4;
subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.2 192.168.100.20;
}
....................
# vi /etc/dhcp/dhcpd.conf
....................
subnet6 fd01:307:406:909:100::/64 {
range6 fd01:307:406:909:100::2 fd01:307:406:909:100::20;
}
....................
Touch dhcp6 lease file (0644)
# touch /var/lib/dhcp/dhcp6.leases
Set address on eth0
## ip addr add 192.168.100.1/24 brd + dev eth0
## ip addr add fd01:307:406:909:100::1/64 dev eth0
# nmcli c m "Wired connection 1" ipv4.method manual ipv4.addresses "192.168.100.1/24" ipv6.method manual ipv6.address "fd01:307:406:909:100::1/64"
# service isc-dhcp-server start
OR
# systemctl start isc-dhcp-server
If errors, check journal
# journalctl -xe
+================================================================+
| IPv6 structure |
|================================================================|
| 7 bits |1| 40 bits | 16 bits | 64 bits |
+--------+-+------------+-----------+----------------------------+
| Prefix |L| Global ID | Subnet ID | Interface ID |
+--------+-+------------+-----------+----------------------------+
Unique Unicast fc00::/7
Prefix/L: fd
Global ID: 0103070406
Subnet ID: 0909
Combined/CID: fd01:0307:0406:0909:0100::/64
IPv6 addresses: fd01:0307:0406:0909:0100:xxxx:xxxx:xxxx:xxxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment