diff options
-rwxr-xr-x | ci/util.sh | 10 | ||||
-rwxr-xr-x | lib/parse-functions.sh | 16 |
2 files changed, 17 insertions, 9 deletions
@@ -91,13 +91,19 @@ parse_cmdline() { ;; mock-detached) if [ "$2" == "on" ]; then - echo "Blocking output http and https traffic" + echo "Blocking output http (80) traffic" iptables -A OUTPUT -p tcp --dport 80 -j REJECT + echo "Blocking output https (443) traffic" iptables -A OUTPUT -p tcp --dport 443 -j REJECT + echo "Blocking output dns (53) traffic" + iptables -A OUTPUT -p tcp --dport 53 -j REJECT elif [ "$2" == "off" ]; then - echo "Allowing output http and https traffic" + echo "Allowing output http (80) traffic" iptables -D OUTPUT -p tcp --dport 80 -j REJECT + echo "Allowing output https (443) traffic" iptables -D OUTPUT -p tcp --dport 443 -j REJECT + echo "Allowing output dns (53) traffic" + iptables -D OUTPUT -p tcp --dport 53 -j REJECT else display_usage fi diff --git a/lib/parse-functions.sh b/lib/parse-functions.sh index 0be62e25..a582c28a 100755 --- a/lib/parse-functions.sh +++ b/lib/parse-functions.sh @@ -55,13 +55,15 @@ parse_network_settings() { local output parse_ext parse_ext='' - for val in ${performance_roles[@]}; do - if [ "$val" == "Compute" ]; then - parse_ext="${parse_ext} --compute-pre-config " - elif [ "$val" == "Controller" ]; then - parse_ext="${parse_ext} --controller-pre-config " - fi - done + if [[ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' || "${deploy_options_array['dataplane']}" == 'fdio' ]]; then + for val in ${performance_roles[@]}; do + if [ "$val" == "Compute" ]; then + parse_ext="${parse_ext} --compute-pre-config " + elif [ "$val" == "Controller" ]; then + parse_ext="${parse_ext} --controller-pre-config " + fi + done + fi if output=$(python3.4 -B $LIB/python/apex_python_utils.py parse-net-settings -s $NETSETS $net_isolation_arg -e $CONFIG/network-environment.yaml $parse_ext); then echo -e "${blue}${output}${reset}" |