From e1963a1401526fb5741de8a4dc51b32dcd5bdd21 Mon Sep 17 00:00:00 2001 From: Souhair Date: Fri, 10 Mar 2023 23:23:57 +0300 Subject: [PATCH 1/6] Delete Report.md --- Report.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Report.md diff --git a/Report.md b/Report.md deleted file mode 100644 index ac66a3a..0000000 --- a/Report.md +++ /dev/null @@ -1 +0,0 @@ -First From c342301a9be13fcdbb1228cd82dedb1e4e936030 Mon Sep 17 00:00:00 2001 From: Souhair Date: Sat, 11 Mar 2023 03:46:18 +0300 Subject: [PATCH 2/6] Add files via upload --- A_bash.sh | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ B_bash.sh | 40 +++++++++++++++++++++++++++++++++ C_bash.sh | 39 ++++++++++++++++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 A_bash.sh create mode 100644 B_bash.sh create mode 100644 C_bash.sh diff --git a/A_bash.sh b/A_bash.sh new file mode 100644 index 0000000..1a6b904 --- /dev/null +++ b/A_bash.sh @@ -0,0 +1,67 @@ +#! /bin/bash +# a script to create the second virtual machine +echo "create network bridge between first (192.168.18.10) and second (192.168.18.1) servers +.... +...." +ip a +ip link add macvlan1 link eth0 type macvlan mode bridge +ip address add dev macvlan1 192.168.18.10/24 +ip link set macvlan1 up +ip a +echo "create tcp connection between first and second servers +.... +...." +apk add tcpdump +tcpdump +echo "check connection with the second server +.... +...." +ping 192.168.18.1 +echo "check the routes for first server +.... +...." +ip route +echo "tcp connection between first(192.168.18.10) and third (192.168.4.100) servers +.... +...." +tcpdump +echo "create sub netwoek with third server by routing +.... +...." +ip route add 192.168.4.0/24 via 192.168.18.1 +echo "check connect with the third server (192.168.4.100) +.... +...." +ping 192.168.4.100 +echo "create a web server on port 5000 with third server as a client +.... +...." +pip install flask +mkdir myapp +cd myapp +echo "web-server configration with requests: GET, PUT, POST +..load app.py from the File VM_A file or open the A_bash file and look at the end of it.. +...." +vim app.py +python3 app.py + +""" +from crypt import methods +from flask import Flask + +app = Flask(__name__) + +@app.route("/", methods=['GET']) +def hello_world(): + return "

Hello, World!

" + +@app.route("/", methods=['PUT']) +def hello_world_put(): + return "

Hello, World!

" + +@app.route("/", methods=['POST']) +def hello_world_post(): + return "

Hello, World!

