aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/vCPE/kea-sdnc-notify-mod/README.md
blob: cee910734fc78e1d2b77d96b8a9c94255a537c1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #75715e } /* Generic.Subheading */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef } /* Keyword.Type */
.highlight .ld { color: #e6db74 } /* Literal.Date */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Attribute */
.highlight .nb { colo
#
# kea-sdnc-notify-mod

Kea module utilizing hooks api to notify SDNC of macaddr, yiaddr, dhcp-msg-name via HTTP POST request.

# ONAP installation of vDHCP will intall and configure on the vDHCP VM
#
# for local development/testing follow these steps.
#

#
# install kea on ubuntu
apt-get install  kea-dhcp4-server


#
# Usage
Install the compiled library from the ./build direction to  /usr/local/lib/kea-sdnc-notify.so

Configure /etc/kea/kea-sdnc-notify.conf using the ./etc example

Configure /etc/kea/kea-dhcp4.conf usign the ./etc example

The hook will POST json from the the variables from the DHCP Acknowledgement message to the SDNC "url" in the form of "url+macaddr"
"url": "http://localhost/sdnc.php?macaddr="

Example: http://localhost/sdnc.php?macaddr=aa:bb:cc:dd:ee:ff

In the ONAP installation instead of localhost it will be to either a DMaaP Topic or to SDNC directly.


## START DHCP
[as root]
cd /etc/init.d 
./kea-dhcp4-server start or
./kea-dhcp4-server restart 

./kea-dhcp4-server stop 

## logs are in 
/var/log/kea-dhcp4.log

## Build requirements
This software has been developed on Ubuntu 16.04.  

apt-get install g++ libcurl4-gnutls-dev libboost-dev kea-dev

./build.sh

## Intallation in  ONAP
The vdhcp install scripts for ONAP will do the build on the vDHCP VM from these source files and copy the resulting library into /usr/local/lib and the configuration files into /etc/kea

## Testing locally

#### USE THIS ON OPENSTACK UBUNTU 16.04 GUEST VM

Create a veth pair:

ip link add veth0 type veth peer name veth1

ip link set veth0 up && ip link set veth1 up

ip address add dev veth0 10.3.0.1/24

dhclient -d -v veth1

dhclient -d -v veth1 -r (to release)