45 lines
No EOL
1.3 KiB
Bash
45 lines
No EOL
1.3 KiB
Bash
#!/bin/bash
|
|
|
|
. ./lib/metadata.sh
|
|
|
|
function config_kvm {
|
|
apt-get install -y \
|
|
vim \
|
|
htop \
|
|
socat \
|
|
ebtables \
|
|
qemu-system qemu-utils qemu-kvm \
|
|
genisoimage \
|
|
curl \
|
|
whois \
|
|
tcpdump \
|
|
bridge-utils
|
|
|
|
sysctl -w net.ipv4.ip_forward=1
|
|
iptables -A OUTPUT -p icmp --icmp-type time-exceeded -j DROP
|
|
|
|
# Créer une nouvelle chaîne nommée "ACCEPT_BOGON"
|
|
iptables -N ACCEPT_BOGON
|
|
|
|
# Y mettre toutes les règles liées aux IPs bogon
|
|
iptables -A ACCEPT_BOGON -s 10.0.0.0/8 -j ACCEPT
|
|
iptables -A ACCEPT_BOGON -s 192.168.0.0/16 -j ACCEPT
|
|
iptables -A ACCEPT_BOGON -s 192.168.15.0/24 -j DROP
|
|
iptables -A ACCEPT_BOGON -s 172.16.0.0/12 -j ACCEPT
|
|
iptables -A ACCEPT_BOGON -s 127.0.0.0/8 -j ACCEPT
|
|
iptables -A ACCEPT_BOGON -s 169.254.0.0/16 -j ACCEPT
|
|
iptables -A ACCEPT_BOGON -s 0.0.0.0/8 -j ACCEPT
|
|
iptables -A ACCEPT_BOGON -s 240.0.0.0/4 -j ACCEPT
|
|
iptables -A ACCEPT_BOGON -s 224.0.0.0/4 -j ACCEPT
|
|
iptables -A ACCEPT_BOGON -j DROP
|
|
|
|
# Puis dans la chaîne INPUT, tu appelles cette chaîne :
|
|
iptables -A INPUT -j ACCEPT_BOGON
|
|
|
|
|
|
brctl addbr br-public
|
|
brctl stp "br-public" off
|
|
ip link set up dev "br-public"
|
|
|
|
systemctl daemon-reload
|
|
} |