From 579bc2fc74a764a149afa30291d734f6ebe18b94 Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Tue, 21 Aug 2018 15:19:11 +0200 Subject: examples/ncclient: update readme with example Change-Id: Id5aa173292d00aee0dd37d0853d46cb98e2cce05 Signed-off-by: Marek Gradzki --- examples/ncclient/Readme.adoc | 51 +++-- examples/ncclient/acl/config_acl.xml | 185 ++++++++++++++++++ examples/ncclient/acl/config_acl_update.xml | 212 +++++++++++++++++++++ examples/ncclient/acl/config_invalid_acl.xml | 15 ++ examples/ncclient/acl/copy_config_acl.xml | 185 ------------------ examples/ncclient/acl/copy_config_acl_update.xml | 212 --------------------- .../acl/copy_config_unsupported-acl-type.xml | 15 -- examples/ncclient/acl/test_acl.sh | 2 +- examples/ncclient/acl/test_acl_update.sh | 4 +- examples/ncclient/acl/test_invalid_acl.sh | 18 -- examples/ncclient/nat/config_nat.xml | 84 ++++++++ examples/ncclient/nat/config_nat_update.xml | 105 ++++++++++ examples/ncclient/nat/copy_config_nat.xml | 84 -------- examples/ncclient/nat/copy_config_nat_update.xml | 105 ---------- examples/ncclient/nat/test_nat.sh | 2 +- examples/ncclient/nat/test_nat_update.sh | 4 +- 16 files changed, 647 insertions(+), 636 deletions(-) create mode 100644 examples/ncclient/acl/config_acl.xml create mode 100644 examples/ncclient/acl/config_acl_update.xml create mode 100644 examples/ncclient/acl/config_invalid_acl.xml delete mode 100644 examples/ncclient/acl/copy_config_acl.xml delete mode 100644 examples/ncclient/acl/copy_config_acl_update.xml delete mode 100644 examples/ncclient/acl/copy_config_unsupported-acl-type.xml delete mode 100755 examples/ncclient/acl/test_invalid_acl.sh create mode 100644 examples/ncclient/nat/config_nat.xml create mode 100644 examples/ncclient/nat/config_nat_update.xml delete mode 100644 examples/ncclient/nat/copy_config_nat.xml delete mode 100644 examples/ncclient/nat/copy_config_nat_update.xml diff --git a/examples/ncclient/Readme.adoc b/examples/ncclient/Readme.adoc index cc1d63e12..ec856c6a3 100644 --- a/examples/ncclient/Readme.adoc +++ b/examples/ncclient/Readme.adoc @@ -24,22 +24,42 @@ git fetch https://git.opendaylight.org/gerrit/netconf refs/changes/81/71181/1 && mvn clean install -pl netconf/netconf-util,netconf/netconf-netty-util,netconf/mdsal-netconf-connector ---- -== Custom HC2VPP build +=== support: [source] ---- -git clone https://gerrit.fd.io/r/hc2vpp -cd hc2vpp +git fetch https://git.opendaylight.org/gerrit/netconf refs/changes/56/72756/4 && git cherry-pick FETCH_HEAD +git fetch https://git.opendaylight.org/gerrit/netconf refs/changes/34/73034/2 && git cherry-pick FETCH_HEAD +git fetch https://git.opendaylight.org/gerrit/netconf refs/changes/95/74795/3 && git cherry-pick FETCH_HEAD +mvn clean install -pl netconf/mdsal-netconf-connector ---- -1. Checkout desired branch or use master branch, e.g. +== Custom Honeycomb build + +Clone project, checkout desired branch or use master branch: [source] ---- -git checkout -b stable1804 origin/stable/1804 +git clone https://gerrit.fd.io/r/honeycomb +cd honeycomb ---- -2. Build vpp-integration module from hc2vpp project: +=== support: +[source] +---- +git fetch ssh://mgradzki@gerrit.fd.io:29418/honeycomb refs/changes/40/14040/3 && git cherry-pick FETCH_HEAD +mvn clean install -pl infra/data-impl +---- + +== Custom HC2VPP build +1. Clone project, checkout desired branch or use master branch: +[source] +---- +git clone https://gerrit.fd.io/r/hc2vpp +cd hc2vpp +---- + +2. Build vpp-integration module from hc2vpp project: [source] ---- mvn clean install -pl vpp-integration/minimal-distribution @@ -67,21 +87,30 @@ Start vpp. Start honeycomb (either from hc2vpp builddir or using package built in previous steps). -Then invoke: +NOTE: Remember that HC by default persists config and restores it after restart. +You can disable this behaviour using config/honeycomb.json. + +== examples -ACL: +=== ACL [source] ---- ./acl/test_acl.sh ./acl/test_acl_updates.sh ---- -NAT: +=== NAT [source] ---- ./acl/test_nat.sh ./acl/test_nat_updates.sh ---- -NOTE: Remember that HC by default persists config and restores it after restart. -You can disable this behaviour using config/honeycomb.json. +== examples + +== ACL + +[source] +---- +./edit_config.py --validate acl/config_invalid_acl.xml +---- + diff --git a/examples/ncclient/acl/config_acl.xml b/examples/ncclient/acl/config_acl.xml new file mode 100644 index 000000000..164fd5aaa --- /dev/null +++ b/examples/ncclient/acl/config_acl.xml @@ -0,0 +1,185 @@ + + + + + + 0 + + 0 + + + + + + + local0 + x:ethernetCsmacd + false + + + loop1 + for testing purposes + x:loopback + + 00:ff:ff:ff:ff:ff + + + + + x:vpp-acl + tcp-acl + + + x:vpp-acl + udp-acl + + + x:vpp-macip-acl + macip-acl + + + + + + + + macip-acl + x:vpp-macip-acl + + + macip-rule + + + 192.168.2.2/32 + aa:aa:aa:aa:aa:aa + ff:00:00:00:00:00 + + + + + + + + + + icmp-v6-acl + x:vpp-acl + + + imcp-v6-rule + + + 2001:0db8:0a0b:12f0:0000:0000:0000:0001/64 + 2001:0db8:0a0b:12f0:0000:0000:0000:0002/48 + + + 8 + 5 + + + 3 + 1 + + + + + + + + + + + + udp-acl + x:vpp-acl + + + udp-rule + + + 192.168.2.1/24 + 192.168.2.2/32 + + + 5487 + 1 + + + 6745 + 87 + + + + + + + + + + + + tcp-acl + x:vpp-acl + + + tcp-rule + + + 192.168.2.1/24 + 192.168.2.2/32 + + + 5487 + 1 + + + 6745 + 87 + + 1 + 7 + + + + + + + + + + + icmp-acl + x:vpp-acl + + + imcp-rule + + + 192.168.2.1/24 + 192.168.2.2/32 + + + 8 + 5 + + + 3 + 1 + + + + + + + + + + + + diff --git a/examples/ncclient/acl/config_acl_update.xml b/examples/ncclient/acl/config_acl_update.xml new file mode 100644 index 000000000..5b99994c3 --- /dev/null +++ b/examples/ncclient/acl/config_acl_update.xml @@ -0,0 +1,212 @@ + + + + + + 0 + + 0 + + + + + + + local0 + x:ethernetCsmacd + false + + + loop1 + for testing purposes + x:loopback + + 00:ff:ff:ff:ff:ff + + + + + x:vpp-macip-acl + macip-acl + + + + + + loop2 + for testing purposes + x:loopback + + aa:ff:ff:ff:ff:ff + + + + + x:vpp-acl + tcp-acl2 + + + x:vpp-acl + udp-acl + + + + + + + + macip-acl + x:vpp-macip-acl + + + macip-rule + + + 192.168.2.2/32 + aa:aa:aa:aa:aa:aa + ff:00:00:00:00:00 + + + + + + + + + + icmp-v6-acl + x:vpp-acl + + + imcp-v6-rule + + + 2001:0db8:0a0b:12f0:0000:0000:0000:0001/64 + + 2001:0db8:0a0b:12f0:0000:0000:0000:0002/48 + + + 8 + 5 + + + 3 + 1 + + + + + + + + + + + + udp-acl + x:vpp-acl + + + udp-rule + + + 192.168.2.1/24 + 192.168.2.2/32 + + + 5486 + 11 + + + + + + + + + + + + tcp-acl2 + x:vpp-acl + + + tcp-rule + + + 192.168.2.1/24 + 192.168.2.2/32 + + + 5487 + 1 + + + 6745 + 87 + + 1 + 7 + + + + + + + + + + + icmp-acl + x:vpp-acl + + + renamed-imcp-rule + + + 192.168.2.1/24 + 192.168.2.2/32 + + + 8 + 5 + + + 3 + 1 + + + + + + + + + + new-icmp-rule + + + 10.1.1.1/24 + 10.2.2.2/32 + + + 4 + 9 + + + + + + + + + + + + diff --git a/examples/ncclient/acl/config_invalid_acl.xml b/examples/ncclient/acl/config_invalid_acl.xml new file mode 100644 index 000000000..b86a11924 --- /dev/null +++ b/examples/ncclient/acl/config_invalid_acl.xml @@ -0,0 +1,15 @@ + + + + + acl0 + ipv4-acl + + + diff --git a/examples/ncclient/acl/copy_config_acl.xml b/examples/ncclient/acl/copy_config_acl.xml deleted file mode 100644 index 164fd5aaa..000000000 --- a/examples/ncclient/acl/copy_config_acl.xml +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - 0 - - 0 - - - - - - - local0 - x:ethernetCsmacd - false - - - loop1 - for testing purposes - x:loopback - - 00:ff:ff:ff:ff:ff - - - - - x:vpp-acl - tcp-acl - - - x:vpp-acl - udp-acl - - - x:vpp-macip-acl - macip-acl - - - - - - - - macip-acl - x:vpp-macip-acl - - - macip-rule - - - 192.168.2.2/32 - aa:aa:aa:aa:aa:aa - ff:00:00:00:00:00 - - - - - - - - - - icmp-v6-acl - x:vpp-acl - - - imcp-v6-rule - - - 2001:0db8:0a0b:12f0:0000:0000:0000:0001/64 - 2001:0db8:0a0b:12f0:0000:0000:0000:0002/48 - - - 8 - 5 - - - 3 - 1 - - - - - - - - - - - - udp-acl - x:vpp-acl - - - udp-rule - - - 192.168.2.1/24 - 192.168.2.2/32 - - - 5487 - 1 - - - 6745 - 87 - - - - - - - - - - - - tcp-acl - x:vpp-acl - - - tcp-rule - - - 192.168.2.1/24 - 192.168.2.2/32 - - - 5487 - 1 - - - 6745 - 87 - - 1 - 7 - - - - - - - - - - - icmp-acl - x:vpp-acl - - - imcp-rule - - - 192.168.2.1/24 - 192.168.2.2/32 - - - 8 - 5 - - - 3 - 1 - - - - - - - - - - - - diff --git a/examples/ncclient/acl/copy_config_acl_update.xml b/examples/ncclient/acl/copy_config_acl_update.xml deleted file mode 100644 index 5b99994c3..000000000 --- a/examples/ncclient/acl/copy_config_acl_update.xml +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - 0 - - 0 - - - - - - - local0 - x:ethernetCsmacd - false - - - loop1 - for testing purposes - x:loopback - - 00:ff:ff:ff:ff:ff - - - - - x:vpp-macip-acl - macip-acl - - - - - - loop2 - for testing purposes - x:loopback - - aa:ff:ff:ff:ff:ff - - - - - x:vpp-acl - tcp-acl2 - - - x:vpp-acl - udp-acl - - - - - - - - macip-acl - x:vpp-macip-acl - - - macip-rule - - - 192.168.2.2/32 - aa:aa:aa:aa:aa:aa - ff:00:00:00:00:00 - - - - - - - - - - icmp-v6-acl - x:vpp-acl - - - imcp-v6-rule - - - 2001:0db8:0a0b:12f0:0000:0000:0000:0001/64 - - 2001:0db8:0a0b:12f0:0000:0000:0000:0002/48 - - - 8 - 5 - - - 3 - 1 - - - - - - - - - - - - udp-acl - x:vpp-acl - - - udp-rule - - - 192.168.2.1/24 - 192.168.2.2/32 - - - 5486 - 11 - - - - - - - - - - - - tcp-acl2 - x:vpp-acl - - - tcp-rule - - - 192.168.2.1/24 - 192.168.2.2/32 - - - 5487 - 1 - - - 6745 - 87 - - 1 - 7 - - - - - - - - - - - icmp-acl - x:vpp-acl - - - renamed-imcp-rule - - - 192.168.2.1/24 - 192.168.2.2/32 - - - 8 - 5 - - - 3 - 1 - - - - - - - - - - new-icmp-rule - - - 10.1.1.1/24 - 10.2.2.2/32 - - - 4 - 9 - - - - - - - - - - - - diff --git a/examples/ncclient/acl/copy_config_unsupported-acl-type.xml b/examples/ncclient/acl/copy_config_unsupported-acl-type.xml deleted file mode 100644 index b86a11924..000000000 --- a/examples/ncclient/acl/copy_config_unsupported-acl-type.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - acl0 - ipv4-acl - - - diff --git a/examples/ncclient/acl/test_acl.sh b/examples/ncclient/acl/test_acl.sh index aedb842af..e55296ebd 100755 --- a/examples/ncclient/acl/test_acl.sh +++ b/examples/ncclient/acl/test_acl.sh @@ -15,4 +15,4 @@ DIR_NAME=$(dirname $0) -${DIR_NAME}/../test_copy_config.sh ${DIR_NAME}/copy_config_acl.xml ${DIR_NAME}/expected_config_acl.xml +${DIR_NAME}/../test_copy_config.sh ${DIR_NAME}/config_acl.xml ${DIR_NAME}/expected_config_acl.xml diff --git a/examples/ncclient/acl/test_acl_update.sh b/examples/ncclient/acl/test_acl_update.sh index 6dedbfeaa..cb62c183e 100755 --- a/examples/ncclient/acl/test_acl_update.sh +++ b/examples/ncclient/acl/test_acl_update.sh @@ -15,6 +15,6 @@ DIR_NAME=$(dirname $0) -${DIR_NAME}/../test_copy_config.sh ${DIR_NAME}/copy_config_acl.xml ${DIR_NAME}/expected_config_acl.xml +${DIR_NAME}/../test_copy_config.sh ${DIR_NAME}/config_acl.xml ${DIR_NAME}/expected_config_acl.xml -${DIR_NAME}/../test_copy_config.sh ${DIR_NAME}/copy_config_acl_update.xml ${DIR_NAME}/expected_config_acl_update.xml +${DIR_NAME}/../test_copy_config.sh ${DIR_NAME}/config_acl_update.xml ${DIR_NAME}/expected_config_acl_update.xml diff --git a/examples/ncclient/acl/test_invalid_acl.sh b/examples/ncclient/acl/test_invalid_acl.sh deleted file mode 100755 index aedb842af..000000000 --- a/examples/ncclient/acl/test_invalid_acl.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2018 Cisco and/or its affiliates. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DIR_NAME=$(dirname $0) - -${DIR_NAME}/../test_copy_config.sh ${DIR_NAME}/copy_config_acl.xml ${DIR_NAME}/expected_config_acl.xml diff --git a/examples/ncclient/nat/config_nat.xml b/examples/ncclient/nat/config_nat.xml new file mode 100644 index 000000000..eb261f1d2 --- /dev/null +++ b/examples/ncclient/nat/config_nat.xml @@ -0,0 +1,84 @@ + + + + + local0 + x:ethernetCsmacd + false + + + loop1 + for testing purposes + x:loopback + + 01:ff:ff:ff:ff:ff + + + + true + + + + + loop0 + for testing purposes + x:loopback + + 00:ff:ff:ff:ff:ff + + + + true + false + + + + + + + + 0 + + 0 + + 2001:db8:122:300::/56 + + + 3 + 10.10.10.1/30 + nat64 + + + 2 + 172.16.2.123/32 + + + 1 + 172.16.2.0/30 + + + + + 1 + static + 6 + 10.1.1.3/32 + + 5678 + + 2001:db8:85a3::8a2e:370:7334/128 + + 1234 + + + + + + + diff --git a/examples/ncclient/nat/config_nat_update.xml b/examples/ncclient/nat/config_nat_update.xml new file mode 100644 index 000000000..7c8bd9b9b --- /dev/null +++ b/examples/ncclient/nat/config_nat_update.xml @@ -0,0 +1,105 @@ + + + + + local0 + x:ethernetCsmacd + false + + + loop1 + for testing purposes + x:loopback + + 01:ff:ff:ff:ff:ff + + + + loop2 + for testing purposes + x:loopback + + 02:ff:ff:ff:ff:ff + + + + true + false + + + + + loop3 + for testing purposes + x:loopback + + 03:ff:ff:ff:ff:ff + + + + true + + + + + loop0 + for testing purposes + x:loopback + + 00:ff:ff:ff:ff:ff + + + + + + + 0 + + 0 + + 2001:db8:122:300::/56 + + + 6 + 1.2.3.4/32 + nat64 + + + 5 + 172.16.2.0/30 + + + 3 + 10.10.10.1/30 + nat64 + + + 2 + 172.15.2.123/32 + + + + + 1 + static + 6 + 10.1.1.3/32 + + 5678 + + 2001:db8:85a3::8a2e:370:7334/128 + + 1234 + + + + + + + diff --git a/examples/ncclient/nat/copy_config_nat.xml b/examples/ncclient/nat/copy_config_nat.xml deleted file mode 100644 index eb261f1d2..000000000 --- a/examples/ncclient/nat/copy_config_nat.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - local0 - x:ethernetCsmacd - false - - - loop1 - for testing purposes - x:loopback - - 01:ff:ff:ff:ff:ff - - - - true - - - - - loop0 - for testing purposes - x:loopback - - 00:ff:ff:ff:ff:ff - - - - true - false - - - - - - - - 0 - - 0 - - 2001:db8:122:300::/56 - - - 3 - 10.10.10.1/30 - nat64 - - - 2 - 172.16.2.123/32 - - - 1 - 172.16.2.0/30 - - - - - 1 - static - 6 - 10.1.1.3/32 - - 5678 - - 2001:db8:85a3::8a2e:370:7334/128 - - 1234 - - - - - - - diff --git a/examples/ncclient/nat/copy_config_nat_update.xml b/examples/ncclient/nat/copy_config_nat_update.xml deleted file mode 100644 index 7c8bd9b9b..000000000 --- a/examples/ncclient/nat/copy_config_nat_update.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - local0 - x:ethernetCsmacd - false - - - loop1 - for testing purposes - x:loopback - - 01:ff:ff:ff:ff:ff - - - - loop2 - for testing purposes - x:loopback - - 02:ff:ff:ff:ff:ff - - - - true - false - - - - - loop3 - for testing purposes - x:loopback - - 03:ff:ff:ff:ff:ff - - - - true - - - - - loop0 - for testing purposes - x:loopback - - 00:ff:ff:ff:ff:ff - - - - - - - 0 - - 0 - - 2001:db8:122:300::/56 - - - 6 - 1.2.3.4/32 - nat64 - - - 5 - 172.16.2.0/30 - - - 3 - 10.10.10.1/30 - nat64 - - - 2 - 172.15.2.123/32 - - - - - 1 - static - 6 - 10.1.1.3/32 - - 5678 - - 2001:db8:85a3::8a2e:370:7334/128 - - 1234 - - - - - - - diff --git a/examples/ncclient/nat/test_nat.sh b/examples/ncclient/nat/test_nat.sh index 272a1d6d9..b9ec896ce 100755 --- a/examples/ncclient/nat/test_nat.sh +++ b/examples/ncclient/nat/test_nat.sh @@ -15,4 +15,4 @@ DIR_NAME=$(dirname $0) -${DIR_NAME}/../test_copy_config.sh ${DIR_NAME}/copy_config_nat.xml ${DIR_NAME}/expected_config_nat.xml +${DIR_NAME}/../test_copy_config.sh ${DIR_NAME}/config_nat.xml ${DIR_NAME}/expected_config_nat.xml diff --git a/examples/ncclient/nat/test_nat_update.sh b/examples/ncclient/nat/test_nat_update.sh index b37e4c6a9..c5ae446b6 100755 --- a/examples/ncclient/nat/test_nat_update.sh +++ b/examples/ncclient/nat/test_nat_update.sh @@ -15,6 +15,6 @@ DIR_NAME=$(dirname $0) -${DIR_NAME}/../test_copy_config.sh ${DIR_NAME}/copy_config_nat.xml ${DIR_NAME}/expected_config_nat.xml +${DIR_NAME}/../test_copy_config.sh ${DIR_NAME}/config_nat.xml ${DIR_NAME}/expected_config_nat.xml -${DIR_NAME}/../test_copy_config.sh ${DIR_NAME}/copy_config_nat_update.xml ${DIR_NAME}/expected_config_nat_update.xml +${DIR_NAME}/../test_copy_config.sh ${DIR_NAME}/config_nat_update.xml ${DIR_NAME}/expected_config_nat_update.xml -- cgit 1.2.3-korg