Skip to content
Snippets Groups Projects
Commit c76fc2c0 authored by David Schmitz's avatar David Schmitz
Browse files

install-*.sh: option for adding an initial test rule to DB;...

install-*.sh: option for adding an initial test rule to DB; feature/exabgp_with_docker-compose: use this new option for test rule to block traffic between host1 aand host2: update
parent b6943bba
Branches
Tags
No related merge requests found
...@@ -8,3 +8,7 @@ FOD_EXABGP_LOCAL_AS=1001 ...@@ -8,3 +8,7 @@ FOD_EXABGP_LOCAL_AS=1001
FOD_EXABGP_REMOTE_ID=10.197.36.3 FOD_EXABGP_REMOTE_ID=10.197.36.3
FOD_EXABGP_REMOTE_IP=10.197.36.3 FOD_EXABGP_REMOTE_IP=10.197.36.3
FOD_EXABGP_REMOTE_AS=2001 FOD_EXABGP_REMOTE_AS=2001
FOD_TESTRULE1_NAME_PREFIX=testrtr1
FOD_TESTRULE1_SOURCE_IP_PREFIX=10.1.10.11/32
FOD_TESTRULE1_DESTINATION_IP_PREFIX=10.2.10.12/32
FOD_TESTRULE1_DESTINATION_IP_PROTOCOL=1
...@@ -23,7 +23,7 @@ RUN ./install-debian.sh --basesw_python --here__with_venv_relative --supervisord ...@@ -23,7 +23,7 @@ RUN ./install-debian.sh --basesw_python --here__with_venv_relative --supervisord
# build step3 # build step3
COPY . /opt/FOD COPY . /opt/FOD
RUN ./install-debian.sh --fodproper1 --here__with_venv_relative --supervisord --setup_admin_user --setup_admin_user5 admin ${ADMIN_PASS} ${ADMIN_EMAIL} ${FOD_ORG} ${FOD_ORG_NET} --exabgp ${FOD_EXABGP_LOCAL_ID} ${FOD_EXABGP_LOCAL_IP} ${FOD_EXABGP_LOCAL_AS} ${FOD_EXABGP_REMOTE_ID} ${FOD_EXABGP_REMOTE_IP} ${FOD_EXABGP_REMOTE_AS} RUN ./install-debian.sh --fodproper1 --here__with_venv_relative --supervisord --setup_admin_user --setup_admin_user5 admin ${ADMIN_PASS} ${ADMIN_EMAIL} ${FOD_ORG} ${FOD_ORG_NET} --setup_test_rule --setup_test_rule5 ${FOD_TESTRULE1_NAME_PREFIX} ${FOD_TESTRULE1_SOURCE_IP_PREFIX} ${FOD_TESTRULE1_DESTINATION_IP_PREFIX} ${FOD_TESTRULE1_DESTINATION_IP_PROTOCOL} admin --exabgp ${FOD_EXABGP_LOCAL_ID} ${FOD_EXABGP_LOCAL_IP} ${FOD_EXABGP_LOCAL_AS} ${FOD_EXABGP_REMOTE_ID} ${FOD_EXABGP_REMOTE_IP} ${FOD_EXABGP_REMOTE_AS}
# #
......
...@@ -8,9 +8,9 @@ else ...@@ -8,9 +8,9 @@ else
#./install-debian.sh --here__with_venv_relative --supervisord --setup_admin_user --setup_admin_user5 admin ${ADMIN_PASS} ${ADMIN_EMAIL} ${FOD_ORG} ${FOD_ORG_NET} --exabgp ${FOD_EXABGP_LOCAL_ID} ${FOD_EXABGP_LOCAL_IP} ${FOD_EXABGP_LOCAL_AS} ${FOD_EXABGP_REMOTE_ID} ${FOD_EXABGP_REMOTE_IP} ${FOD_EXABGP_REMOTE_AS} #./install-debian.sh --here__with_venv_relative --supervisord --setup_admin_user --setup_admin_user5 admin ${ADMIN_PASS} ${ADMIN_EMAIL} ${FOD_ORG} ${FOD_ORG_NET} --exabgp ${FOD_EXABGP_LOCAL_ID} ${FOD_EXABGP_LOCAL_IP} ${FOD_EXABGP_LOCAL_AS} ${FOD_EXABGP_REMOTE_ID} ${FOD_EXABGP_REMOTE_IP} ${FOD_EXABGP_REMOTE_AS}
./install-debian.sh --fodproper1 \ ./install-debian.sh --fodproper1 \
--here__with_venv_relative --supervisord \ --here__with_venv_relative --supervisord \
--setup_admin_user --setup_admin_user5 admin ${ADMIN_PASS} ${ADMIN_EMAIL} ${FOD_ORG} ${FOD_ORG_NET} \ --setup_admin_user --setup_admin_user5 admin "${ADMIN_PASS}" "${ADMIN_EMAIL}" "${FOD_ORG}" "${FOD_ORG_NET}" \
--setup_test_rule --setup_test_rule5 testrtr1 10.1.10.11/32 10.2.10.12/32 1 admin \ --setup_test_rule --setup_test_rule5 "${FOD_TESTRULE1_NAME_PREFIX}" "${FOD_TESTRULE1_SOURCE_IP_PREFIX}" "${FOD_TESTRULE1_DESTINATION_IP_PREFIX}" "${FOD_TESTRULE1_DESTINATION_IP_PROTOCOL}" admin \
--exabgp ${FOD_EXABGP_LOCAL_ID} ${FOD_EXABGP_LOCAL_IP} ${FOD_EXABGP_LOCAL_AS} ${FOD_EXABGP_REMOTE_ID} ${FOD_EXABGP_REMOTE_IP} ${FOD_EXABGP_REMOTE_AS} --exabgp "${FOD_EXABGP_LOCAL_ID}" "${FOD_EXABGP_LOCAL_IP}" "${FOD_EXABGP_LOCAL_AS}" "${FOD_EXABGP_REMOTE_ID}" "${FOD_EXABGP_REMOTE_IP}" "${FOD_EXABGP_REMOTE_AS}"
/opt/FOD/venv/bin/python -m pip install exabgp /opt/FOD/venv/bin/python -m pip install exabgp
touch /opt/setup_ok touch /opt/setup_ok
fi fi
...@@ -316,7 +316,7 @@ while [ $# -gt 0 ]; do ...@@ -316,7 +316,7 @@ while [ $# -gt 0 ]; do
shift 1 shift 1
elif [ $# -ge 1 -a "$1" = "--setup_test_rule" ]; then elif [ $# -ge 1 -a "$1" = "--setup_test_rule" ]; then
shift 1 shift 1
setup_test_rule=1 setup_testrule=1
elif [ $# -ge 1 -a "$1" = "--setup_test_rule5" ]; then elif [ $# -ge 1 -a "$1" = "--setup_test_rule5" ]; then
shift 1 shift 1
setup_testrule=1 setup_testrule=1
...@@ -846,7 +846,9 @@ if [ "$install_fodproper" = 1 ]; then ...@@ -846,7 +846,9 @@ if [ "$install_fodproper" = 1 ]; then
( (
set +e # for now ignore potential errors, especially in case user already exists set +e # for now ignore potential errors, especially in case user already exists
source ./venv/bin/activate source ./venv/bin/activate
{ cat /dev/fd/5 | ./pythonenv ./manage.py shell; } 5<<EOF [ ! -f "fodenv.sh" ] || source "./fodenv.sh"
{ cat /dev/fd/5 | ./manage.py shell; } 5<<EOF
from flowspec.models import * from flowspec.models import *
from django.contrib.auth.models import User; from django.contrib.auth.models import User;
applier1 = User.objects.get(username__exact='$setup_testrule_appliername'); applier1 = User.objects.get(username__exact='$setup_testrule_appliername');
......
...@@ -419,7 +419,7 @@ while [ $# -gt 0 ]; do ...@@ -419,7 +419,7 @@ while [ $# -gt 0 ]; do
shift 1 shift 1
elif [ $# -ge 1 -a "$1" = "--setup_test_rule" ]; then elif [ $# -ge 1 -a "$1" = "--setup_test_rule" ]; then
shift 1 shift 1
setup_test_rule=1 setup_testrule=1
elif [ $# -ge 1 -a "$1" = "--setup_test_rule5" ]; then elif [ $# -ge 1 -a "$1" = "--setup_test_rule5" ]; then
shift 1 shift 1
setup_testrule=1 setup_testrule=1
...@@ -987,7 +987,9 @@ if [ "$install_fodproper" = 1 ]; then ...@@ -987,7 +987,9 @@ if [ "$install_fodproper" = 1 ]; then
( (
set +e # for now ignore potential errors, especially in case user already exists set +e # for now ignore potential errors, especially in case user already exists
source ./venv/bin/activate source ./venv/bin/activate
{ cat /dev/fd/5 | ./pythonenv ./manage.py shell; } 5<<EOF [ ! -f "fodenv.sh" ] || source "./fodenv.sh"
{ cat /dev/fd/5 | ./manage.py shell; } 5<<EOF
from flowspec.models import * from flowspec.models import *
from django.contrib.auth.models import User; from django.contrib.auth.models import User;
applier1 = User.objects.get(username__exact='$setup_testrule_appliername'); applier1 = User.objects.get(username__exact='$setup_testrule_appliername');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment