Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
git-virl-hs-fulda
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Rieger
git-virl-hs-fulda
Commits
84cbe3c9
Commit
84cbe3c9
authored
8 years ago
by
Sebastian Rieger
Browse files
Options
Downloads
Patches
Plain Diff
added webserver, port forwarding an unbug commands
parent
b160369c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
GIT-VIRL-HS-Fulda/Kommunikationsnetze und -protokolle (Bachelor AI)/kommprot-lab3-wanem.virl
+24
-2
24 additions, 2 deletions
...ze und -protokolle (Bachelor AI)/kommprot-lab3-wanem.virl
with
24 additions
and
2 deletions
GIT-VIRL-HS-Fulda/Kommunikationsnetze und -protokolle (Bachelor AI)/kommprot-lab3-wanem.virl
+
24
−
2
View file @
84cbe3c9
...
@@ -298,7 +298,7 @@ end
...
@@ -298,7 +298,7 @@ end
<interface
id=
"1"
name=
"GigabitEthernet0/2"
/>
<interface
id=
"1"
name=
"GigabitEthernet0/2"
/>
<interface
id=
"2"
name=
"GigabitEthernet0/3"
/>
<interface
id=
"2"
name=
"GigabitEthernet0/3"
/>
</node>
</node>
<node
name=
"Client"
type=
"SIMPLE"
subtype=
"lxc"
location=
"1
86,310
"
>
<node
name=
"Client"
type=
"SIMPLE"
subtype=
"lxc"
location=
"1
54,308
"
>
<extensions>
<extensions>
<entry
key=
"Auto-generate config"
type=
"Boolean"
>
false
</entry>
<entry
key=
"Auto-generate config"
type=
"Boolean"
>
false
</entry>
<entry
key=
"config"
type=
"String"
>
#cloud-config

<entry
key=
"config"
type=
"String"
>
#cloud-config

...
@@ -356,6 +356,7 @@ write_files:
...
@@ -356,6 +356,7 @@ write_files:
route del default

route del default

route add default gw 192.168.1.1

route add default gw 192.168.1.1

arp -i eth1 -s 192.168.1.1 aa:aa:aa:aa:aa:aa

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

exit 0



- path: /etc/resolv.conf

- path: /etc/resolv.conf

...
@@ -370,6 +371,7 @@ write_files:
...
@@ -370,6 +371,7 @@ write_files:
</node>
</node>
<node
name=
"ISP"
type=
"SIMPLE"
subtype=
"lxc"
location=
"343,149"
>
<node
name=
"ISP"
type=
"SIMPLE"
subtype=
"lxc"
location=
"343,149"
>
<extensions>
<extensions>
<entry
key=
"Auto-generate config"
type=
"Boolean"
>
false
</entry>
<entry
key=
"config"
type=
"String"
>
#cloud-config

<entry
key=
"config"
type=
"String"
>
#cloud-config

bootcmd:

bootcmd:

- ln -s -t /etc/rc.d /etc/rc.local

- ln -s -t /etc/rc.d /etc/rc.local

...
@@ -440,8 +442,13 @@ write_files:
...
@@ -440,8 +442,13 @@ write_files:
iptables -t nat -A POSTROUTING -o eth3 -j MASQUERADE

iptables -t nat -A POSTROUTING -o eth3 -j MASQUERADE

iptables -P FORWARD ACCEPT

iptables -P FORWARD ACCEPT

iptables -F FORWARD

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%

/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

service ssh start



hostname ISP

hostname ISP

...
@@ -449,7 +456,6 @@ write_files:
...
@@ -449,7 +456,6 @@ write_files:
exit 0

exit 0



</entry>
</entry>
<entry
key=
"Auto-generate config"
type=
"Boolean"
>
false
</entry>
</extensions>
</extensions>
<interface
id=
"0"
name=
"eth1"
/>
<interface
id=
"0"
name=
"eth1"
/>
<interface
id=
"1"
name=
"eth2"
/>
<interface
id=
"1"
name=
"eth2"
/>
...
@@ -468,6 +474,7 @@ runcmd:
...
@@ -468,6 +474,7 @@ runcmd:
- start ttyS0

- start ttyS0

- systemctl start getty@ttyS0.service

- systemctl start getty@ttyS0.service

- systemctl start rc-local

- systemctl start rc-local

- systemctl start install-webserver

- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config

- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config

- echo "UseDNS no"
>>
/etc/ssh/sshd_config

- echo "UseDNS no"
>>
/etc/ssh/sshd_config

- service ssh restart

- service ssh restart

...
@@ -513,7 +520,22 @@ write_files:
...
@@ -513,7 +520,22 @@ write_files:
ifconfig eth1 up 192.168.2.100 netmask 255.255.255.0

ifconfig eth1 up 192.168.2.100 netmask 255.255.255.0

route del default

route del default

route add default gw 192.168.2.1

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

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

exit 0

</entry>
</entry>
</extensions>
</extensions>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment