ISC-Kea DHCP Simple Cluster Build

ISC-Kea DHCP Simple Cluster Build

A quick and easy ISC-Kea DHCP HA cluster built on Debian Linux

Perquisites

  • 2 hosts physical or virtual
  • Debian Linux 11 Deployed
  • SSH access enabled for implementation

Topology Diagram

Kea Package Installation For Host 1 and 2

apt-get update -y $$ apt-get upgrade -y
apt-get install net-tools bind9 ntp nano htop iftop curl -y
curl -1sLf 'https://dl.cloudsmith.io/public/isc/kea-2-4/setup.deb.sh' | bash
apt-get install isc-kea -y

Kea-Host1 CTR Agent Configuration

File Location:- /etc/kea/kea-ctrl-agent.conf

 { "Control-agent": { "http-host": "192.168.1.10", "http-port": 8000, "control-sockets": { "dhcp4": { "comment": "socket to DHCP4 server", "socket-type": "unix", "socket-name": "/tmp/kea4-ctrl-socket" }, "dhcp6": { "socket-type": "unix", "socket-name": "/tmp/kea6-ctrl-socket" }, "d2": { "socket-type": "unix", "socket-name": "/tmp/kea-ddns-ctrl-socket", "user-context": { "in-use": false } } }, "loggers": [ { "name": "kea-ctrl-agent", "output_options": [ { "output": "stdout", } ], "severity": "DEBUG" } ] } } 

Kea-Host1 DHCP Configuration