" + +app.run(host='0.0.0.0', port=5000) +""" \ No newline at end of file diff --git a/B_bash.sh b/B_bash.sh new file mode 100644 index 0000000..7c33bac --- /dev/null +++ b/B_bash.sh @@ -0,0 +1,40 @@ +echo "create network bridge between second (192.168.18.1) and first (192.168.18.10) servers +.... +...." +ip a +ip link add macvlan1 link eth0 type macvlan mode bridge +ip address add dev macvlan1 192.168.18.1/24 +ip link set macvlan1 up +ip a +echo "create network bridge between second (192.168.4.1) and third (192.168.4.100) servers +.... +...." +ip link add macvlan2 link eth0 type macvlan mode bridge +ip address add dev macvlan2 192.168.4.1/24 +ip link set macvlan2 up +ip a +echo "check connection with the third server +.... +...." +ping 192.168.4.100 +echo "check connection with the first server +.... +...." +ping 192.168.18.10 +echo "tcp connection between second (192.168.18.1) and first (192.168.18.10) servers +.... +...." +apk add tcpdump +tcpdump -i macvlan1 +echo "tcp connection between second(192.168.4.1) and third (192.168.4.100) servers +.... +...." +tcpdump -i macvlan2 +echo "check the routes for second server +.... +...." +ip route +echo "create tcp connection to listen to port 5000 +.... +...." +tcpdump 'port 5000' \ No newline at end of file diff --git a/C_bash.sh b/C_bash.sh new file mode 100644 index 0000000..e66f74b --- /dev/null +++ b/C_bash.sh @@ -0,0 +1,39 @@ +echo "create network bridge between third (192.168.4.100) and second (192.168.4.1) servers +.... +...." +ip a +ip link add macvlan1 link eth0 macvlan mode bridge +ip address add dev macvlan1 192.168.4.100/24 +ip link set macvlan1 up +ip a +echo "create tcp connection the third and second servers +.... +...." +apk add tcpdump +tcpdump +echo "check connection with the second server +.... +...." +ping 192.168.4.1 +echo "check the routes for second server +.... +...." +ip route +echo "create sub netwoek with first server by routing +.... +...." +ip route add 192.168.18.0/24 via 192.168.4.1 +echo "check connection with the first server +.... +...." +ping 192.168.18.10 +echo "create tcp connection the third and first servers +.... +...." +tcpdump +echo "send requests to the web-server on port 5000 +.... +...." +curl 'http://192.168.18.10:5000' +curl -X POST 'http://192.168.18.10:5000' +curl -X PUT 'http://192.168.18.10:5000' \ No newline at end of file From fb07b2559d8bc30043d9dedfe07e8d999fb1b5a2 Mon Sep 17 00:00:00 2001 From: Souhair Date: Sat, 11 Mar 2023 03:47:04 +0300 Subject: [PATCH 3/6] Add files via upload --- vms/ubuntu_a/application/A_bash.sh | 67 ++++++++++++++++++++++++++++++ vms/ubuntu_a/application/B_bash.sh | 40 ++++++++++++++++++ vms/ubuntu_a/application/C_bash.sh | 39 +++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 vms/ubuntu_a/application/A_bash.sh create mode 100644 vms/ubuntu_a/application/B_bash.sh create mode 100644 vms/ubuntu_a/application/C_bash.sh diff --git a/vms/ubuntu_a/application/A_bash.sh b/vms/ubuntu_a/application/A_bash.sh new file mode 100644 index 0000000..1a6b904 --- /dev/null +++ b/vms/ubuntu_a/application/A_bash.sh @@ -0,0 +1,67 @@ +#! /bin/bash +# a script to create the second virtual machine +echo "create network bridge between first (192.168.18.10) and second (192.168.18.1) servers +.... +...." +ip a +ip link add macvlan1 link eth0 type macvlan mode bridge +ip address add dev macvlan1 192.168.18.10/24 +ip link set macvlan1 up +ip a +echo "create tcp connection between first and second servers +.... +...." +apk add tcpdump +tcpdump +echo "check connection with the second server +.... +...." +ping 192.168.18.1 +echo "check the routes for first server +.... +...." +ip route +echo "tcp connection between first(192.168.18.10) and third (192.168.4.100) servers +.... +...." +tcpdump +echo "create sub netwoek with third server by routing +.... +...." +ip route add 192.168.4.0/24 via 192.168.18.1 +echo "check connect with the third server (192.168.4.100) +.... +...." +ping 192.168.4.100 +echo "create a web server on port 5000 with third server as a client +.... +...." +pip install flask +mkdir myapp +cd myapp +echo "web-server configration with requests: GET, PUT, POST +..load app.py from the File VM_A file or open the A_bash file and look at the end of it.. +...." +vim app.py +python3 app.py + +""" +from crypt import methods +from flask import Flask + +app = Flask(__name__) + +@app.route("/", methods=['GET']) +def hello_world(): + return "

Hello, World!

" + +@app.route("/", methods=['PUT']) +def hello_world_put(): + return "

Hello, World!

" + +@app.route("/", methods=['POST']) +def hello_world_post(): + return "

Hello, World!

" + +app.run(host='0.0.0.0', port=5000) +""" \ No newline at end of file diff --git a/vms/ubuntu_a/application/B_bash.sh b/vms/ubuntu_a/application/B_bash.sh new file mode 100644 index 0000000..7c33bac --- /dev/null +++ b/vms/ubuntu_a/application/B_bash.sh @@ -0,0 +1,40 @@ +echo "create network bridge between second (192.168.18.1) and first (192.168.18.10) servers +.... +...." +ip a +ip link add macvlan1 link eth0 type macvlan mode bridge +ip address add dev macvlan1 192.168.18.1/24 +ip link set macvlan1 up +ip a +echo "create network bridge between second (192.168.4.1) and third (192.168.4.100) servers +.... +...." +ip link add macvlan2 link eth0 type macvlan mode bridge +ip address add dev macvlan2 192.168.4.1/24 +ip link set macvlan2 up +ip a +echo "check connection with the third server +.... +...." +ping 192.168.4.100 +echo "check connection with the first server +.... +...." +ping 192.168.18.10 +echo "tcp connection between second (192.168.18.1) and first (192.168.18.10) servers +.... +...." +apk add tcpdump +tcpdump -i macvlan1 +echo "tcp connection between second(192.168.4.1) and third (192.168.4.100) servers +.... +...." +tcpdump -i macvlan2 +echo "check the routes for second server +.... +...." +ip route +echo "create tcp connection to listen to port 5000 +.... +...." +tcpdump 'port 5000' \ No newline at end of file diff --git a/vms/ubuntu_a/application/C_bash.sh b/vms/ubuntu_a/application/C_bash.sh new file mode 100644 index 0000000..e66f74b --- /dev/null +++ b/vms/ubuntu_a/application/C_bash.sh @@ -0,0 +1,39 @@ +echo "create network bridge between third (192.168.4.100) and second (192.168.4.1) servers +.... +...." +ip a +ip link add macvlan1 link eth0 macvlan mode bridge +ip address add dev macvlan1 192.168.4.100/24 +ip link set macvlan1 up +ip a +echo "create tcp connection the third and second servers +.... +...." +apk add tcpdump +tcpdump +echo "check connection with the second server +.... +...." +ping 192.168.4.1 +echo "check the routes for second server +.... +...." +ip route +echo "create sub netwoek with first server by routing +.... +...." +ip route add 192.168.18.0/24 via 192.168.4.1 +echo "check connection with the first server +.... +...." +ping 192.168.18.10 +echo "create tcp connection the third and first servers +.... +...." +tcpdump +echo "send requests to the web-server on port 5000 +.... +...." +curl 'http://192.168.18.10:5000' +curl -X POST 'http://192.168.18.10:5000' +curl -X PUT 'http://192.168.18.10:5000' \ No newline at end of file From 7e819f74ea2a3378d1f5456dd32644d9939ec9db Mon Sep 17 00:00:00 2001 From: Souhair Date: Sat, 11 Mar 2023 03:49:40 +0300 Subject: [PATCH 4/6] Delete B_bash.sh --- B_bash.sh | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 B_bash.sh diff --git a/B_bash.sh b/B_bash.sh deleted file mode 100644 index 7c33bac..0000000 --- a/B_bash.sh +++ /dev/null @@ -1,40 +0,0 @@ -echo "create network bridge between second (192.168.18.1) and first (192.168.18.10) servers -.... -...." -ip a -ip link add macvlan1 link eth0 type macvlan mode bridge -ip address add dev macvlan1 192.168.18.1/24 -ip link set macvlan1 up -ip a -echo "create network bridge between second (192.168.4.1) and third (192.168.4.100) servers -.... -...." -ip link add macvlan2 link eth0 type macvlan mode bridge -ip address add dev macvlan2 192.168.4.1/24 -ip link set macvlan2 up -ip a -echo "check connection with the third server -.... -...." -ping 192.168.4.100 -echo "check connection with the first server -.... -...." -ping 192.168.18.10 -echo "tcp connection between second (192.168.18.1) and first (192.168.18.10) servers -.... -...." -apk add tcpdump -tcpdump -i macvlan1 -echo "tcp connection between second(192.168.4.1) and third (192.168.4.100) servers -.... -...." -tcpdump -i macvlan2 -echo "check the routes for second server -.... -...." -ip route -echo "create tcp connection to listen to port 5000 -.... -...." -tcpdump 'port 5000' \ No newline at end of file From f1e414ad2656321aed1fa33fd7f2d5009fdf138a Mon Sep 17 00:00:00 2001 From: Souhair Date: Sat, 11 Mar 2023 03:49:48 +0300 Subject: [PATCH 5/6] Delete A_bash.sh --- A_bash.sh | 67 ------------------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 A_bash.sh diff --git a/A_bash.sh b/A_bash.sh deleted file mode 100644 index 1a6b904..0000000 --- a/A_bash.sh +++ /dev/null @@ -1,67 +0,0 @@ -#! /bin/bash -# a script to create the second virtual machine -echo "create network bridge between first (192.168.18.10) and second (192.168.18.1) servers -.... -...." -ip a -ip link add macvlan1 link eth0 type macvlan mode bridge -ip address add dev macvlan1 192.168.18.10/24 -ip link set macvlan1 up -ip a -echo "create tcp connection between first and second servers -.... -...." -apk add tcpdump -tcpdump -echo "check connection with the second server -.... -...." -ping 192.168.18.1 -echo "check the routes for first server -.... -...." -ip route -echo "tcp connection between first(192.168.18.10) and third (192.168.4.100) servers -.... -...." -tcpdump -echo "create sub netwoek with third server by routing -.... -...." -ip route add 192.168.4.0/24 via 192.168.18.1 -echo "check connect with the third server (192.168.4.100) -.... -...." -ping 192.168.4.100 -echo "create a web server on port 5000 with third server as a client -.... -...." -pip install flask -mkdir myapp -cd myapp -echo "web-server configration with requests: GET, PUT, POST -..load app.py from the File VM_A file or open the A_bash file and look at the end of it.. -...." -vim app.py -python3 app.py - -""" -from crypt import methods -from flask import Flask - -app = Flask(__name__) - -@app.route("/", methods=['GET']) -def hello_world(): - return "

