From 93d9f376bfbd11f7583ac75eff409967aee049ec Mon Sep 17 00:00:00 2001 From: Brian Freeman Date: Wed, 5 Dec 2018 13:37:37 -0500 Subject: [PATCH] Add demo to vCPE Public DNS Issue-ID: INT-755 Change-Id: I660c964cff60c33ae3f3c4aa9b47d2960789ea43 Signed-off-by: Brian Freeman --- vnfs/vCPE/scripts/db_demo_onap_org | 15 ++++++++++++++ vnfs/vCPE/scripts/named.conf.local | 12 +++++++++++ vnfs/vCPE/scripts/named.conf.options | 39 ++++++++++++++++++++++++++++++++++++ vnfs/vCPE/scripts/v_dns_install.sh | 9 ++++++++- 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 vnfs/vCPE/scripts/db_demo_onap_org create mode 100644 vnfs/vCPE/scripts/named.conf.local create mode 100644 vnfs/vCPE/scripts/named.conf.options diff --git a/vnfs/vCPE/scripts/db_demo_onap_org b/vnfs/vCPE/scripts/db_demo_onap_org new file mode 100644 index 00000000..621dbd51 --- /dev/null +++ b/vnfs/vCPE/scripts/db_demo_onap_org @@ -0,0 +1,15 @@ +; +; BIND data file for local loopback interface +; +$TTL 604800 +@ IN SOA demo.onap.org. admin.demo.onap.org. ( + 3 ; Serial + 604800 ; Refresh + 86400 ; Retry + 2419200 ; Expire + 604800 ) ; Negative Cache TTL +; name servers - NS records + IN NS demo.onap.org. +; name servers - A records +demo.onap.org. IN A 10.2.0.1 +www.demo.onap.org. IN A 10.2.0.10 diff --git a/vnfs/vCPE/scripts/named.conf.local b/vnfs/vCPE/scripts/named.conf.local new file mode 100644 index 00000000..fb3e5b57 --- /dev/null +++ b/vnfs/vCPE/scripts/named.conf.local @@ -0,0 +1,12 @@ +// +// Do any local configuration here +// + +// Consider adding the 1918 zones here, if they are not used in your +// organization +//include "/etc/bind/zones.rfc1918"; + +zone "demo.onap.org" { + type master; + file "/etc/bind/zones/db.demo.onap.org"; # zone file path +}; diff --git a/vnfs/vCPE/scripts/named.conf.options b/vnfs/vCPE/scripts/named.conf.options new file mode 100644 index 00000000..1daa65c3 --- /dev/null +++ b/vnfs/vCPE/scripts/named.conf.options @@ -0,0 +1,39 @@ +acl "trusted" { + x.x.x.x; +}; +options { + directory "/var/cache/bind"; + + recursion no; # enables recursive queries + allow-recursion { trusted; }; # allows recursive queries from "trusted” clients i.e. LB only + listen-on { x.x.x.x; }; # ns1 IP address - listen on this address only + allow-transfer { none; }; # disable zone transfers by default + + forwarders { + 8.8.8.8; + 8.8.4.4; + }; + + + // If there is a firewall between you and nameservers you want + // to talk to, you may need to fix the firewall to allow multiple + // ports to talk. See http://www.kb.cert.org/vuls/id/800113 + + // If your ISP provided one or more IP addresses for stable + // nameservers, you probably want to use them as forwarders. + // Uncomment the following block, and insert the addresses replacing + // the all-0's placeholder. + + // forwarders { + // 0.0.0.0; + // }; + + //======================================================================== + // If BIND logs error messages about the root key being expired, + // you will need to update your keys. See https://www.isc.org/bind-keys + //======================================================================== + dnssec-validation auto; + + auth-nxdomain no; # conform to RFC1035 + listen-on-v6 { any; }; +}; diff --git a/vnfs/vCPE/scripts/v_dns_install.sh b/vnfs/vCPE/scripts/v_dns_install.sh index 81669d1b..dfb0e085 100644 --- a/vnfs/vCPE/scripts/v_dns_install.sh +++ b/vnfs/vCPE/scripts/v_dns_install.sh @@ -68,6 +68,13 @@ 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 +mv db_demo_onap_org /etc/bind/zones/db.demo.onap.org +mv named.conf.options /etc/bind/ +mv named.conf.local /etc/bind/ +CPE_PUBLIC_IP=$(cat /opt/config/cpe_public_net_ipaddr.txt) +sed -i "s/x.x.x.x/"$CPE_PUBLIC_IP"/g" /etc/bind/named.conf.options +sleep 1 + # Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes if [[ $CLOUD_ENV != "rackspace" ]] @@ -81,4 +88,4 @@ then reboot fi -./v_dns_init.sh \ No newline at end of file +./v_dns_init.sh -- 2.16.6