File Location:- /etc/kea/kea-dhcp4.conf

 { "Dhcp4": { "interfaces-config": { "interfaces": [ "enp2s0" ] }, "control-socket": { "socket-type": "unix", "socket-name": "/tmp/kea4-ctrl-socket" }, "lease-database": { "type": "memfile" }, "valid-lifetime": 43200, // leases will be valid for 12h "renew-timer": 21600, // clients should renew every 6h "rebind-timer": 32400, // clients should start looking for other servers after 9h "expired-leases-processing": { "reclaim-timer-wait-time": 3600, "hold-reclaimed-time": 172800, "max-reclaim-leases": 0, "max-reclaim-time": 0 }, "hooks-libraries": [ { "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_lease_cmds.so" }, { "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_ha.so", "parameters": { "high-availability": [ { "this-server-name": "kea-host1", "mode": "hot-standby", "heartbeat-delay": 10000, "max-response-delay": 60000, "max-ack-delay": 5000, "max-unacked-clients": 5, "sync-timeout": 60000, "peers": [ { "name": "server1", "url": "http://192.168.1.10:8000/", "role": "primary" }, { "name": "server2", "url": "http://192.168.1.12:8000/", "role": "standby" } ] } ] } } ], "subnet1": [ { "subnet": "192.168.1.0/24", "id": 103444, "interface": "enp2s0", "pools": [ { "pool": "192.168.1.50-192.168.1.254" } ], "option-data": [ { "name": "routers", "data": "192.168.1.1" }, { "name": "domain-name-servers", "data": "8.8.8.8,1.1.1.1", "always-send": true }, { "name": "domain-name", "data": "gatanet.ro" }, { "name": "domain-search", "data": "gatanet.ro" }, { "name": "ntp-servers", "data": "192.168.1.10,192.168.1.12", "always-send": true } ] } ], "loggers": [ { "name": "kea-dhcp4", "output_options": [ { "output": "stdout", } ], "severity": "DEBUG" } ] } } 

Kea-Host2 CTR Agent Configuration

File Location:- /etc/kea/kea-ctrl-agent.conf

 { "Control-agent": { "http-host": "192.168.1.12", "http-port": 8000, "control-sockets": { "dhcp4": { "comment": "socket to DHCP4 server", "socket-type": "unix", "socket-name": "/tmp/kea4-ctrl-socket" }, "dhcp6": { "socket-type": "unix", "socket-name": "/tmp/kea6-ctrl-socket" }, "d2": { "socket-type": "unix", "socket-name": "/tmp/kea-ddns-ctrl-socket", "user-context": { "in-use": false } } }, "loggers": [ { "name": "kea-ctrl-agent", "output_options": [ { "output": "stdout", } ], "severity": "DEBUG" } ] } } 

Kea-Host1 DHCP Configuration

File Location:- /etc/kea/kea-dhcp4.conf

 { "Dhcp4": { "interfaces-config": { "interfaces": [ "enp2s0" ] }, "control-socket": { "socket-type": "unix", "socket-name": "/tmp/kea4-ctrl-socket" }, "lease-database": { "type": "memfile" }, "valid-lifetime": 43200, // leases will be valid for 12h "renew-timer": 21600, // clients should renew every 6h "rebind-timer": 32400, // clients should start looking for other servers after 9h "expired-leases-processing": { "reclaim-timer-wait-time": 3600, "hold-reclaimed-time": 172800, "max-reclaim-leases": 0, "max-reclaim-time": 0 }, "hooks-libraries": [ { "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_lease_cmds.so" }, { "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_ha.so", "parameters": { "high-availability": [ { "this-server-name": "kea-host2", "mode": "hot-standby", "heartbeat-delay": 10000, "max-response-delay": 60000, "max-ack-delay": 5000, "max-unacked-clients": 5, "sync-timeout": 60000, "peers": [ { "name": "server1", "url": "http://192.168.1.10:8000/", "role": "primary" }, { "name": "server2", "url": "http://192.168.1.12:8000/", "role": "standby" } ] } ] } } ], "subnet1": [ { "subnet": "192.168.1.0/24", "id": 103444, "interface": "enp2s0", "pools": [ { "pool": "192.168.1.50-192.168.1.254" } ], "option-data": [ { "name": "routers", "data": "192.168.1.1" }, { "name": "domain-name-servers", "data": "8.8.8.8,1.1.1.1", "always-send": true }, { "name": "domain-name", "data": "gatanet.ro" }, { "name": "domain-search", "data": "gatanet.ro" }, { "name": "ntp-servers", "data": "192.168.1.10,192.168.1.12", "always-send": true } ] } ], "loggers": [ { "name": "kea-dhcp4", "output_options": [ { "output": "stdout", } ], "severity": "DEBUG" } ] } } 
Zabbix: Define Maintenance Windows

Zabbix: Define Maintenance Windows

We have all been there when backups run in your environment and the monitoring solution go crazy with alerts for a few minutes generating a large amount of noise that you have to clear down. Well here is a quick simple guide on configuring maintenance windows for your regularly scheduled backup and patch windows

  • Go to: Configuration → Maintenance
  • Click on Create maintenance period (or on the name of an existing maintenance period)
  • define general maintenance period attributes
    • Name
      • Name of the maintenance period.
    • Maintenance type
    • Two types of maintenance can be set:
      • With data collection
        • data will be collected by the server during maintenance, triggers will be processed
      • No data collection
        • data will not be collected by the server during maintenance
    • Active since
      • The date and time when executing maintenance periods becomes active.
    • Active till
      • The date and time when executing maintenance periods stops being active.
    • Description Description of maintenance period.
  • define you maintenance periods in the periods tab
  • select your hosts and groups the attach the maintenance period too

ProxMox: KVM VM Import

ProxMox: KVM VM Import

Qemu/KVM

Create an new VM on Proxmox VE and add the existing disk image to this new VM, set the boot order and start.

Minimal example

First a VM has to be created. 120 is an unused VM ID.

qm create 120 --bootdisk scsi0 

someImage.img is an image that was created before. someStorage is the name of a storage as listed in pvesm status.

qm importdisk 120 someImage.img someStorage

qm importdisk adds the image as unused disk to the virtual machine. Thus, making it the bootdisk is still necessary.

qm set 120 --scsi0 someStorage:vm-120-disk-0

RHEL: PTP Clock Sync Implementation

RHEL: PTP Clock Sync Implementation

a quick guide to show you how to implement PTP using the following applications

  • ptp4l
  • pmc
  • phc2sys
  • timemaster
 # ========================================================= # Download and Install Linux PTP from the centos repo # ========================================================= wget http://mirror.centos.org/centos/6/os/x86_64/Packages/linuxptp-1.5-2.el6.x86_64.rpm && rpm -i linuxptp-1.5-2.el6.x86_64.rpm --nosignature # ========================================================= # Build Configuration File For PTP4L # ========================================================= echo " [global] verbose 1 use_syslog	1 delay_mechanism	Auto summary_interval 10 time_stamping hardware priority1 128 slaveOnly	1 network_transport UDPv4 summary_interval 1 domainNumber 0 [eth0] " > /etc/ptp4l.conf cat /etc/ptp4l.conf echo " OPTIONS="-f /etc/ptp4l.conf" " > /etc/sysconfig/ptp4l cat /etc/sysconfig/ptp4l # ========================================================= # Build Configuration File For PHC2sys # ========================================================= echo " OPTIONS="-s /dev/ptp0 -w -m -r" " > /etc/sysconfig/phc2sys cat /etc/sysconfig/phc2sys # ========================================================= # Build Configuration File For Time Master # ========================================================= echo " #[ntp_server ntp-server.local] #minpoll 4 #maxpoll 4 [ptp_domain 0] interfaces eth-ran #[timemaster] #ntp_program chronyd #[chrony.conf] #include /etc/chrony.conf #[ntp.conf] #includefile /etc/ntp.conf [ptp4l.conf] #[chronyd] #path /usr/sbin/chronyd #options -u chrony #[ntpd] #path /usr/sbin/ntpd #options -u ntp:ntp -g [phc2sys] path /usr/sbin/phc2sys [ptp4l] path /usr/sbin/ptp4l " > /etc/timemaster.conf cat /etc/timemaster.conf # ========================================================= # Kill Conflicting Proceses # ========================================================= killall chronyd killall ptp4l killall phc2sys # ========================================================= # Stop and Disable all time PTP related services # ========================================================= systemctl stop ptp4l systemctl stop phc2sys systemctl stop chronyd systemctl disable ptp4l systemctl disable phc2sys systemctl disable chronyd # ========================================================= # Configure System Clock to not use NTP and set TimeZone # ========================================================= timedatectl set-ntp false timedatectl set-timezone UTC # ========================================================= # Start Services and enable them for autostart on boot # ========================================================= systemctl start timemaster systemctl enable timemaster