[install-party] Parce que la fête du slip, c'est bien dans le /root d'un serveur, mais c'est mieux ici.
This commit is contained in:
parent
c3a7d7d7b1
commit
d228a7cb6b
3 changed files with 87 additions and 0 deletions
52
utils/install-party/fete-du-slip
Executable file
52
utils/install-party/fete-du-slip
Executable file
|
@ -0,0 +1,52 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Pour nater tout le monde sur le VLAN 10
|
||||
# À exécuter sur ytrap-llatsni
|
||||
|
||||
if [ `hostname` != "ytrap-llatsni" ]
|
||||
then
|
||||
echo "À exécuter sur ytrap-llatsni"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
iptables -t nat -F
|
||||
iptables -t raw -F
|
||||
iptables -t mangle -F
|
||||
ip6tables -t mangle -F
|
||||
ip6tables -F
|
||||
|
||||
iptables -t raw -A PREROUTING -d 224.0.0.0/4 -j DROP
|
||||
# On log les les paquets
|
||||
iptables -t mangle -A PREROUTING -i eth1 -m state --state NEW -j LOG --log-prefix "LOG_ALL "
|
||||
iptables -t mangle -A PREROUTING -i eth0 -m state --state NEW -j LOG --log-prefix "LOG_ALL "
|
||||
# On nat l'ipv4
|
||||
iptables -t nat -A POSTROUTING -j MASQUERADE
|
||||
|
||||
# Pas d'adm
|
||||
ip6tables -t filter -A FORWARD -o eth2 -j REJECT
|
||||
|
||||
# On log les les paquets
|
||||
ip6tables -t mangle -A PREROUTING -i eth1 -m state --state NEW -j LOG --log-prefix "LOG_ALL "
|
||||
ip6tables -t mangle -A PREROUTING -i eth0 -m state --state NEW -j LOG --log-prefix "LOG_ALL "
|
||||
ip6tables -A FORWARD -p icmp -j ACCEPT
|
||||
|
||||
# On accept les ip crans
|
||||
ip6tables -A FORWARD -i eth0 -s 2a01:240:fe3d::/56 -d 2a01:240:fe3d:d2::/64 -j ACCEPT
|
||||
ip6tables -A FORWARD -i eth1 -d 2a01:240:fe3d::/56 -s 2a01:240:fe3d:d2::/64 -j ACCEPT
|
||||
# On permet de contacter toutes les ips en sortie
|
||||
ip6tables -A FORWARD -i eth1 -o eth0 -j ACCEPT
|
||||
# On accepte tout ce qui vient de komaz
|
||||
ip6tables -A FORWARD -i eth0 -m mac --mac-source 00:19:bb:31:3b:80 -j ACCEPT
|
||||
# On rejete le reste
|
||||
ip6tables -A FORWARD -j REJECT
|
||||
ip6tables -P FORWARD DROP
|
||||
|
||||
# On active le routage en ipv6
|
||||
echo 1 > /proc/sys/net/ipv6/conf/eth1/forwarding
|
||||
echo 1 > /proc/sys/net/ipv6/conf/eth0/forwarding
|
||||
|
||||
# Sinon radvd vomit
|
||||
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
|
||||
|
||||
# On lance radvd
|
||||
/etc/init.d/radvd start
|
34
utils/install-party/fin-de-la-fete
Executable file
34
utils/install-party/fin-de-la-fete
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Pour arrêter la fete-du-slip
|
||||
# À exécuter sur ytrap-llatsni
|
||||
|
||||
if [ `hostname` != "ytrap-llatsni" ]
|
||||
then
|
||||
echo "À exécuter sur ytrap-llatsni"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# On désactive le nat en ipv4
|
||||
iptables -t nat -F
|
||||
iptables -t filter -F
|
||||
iptables -t mangle -F
|
||||
|
||||
# On désactive le routage en ipv6
|
||||
echo 0 > /proc/sys/net/ipv6/conf/all/forwarding
|
||||
echo 0 > /proc/sys/net/ipv6/conf/eth1/forwarding
|
||||
echo 0 > /proc/sys/net/ipv6/conf/eth0/forwarding
|
||||
|
||||
# On lance arrête
|
||||
/etc/init.d/radvd stop
|
||||
|
||||
#On vide le pare-feu ipv6
|
||||
ip6tables -t filter -F
|
||||
ip6tables -t mangle -F
|
||||
|
||||
echo Mise en place du MASQUERADEing vers charybde pour les livecd du PXE et le miroir local
|
||||
iptables -t nat -A POSTROUTING -s 10.231.137.0/24 -d 138.231.136.98 -o eth0 -j MASQUERADE
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo .
|
||||
fi
|
||||
|
1
utils/ytrap-llatsni
Symbolic link
1
utils/ytrap-llatsni
Symbolic link
|
@ -0,0 +1 @@
|
|||
install-party
|
Loading…
Add table
Add a link
Reference in a new issue