You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
91 lines
1.7 KiB
91 lines
1.7 KiB
#!/usr/bin/env bash
|
|
|
|
DESC="Configuration de castafiore."
|
|
|
|
run() {
|
|
. $VDN_PATH/bin/functions-scripts.sh
|
|
|
|
setErrorHandler
|
|
echoStart
|
|
|
|
name="castafiore"
|
|
|
|
requireSshGuests $name
|
|
|
|
setHostname $name
|
|
|
|
cat << EOF | setFile $name /etc/vdn/00-firewall
|
|
flush() {
|
|
iptables -F INPUT
|
|
iptables -F OUTPUT
|
|
iptables -F FORWARD
|
|
iptables -F POSTROUTING -t nat
|
|
iptables -F PREROUTING -t nat
|
|
}
|
|
flush
|
|
|
|
## VDN Still has access
|
|
iptables -A INPUT -i eth1 -j ACCEPT
|
|
iptables -A INPUT -i lo -j ACCEPT
|
|
|
|
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
|
iptables -A INPUT -p tcp -m tcp --tcp-flags ACK ACK -j ACCEPT
|
|
|
|
|
|
iptables -A INPUT -i eth0 -j REJECT
|
|
iptables -N 'Bravo!_conf_dans_/root' &>/dev/null || :
|
|
EOF
|
|
|
|
vdn-ssh root@$name 'sh /etc/vdn/00-firewall'
|
|
|
|
|
|
cat << EOF | setHosts $name
|
|
127.0.0.1 localhost
|
|
|
|
$($VDN_PATH/bin/vdn-infos darkside PUBLIC_IP) darkside
|
|
$($VDN_PATH/bin/vdn-infos brightside PUBLIC_IP) brightside
|
|
192.168.3.1 passerelle
|
|
|
|
192.168.2.2 distributeur
|
|
192.168.2.3 client
|
|
192.168.2.4 comanche
|
|
192.168.3.2 appolo
|
|
192.168.3.3 castafiore
|
|
|
|
EOF
|
|
|
|
cat << EOF | setInterfaces $name
|
|
# This file describes the network interfaces available on your system
|
|
# and how to activate them. For more information, see interfaces(5).
|
|
|
|
# The loopback network interface
|
|
auto lo
|
|
iface lo inet loopback
|
|
|
|
auto eth0
|
|
iface eth0 inet static
|
|
address 192.168.3.3
|
|
netmask 255.255.255.0
|
|
gateway 192.168.3.1
|
|
|
|
EOF
|
|
|
|
echo "Post configurations."
|
|
|
|
cat << EOF | setFile $name /var/www/html/index.html
|
|
<html>
|
|
<body>
|
|
VDN Default Page for $name : It works !
|
|
</body>
|
|
</html>
|
|
EOF
|
|
|
|
#vdn-ssh root@$name "systemctl enable apache2; systemctl restart apache2"
|
|
|
|
unsetErrorHandler
|
|
echoDone
|
|
|
|
|
|
}
|
|
|