Hello, World!

" - -@app.route("/", methods=['PUT']) -def hello_world_put(): - return "

Hello, World!

" - -@app.route("/", methods=['POST']) -def hello_world_post(): - return "

Hello, World!

" - -app.run(host='0.0.0.0', port=5000) -""" \ No newline at end of file From a52d44f171abdd2e45f0c85575e6ce4802621e81 Mon Sep 17 00:00:00 2001 From: Souhair Date: Sat, 11 Mar 2023 03:50:04 +0300 Subject: [PATCH 6/6] Delete C_bash.sh --- C_bash.sh | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 C_bash.sh diff --git a/C_bash.sh b/C_bash.sh deleted file mode 100644 index e66f74b..0000000 --- a/C_bash.sh +++ /dev/null @@ -1,39 +0,0 @@ -echo "create network bridge between third (192.168.4.100) and second (192.168.4.1) servers -.... -...." -ip a -ip link add macvlan1 link eth0 macvlan mode bridge -ip address add dev macvlan1 192.168.4.100/24 -ip link set macvlan1 up -ip a -echo "create tcp connection the third and second servers -.... -...." -apk add tcpdump -tcpdump -echo "check connection with the second server -.... -...." -ping 192.168.4.1 -echo "check the routes for second server -.... -...." -ip route -echo "create sub netwoek with first server by routing -.... -...." -ip route add 192.168.18.0/24 via 192.168.4.1 -echo "check connection with the first server -.... -...." -ping 192.168.18.10 -echo "create tcp connection the third and first servers -.... -...." -tcpdump -echo "send requests to the web-server on port 5000 -.... -...." -curl 'http://192.168.18.10:5000' -curl -X POST 'http://192.168.18.10:5000' -curl -X PUT 'http://192.168.18.10:5000' \ No newline at end of file