diff --git a/GIT-VIRL-HS-Fulda/Kommunikationsnetze und -protokolle (Bachelor AI)/kommprot-lab3-wanem.virl b/GIT-VIRL-HS-Fulda/Kommunikationsnetze und -protokolle (Bachelor AI)/kommprot-lab3-wanem.virl
index 4a36680..9bab321 100644
--- a/GIT-VIRL-HS-Fulda/Kommunikationsnetze und -protokolle (Bachelor AI)/kommprot-lab3-wanem.virl
+++ b/GIT-VIRL-HS-Fulda/Kommunikationsnetze und -protokolle (Bachelor AI)/kommprot-lab3-wanem.virl
@@ -298,7 +298,7 @@ end
-
+
false
#cloud-config
@@ -356,6 +356,7 @@ write_files:
route del default
route add default gw 192.168.1.1
arp -i eth1 -s 192.168.1.1 aa:aa:aa:aa:aa:aa
+ echo "alias unbug='sudo arp -d 192.168.1.1'" >>/home/cisco/.bashrc
exit 0
- path: /etc/resolv.conf
@@ -370,6 +371,7 @@ write_files:
+ false
#cloud-config
bootcmd:
- ln -s -t /etc/rc.d /etc/rc.local
@@ -440,8 +442,13 @@ write_files:
iptables -t nat -A POSTROUTING -o eth3 -j MASQUERADE
iptables -P FORWARD ACCEPT
iptables -F FORWARD
+
+ iptables -t nat -A PREROUTING -i eth3 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.2.100:80
+ iptables -t nat -A PREROUTING -i eth3 -p tcp -m tcp --dport 22 -j DNAT --to-destination 192.168.2.100:22
/sbin/tc qdisc add dev eth2 root handle 1:1 netem delay 100ms loss 5%
+ echo "alias unbug='sudo tc qdisc del dev eth2 root'" >>/home/cisco/.bashrc
+
service ssh start
hostname ISP
@@ -449,7 +456,6 @@ write_files:
exit 0
- false
@@ -468,6 +474,7 @@ runcmd:
- start ttyS0
- systemctl start getty@ttyS0.service
- systemctl start rc-local
+- systemctl start install-webserver
- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config
- echo "UseDNS no" >> /etc/ssh/sshd_config
- service ssh restart
@@ -513,7 +520,22 @@ write_files:
ifconfig eth1 up 192.168.2.100 netmask 255.255.255.0
route del default
route add default gw 192.168.2.1
+ route add -net 192.168.1.0/24 gw 127.0.0.1
+ echo "alias unbug='sudo route del -net 192.168.1.0/24'" >>/home/cisco/.bashrc
echo "nameserver 8.8.8.8" >/etc/resolv.conf
+ screen -dmS install-webserver /tmp/install-webserver &
+ exit 0
+- path: /tmp/install-webserver
+ owner: root:root
+ permissions: '0755'
+ content: |-
+ #!/bin/bash
+ echo "Waiting for internet connectivity"
+ until echo -n "." && ping -c1 archive.ubuntu.com &>/dev/null; do :; done
+ apt-get -y update
+ apt-get -y install apache2
+ echo "<h1>Willkommen auf Server-B!</h1>" >/var/www/html/index.html
+ read -p "Press any key..."
exit 0