Ceci est une ancienne révision du document !
système
guide suivi pour l'installation initiale (avec serveur en rescue) : https://www.debian.org/releases/stretch/amd64/apds03.html.fr
Ne pas hésiter à lire https://www.debian.org/releases/stretch/amd64/release-notes/ pour les notes de versions. En particulier, pour la configuration réseau, attention au nom des interfaces réseaux :
udevadm test-builtin net_id /sys/class/net/eth0 2> /dev/null
Cette commande permet de récupérer le nom de l'interface dans le nouveau format ( https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ )
/!\ ne pas oublier d'installer mdadm + lvm2 avant grub
sur chaque disque, activer le “mode grub”
# parted /dev/sda > set 1 bios_grub on > quit # grub-install /dev/sda
libvirt
Rappel : virt-manager à besoin de netcat-openbsd (enfin d'un netcat avec -U)
Sur Coon :
On édite le réseau defautl : virsh net-edit default ; virsh net-destroy default ; virsh net-start default
Le bridge est à 192.168.1.4 sur coon et le range dhcp est de 192.168.1.10-99
On ajoute enp1s0 dans le bridge : brctl addif enp1s0 virbr0
On relance l'interface enp1s0 : ifup enp1s0
systemctl disable libvirt-guests pour éviter que les machines démarrent toutes seules sans action explicite d'un admin (ce qui ne devrait pas être possible, car le point de montage de la partition des qcow ne peut pas être monté automatiquement
Firewall
On utilisera firehol. Pour les détails quant à l'usage, se référer à Un firewall simple pour le chaton.
On pensera à définir les services pour drbd et icinga :
- /etc/firehol/services/icinga.conf
#FHVER: 1:213 # La premiere ligne ci dessus est nécessaire !! server_icinga_ports="tcp/5665" client_icinga_ports="default"
- /etc/firehol/services/drdb.conf
#FHVER: 1:213 # La premiere ligne ci dessus est nécessaire !! server_drbd_ports="tcp/7788 tcp/7789" client_drbd_ports="default"
Sur coon
On reste permissif : même si les routes ne sont pas censées être celles là, on n'empêche pas de sortir du cluster via enp0s31f6.
- /etc/firehol/firehol.conf
## IPv6 ipv6 interface any v6interop proto icmpv6 client ipv6neigh accept server ipv6neigh accept policy return # DHCP interface4 virbr0 dhcp policy return server dhcp accept # EXT->ME # The purpose of this interface is to control the traffic # on the enp0s31f6 interface with IP 94.130.8.3. interface enp0s31f6 external_trafic dst4 94.130.8.3 dst6 2a01:4f8:10b:c42::/64 # The default policy is DROP. policy drop # Protection anti flood protection strong # Services acceptés server ICMP accept server ICMPV6 accept server ssh accept # The following means that this machine can REQUEST anything via enp0s31f6. client all accept # LAN->ME # The purpose of this interface is to control the traffic # on the {enp1s0,virbr0,virbr1} interface with IP 192.168.1.{3,5} (net: "192.168.1.0/24 "). interface "enp1s0 virbr0 virbr1" internal_trafic src4 "192.168.1.0/24" dst4 "192.168.1.3 192.168.1.5" src6 "2a01:4f8:10b:c41::/64 2a01:4f8:10b:c42::/64" dst6 2a01:4f8:10b:c42::/64 # On est entre amis # The default policy is REJECT. policy reject # Here are the services listening on enp1s0. server ICMP accept server ICMPV6 accept server dns accept server ssh accept server dhcp accept server dhcpv6 accept server icinga accept server drbd accept # The following means that this machine can REQUEST anything via enp1s0. client all accept # Clients on enp0s31f6 (Internet) accessing servers on {enp1s0,virbr0,virbr1} (LAN). router ext2me inface enp0s31f6 outface "enp1s0 virbr0 virbr1" protection strong # Clients on {enp1s0,virbr0,virbr1} (LAN) accessing servers on enp0s31f6 (Internet). router me2ext inface "enp1s0 virbr0 virbr1" outface enp0s31f6 masquerade # If you remove it, no REQUEST will pass matching this traffic. route all accept # Clients on {enp1s0,virbr0,virbr1} (LAN) accessing servers on {enp1s0,virbr0,virbr1} (LAN). router me2me inface "enp1s0 virbr0 virbr1" outface "enp1s0 virbr0 virbr1" # If you remove it, no REQUEST will pass matching this traffic. route all accept
Sur maine
Sur maine on met le même firewall que sur coon, mutatis mutandis.
Il faut par ailleurs ajouter le dnat sur l'ip de FIP. On le fait en premier car c'est une contrainte de la conf de firehol. Ensuite il faut penser dans les routeurs comme si la dst était changée, ce qui implique de faire des routeurs fip2bastion, fip2mail, etc. Le bon goût de cette conséquence est que la gestion ipv6 est assez bien intégrée. On contrôle l'IP de sortie du cluster avec une règle de SNAT.
- /etc/firehol/firehol.conf
# NAT # NB: en plus du NAT il faut ouvrir les filtres. # cf les router4 fip2bastion, fip2mail, etc. ipv4 dnat to 192.168.1.93 inface enp0s31f6 dst 88.99.233.240 proto tcp dport 22 ipv4 dnat to 192.168.1.57 inface enp0s31f6 dst 88.99.233.240 proto tcp dport 25 ipv4 dnat to 192.168.1.53 inface enp0s31f6 dst 88.99.233.240 proto tcp dport 53 ipv4 dnat to 192.168.1.53 inface enp0s31f6 dst 88.99.233.240 proto udp dport 53 ipv4 dnat to 192.168.1.93 inface enp0s31f6 dst 88.99.233.240 proto tcp dport 80 ipv4 dnat to 192.168.1.93 inface enp0s31f6 dst 88.99.233.240 proto tcp dport 443 ipv4 dnat to 192.168.1.70 inface enp0s31f6 dst 88.99.233.240 proto tcp dport 5663 # Contrôle de l'IP de sortie ipv4 snat to 88.99.233.240 outface enp0s31f6 # IPv6 ipv6 interface any v6interop proto icmpv6 client ipv6neigh accept server ipv6neigh accept policy return # DHCP interface4 virbr0 dhcp policy return server dhcp accept # FIP -> ME # The purpose of this interface is to control the traffic # on the enp0s31f6 interface with IP 88.99.233.240. interface enp0s31f6 fip_trafic dst4 88.99.233.240 dst6 2a01:4f8:10b:c41::/64 # The default policy is DROP. policy drop # Protection anti flood protection strong # Services acceptés server ICMP accept server ICMPV6 accept # The following means that this machine can REQUEST anything via enp0s31f6. client all accept # EXT->ME # The purpose of this interface is to control the traffic # on the enp0s31f6 interface with IP 94.130.8.2. interface enp0s31f6 external_trafic dst4 94.130.8.2 dst6 2a01:4f8:10b:c41::/64 # The default policy is DROP. policy drop # Protection anti flood protection strong # Services acceptés server ssh accept server ICMP accept server ICMPV6 accept # The following means that this machine can REQUEST anything via enp0s31f6. client all accept # LAN->ME # The purpose of this interface is to control the traffic # on the {enp1s0,virbr0,virbr1} interface with IP 192.168.1.{3,5} (net: "192.168.1.0/24 "). interface "enp1s0 virbr0 virbr1" internal_trafic src4 "192.168.1.0/24" dst4 "192.168.1.2 192.168.1.4" src6 "2a01:4f8:10b:c41::/64 2a01:4f8:10b:c42::/64" dst6 2a01:4f8:10b:c41::/64 # On est entre amis # The default policy is REJECT. policy reject # Here are the services listening on enp1s0. server ICMP accept server ICMPV6 accept server dns accept server ssh accept server dhcp accept server dhcpv6 accept server icinga accept server drbd accept # The following means that this machine can REQUEST anything via enp1s0. client all accept # Clients on enp0s31f6 (Internet) accessing servers on {enp1s0,virbr0,virbr1} (LAN). router ext2me inface enp0s31f6 outface "enp1s0 virbr0 virbr1" protection strong # Clients on enp0s31f6 (Internet) accessing servers on bastion. router fip2bastion inface enp0s31f6 outface "virbr0 virbr1" dst4 192.168.1.93 dst6 2a01:4f8:10b:c41:5054:ff:fe08:48ff protection strong server http accept server https accept server ssh accept # Clients on enp0s31f6 (Internet) accessing servers on mail. router fip2mail inface enp0s31f6 outface "virbr0 virbr1" dst4 192.168.1.57 dst6 2a01:4f8:10b:c42:5054:ff:fec3:b9c7 protection strong server smtp accept # Clients on enp0s31f6 (Internet) accessing servers on dns. router fip2dns inface enp0s31f6 outface "virbr0 virbr1" dst4 192.168.1.53 dst6 2a01:4f8:10b:c42:5054:ff:fe08:3282 protection strong server dns accept # Clients on enp0s31f6 (Internet) accessing servers on admin. router fip2admin inface enp0s31f6 outface "virbr0 virbr1" dst4 192.168.1.70 dst6 2a01:4f8:10b:c41:5054:ff:fe9b:6f27 protection strong server icinga accept # Clients on {enp1s0,virbr0,virbr1} (LAN) accessing servers on enp0s31f6 (Internet). router me2ext inface "enp1s0 virbr0 virbr1" outface enp0s31f6 masquerade # If you remove it, no REQUEST will pass matching this traffic. route all accept # Clients on {enp1s0,virbr0,virbr1} (LAN) accessing servers on {enp1s0,virbr0,virbr1} (LAN). router me2me inface "enp1s0 virbr0 virbr1" outface "enp1s0 virbr0 virbr1" # If you remove it, no REQUEST will pass matching this traffic. route all accept