diff --git a/Report.md b/Report.md deleted file mode 100644 index ac66a3a..0000000 --- a/Report.md +++ /dev/null @@ -1 +0,0 @@ -First 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