From f61e1d721b1fc75656186b2f8277c8c7b3341676 Mon Sep 17 00:00:00 2001 From: Marco Platania Date: Tue, 29 Aug 2017 18:15:49 -0400 Subject: Install vDNS, vAAA and vDHCP services in vCPE - Bind as vDNS - FreeRADIUS as vAAA - KEA-DHCP-SERVER as vDHCP Change-Id: I9a54add31542c075163bf946f475a184e14600aa Issue-ID: INT-84 Signed-off-by: Marco Platania --- vnfs/vCPE/scripts/kea-dhcp4.conf | 2 +- vnfs/vCPE/scripts/kea-dhcp4_no_hook.conf | 59 ++++++++++++++++++++++++++++++++ vnfs/vCPE/scripts/v_aaa_install.sh | 3 ++ vnfs/vCPE/scripts/v_dhcp_install.sh | 2 +- vnfs/vCPE/scripts/v_dns_init.sh | 3 ++ vnfs/vCPE/scripts/v_dns_install.sh | 10 ++++-- 6 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 vnfs/vCPE/scripts/kea-dhcp4_no_hook.conf (limited to 'vnfs/vCPE') diff --git a/vnfs/vCPE/scripts/kea-dhcp4.conf b/vnfs/vCPE/scripts/kea-dhcp4.conf index fa53f3c5..62b77e29 100644 --- a/vnfs/vCPE/scripts/kea-dhcp4.conf +++ b/vnfs/vCPE/scripts/kea-dhcp4.conf @@ -36,7 +36,7 @@ "next-server": "10.3.0.1", "option-data": [ {"name": "tftp-server-name", - "data": "10.4.0.1"}, + "data": "10.3.0.1"}, {"name": "boot-file-name", "data": "/dev/null"} ] diff --git a/vnfs/vCPE/scripts/kea-dhcp4_no_hook.conf b/vnfs/vCPE/scripts/kea-dhcp4_no_hook.conf new file mode 100644 index 00000000..3e2287d1 --- /dev/null +++ b/vnfs/vCPE/scripts/kea-dhcp4_no_hook.conf @@ -0,0 +1,59 @@ +{ +"Dhcp4": + { +# For testing, you can use veth pair as described in README.md + "interfaces-config": { + "interfaces": ["eth0" ] + }, + + "lease-database": { + "type": "memfile" + }, + + "expired-leases-processing": { + "reclaim-timer-wait-time": 10, + "flush-reclaimed-timer-wait-time": 25, + "hold-reclaimed-time": 3600, + "max-reclaim-leases": 100, + "max-reclaim-time": 250, + "unwarned-reclaim-cycles": 5 + }, + + "valid-lifetime": 300, + +# Ensure you set some sensible defaults for the siaddr and option-data, +# otherwise the options won't be added at all. +# Also keep in mind that if kea doesn't receive the desired values for some +# reason, these values will be sent to the client. + "subnet4": [ + { "subnet": "10.2.0.0/24", + "pools" : [ { "pool": "10.2.0.2 - 10.2.0.255"} ], + "next-server": "10.2.0.1", + "option-data": [ + {"name": "tftp-server-name", + "data": "10.2.0.1"}, + {"name": "boot-file-name", + "data": "/dev/null"} + ] + } + ] + +}, + +"Logging": +{ + "loggers": [ + { + "name": "kea-dhcp4", + "output_options": [ + { + "output": "/var/log/kea-dhcp4.log" + } + ], + "severity": "DEBUG", + "debuglevel": 0 + }, + ] +} + +} diff --git a/vnfs/vCPE/scripts/v_aaa_install.sh b/vnfs/vCPE/scripts/v_aaa_install.sh index a4a34aca..5505d1cb 100644 --- a/vnfs/vCPE/scripts/v_aaa_install.sh +++ b/vnfs/vCPE/scripts/v_aaa_install.sh @@ -62,6 +62,9 @@ chmod +x v_aaa.sh mv v_aaa.sh /etc/init.d update-rc.d v_aaa.sh defaults +# Download and install FreeRADIUS as AAA server +apt-get install -y freeradius + # Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes if [[ $CLOUD_ENV != "rackspace" ]] then diff --git a/vnfs/vCPE/scripts/v_dhcp_install.sh b/vnfs/vCPE/scripts/v_dhcp_install.sh index f9ea25b7..c8c567d3 100644 --- a/vnfs/vCPE/scripts/v_dhcp_install.sh +++ b/vnfs/vCPE/scripts/v_dhcp_install.sh @@ -54,7 +54,7 @@ apt-get update apt-get install -y wget openjdk-8-jdk apt-transport-https ca-certificates kea-dhcp4-server g++ libcurl4-gnutls-dev libboost-dev kea-dev sleep 1 -# download the kea hook +# Download the kea hook cd /opt wget $REPO_URL_ARTIFACTS/org/onap/demo/vnf/vcpe/kea-sdnc-notify-mod/$DEMO_ARTIFACTS_VERSION/kea-sdnc-notify-mod-$DEMO_ARTIFACTS_VERSION-demo.tar.gz tar -zxvf kea-sdnc-notify-mod-$DEMO_ARTIFACTS_VERSION-demo.tar.gz diff --git a/vnfs/vCPE/scripts/v_dns_init.sh b/vnfs/vCPE/scripts/v_dns_init.sh index a9bf588e..dd85a92d 100644 --- a/vnfs/vCPE/scripts/v_dns_init.sh +++ b/vnfs/vCPE/scripts/v_dns_init.sh @@ -1 +1,4 @@ #!/bin/bash + +service kea-dhcp4-server start +service bind9 restart \ No newline at end of file diff --git a/vnfs/vCPE/scripts/v_dns_install.sh b/vnfs/vCPE/scripts/v_dns_install.sh index 02ab69bf..426af3b5 100644 --- a/vnfs/vCPE/scripts/v_dns_install.sh +++ b/vnfs/vCPE/scripts/v_dns_install.sh @@ -50,18 +50,24 @@ fi # Download required dependencies add-apt-repository -y ppa:openjdk-r/ppa apt-get update -apt-get install -y wget openjdk-8-jdk apt-transport-https ca-certificates g++ libcurl4-gnutls-dev +apt-get install -y wget openjdk-8-jdk bind9 bind9utils bind9-doc apt-transport-https ca-certificates kea-dhcp4-server g++ libcurl4-gnutls-dev libboost-dev kea-dev sleep 1 -# Download DHCP config files +# Download DNS and DHCP config files cd /opt +wget $REPO_URL_BLOB/org.onap.demo/vnfs/vcpe/$INSTALL_SCRIPT_VERSION/kea-dhcp4_no_hook.conf wget $REPO_URL_BLOB/org.onap.demo/vnfs/vcpe/$INSTALL_SCRIPT_VERSION/v_dns_init.sh wget $REPO_URL_BLOB/org.onap.demo/vnfs/vcpe/$INSTALL_SCRIPT_VERSION/v_dns.sh +mv kea-dhcp4_no_hook.conf /etc/kea/kea-dhcp4.conf chmod +x v_dns_init.sh chmod +x v_dns.sh mv v_dns.sh /etc/init.d update-rc.d v_dns.sh defaults +# Install Bind +mkdir /etc/bind/zones +sed -i "s/OPTIONS=.*/OPTIONS=\"-4 -u bind\"/g" /etc/default/bind9 + # Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes if [[ $CLOUD_ENV != "rackspace" ]] then -- cgit 1.2.3-korg