admin:procedures:installation_serveur_physique
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
admin:procedures:installation_serveur_physique [2017/06/29 15:48] – [libvirt] fpoulain | admin:procedures:installation_serveur_physique [2023/11/11 19:02] (Version actuelle) – dokuwiki formatting pitchum | ||
---|---|---|---|
Ligne 6: | Ligne 6: | ||
Ne pas hésiter à lire https:// | Ne pas hésiter à lire https:// | ||
En particulier, | En particulier, | ||
- | | + | |
+ | < | ||
Cette commande permet de récupérer le nom de l' | Cette commande permet de récupérer le nom de l' | ||
Ligne 12: | Ligne 14: | ||
sur chaque disque, activer le "mode grub" | sur chaque disque, activer le "mode grub" | ||
- | | + | < |
- | > set 1 bios_grub on | + | # parted /dev/sda |
- | > quit | + | > set 1 bios_grub on |
- | # grub-install /dev/sda | + | > quit |
+ | # grub-install /dev/sda | ||
+ | </ | ||
====== libvirt ====== | ====== libvirt ====== | ||
- | Rappel : virt-manager à besoin de netcat-openbsd (enfin d'un netcat avec -U) | + | Rappel : '' |
Sur Coon : | Sur Coon : | ||
- | | + | * On édite le réseau |
+ | * Le bridge est à '' | ||
+ | * On ajoute '' | ||
+ | * On relance l' | ||
+ | * '' | ||
- | Le bridge est à 192.168.1.4 sur coon et le range dhcp est de 192.168.1.10-99 | + | ====== Firewall ====== |
- | | + | On utilisera '' |
- | On relance l' | + | <note warning> |
+ | On pensera à définir les services pour '' | ||
+ | <code bash / | ||
+ | #FHVER: 1:213 | ||
+ | # La premiere ligne ci dessus est nécessaire !! | ||
+ | server_icinga_ports=" | ||
+ | client_icinga_ports=" | ||
+ | </ | ||
+ | <code bash / | ||
+ | #FHVER: 1:213 | ||
+ | # La premiere ligne ci dessus est nécessaire !! | ||
+ | server_drbd_ports=" | ||
+ | client_drbd_ports=" | ||
+ | </ | ||
- | systemctl disable libvirt-guests pour éviter que les machines démarrent toutes seules sans action explicite | + | ===== Script |
- | 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 a un script de firewalling destiné à être identique entre maine et coon. La différence se situant au niveau de la configuration. |
- | On utilisera firehol. Pour les détails quant à l'usage, se référer à [[admin: | + | Dans le principe 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. |
- | <note warning> | + | Il faut par ailleurs gérer |
- | ===== Sur coon ===== | + | <code bash / |
+ | ################################################################################ | ||
+ | # Configuration | ||
+ | ################################################################################ | ||
- | <conf bash /etc/default/firehol> | + | myPrivateIp=" |
- | ## IPv6 | + | myPublicIp4=" |
+ | myPublicIp6=" | ||
+ | |||
+ | clusterPrivateNetwork=" | ||
+ | clusterV6Network=" | ||
+ | |||
+ | # Si vous décommentez la ligne qui suit, le firewall considérera que fip | ||
+ | # pointe sur cette machine avec l' | ||
+ | |||
+ | # fip=" | ||
+ | |||
+ | declare -A dispatching=( | ||
+ | | ||
+ | [" | ||
+ | | ||
+ | [" | ||
+ | [" | ||
+ | | ||
+ | ) | ||
+ | |||
+ | ################################################################################ | ||
+ | # / | ||
+ | ################################################################################ | ||
+ | |||
+ | ################################################################################ | ||
+ | # NAT pour ipv4 | ||
+ | ################################################################################ | ||
+ | if test -n " | ||
+ | then | ||
+ | for service in " | ||
+ | do | ||
+ | eval " | ||
+ | dport=" | ||
+ | protos=" | ||
+ | ipv4=" | ||
+ | for proto in $protos | ||
+ | do | ||
+ | ipv4 dnat to $ipv4 inface enp0s31f6 dst $fip proto $proto dport $dport | ||
+ | done | ||
+ | done | ||
+ | |||
+ | # Contrôle de l'IP de sortie | ||
+ | ipv4 snat to $fip outface enp0s31f6 | ||
+ | fi | ||
+ | |||
+ | ################################################################################ | ||
+ | # IPv6 | ||
+ | ################################################################################ | ||
ipv6 interface any v6interop proto icmpv6 | ipv6 interface any v6interop proto icmpv6 | ||
client ipv6neigh accept | client ipv6neigh accept | ||
Ligne 51: | Ligne 120: | ||
policy return | 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 destinated to fip IP. | ||
+ | ################################################################################ | ||
+ | if test -n " | ||
+ | then | ||
+ | interface enp0s31f6 fip_trafic dst4 $fip dst6 $myPublicIp6 | ||
+ | |||
+ | # The default policy is DROP. | ||
+ | policy drop | ||
+ | |||
+ | # Protection anti flood | ||
+ | protection strong | ||
+ | |||
+ | # Services acceptés | ||
+ | server ICMP accept | ||
+ | server ICMPV6 | ||
+ | |||
+ | # The following means that this machine can REQUEST anything via enp0s31f6. | ||
+ | client all accept | ||
+ | fi | ||
+ | |||
+ | ################################################################################ | ||
# EXT->ME | # EXT->ME | ||
# The purpose of this interface is to control the traffic | # The purpose of this interface is to control the traffic | ||
- | # on the enp0s31f6 interface | + | # on the enp0s31f6 interface |
- | interface enp0s31f6 external_trafic dst4 94.130.8.3 | + | ################################################################################ |
+ | interface enp0s31f6 external_trafic dst4 $myPublicIp4 | ||
- | # The default policy is DROP. | + | |
- | policy drop | + | policy drop |
- | # Protection anti flood | + | |
- | protection strong | + | protection strong |
- | # Services acceptés | + | |
- | server ICMP accept | + | |
- | server | + | |
+ | server | ||
- | # The following means that this machine can REQUEST anything via enp0s31f6. | + | |
- | client all accept | + | client all accept |
+ | ################################################################################ | ||
# LAN->ME | # LAN->ME | ||
# The purpose of this interface is to control the traffic | # The purpose of this interface is to control the traffic | ||
- | # on the enp1s0+virbr0 interface | + | # on the {enp1s0,virbr0, |
- | interface " | + | ################################################################################ |
+ | interface " | ||
- | # On est entre amis | + | |
- | # The default policy is REJECT. | + | # The default policy is REJECT. |
- | policy reject | + | policy reject |
- | # Here are the services listening on enp1s0. | + | |
- | server ICMP accept | + | server ICMP accept |
- | server dns accept | + | |
- | server ssh 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 | + | client all accept |
- | # Clients on enp0s31f6 (Internet) accessing servers on {enp1s0, | + | ################################################################################ |
- | router ext2me inface enp0s31f6 outface " | + | # Clients on enp0s31f6 (Internet) accessing servers on {enp1s0, |
- | protection strong | + | ################################################################################ |
+ | router ext2me inface enp0s31f6 outface " | ||
+ | protection strong | ||
- | # Clients on {enp1s0, | + | ################################################################################ |
- | router me2ext inface " | + | # Clients on {enp1s0, |
- | masquerade | + | ################################################################################ |
- | # If you remove it, no REQUEST will pass matching this traffic. | + | router me2ext inface " |
- | route all accept | + | masquerade |
+ | # If you remove it, no REQUEST will pass matching this traffic. | ||
+ | route all accept | ||
- | # Clients on {enp1s0, | + | ################################################################################ |
- | router me2me inface " | + | # Clients on {enp1s0, |
- | # If you remove it, no REQUEST will pass matching this traffic. | + | ################################################################################ |
+ | router me2me inface " | ||
+ | # If you remove it, no REQUEST will pass matching this traffic. | ||
route all accept | route all accept | ||
- | </ | ||
- | ===== Sur maine ===== | + | ################################################################################ |
+ | # Clients on enp0s31f6 (Internet) accessing cluster' | ||
+ | ################################################################################ | ||
+ | if test -n " | ||
+ | then | ||
+ | for service in " | ||
+ | do | ||
+ | eval "srv=${dispatching[$service]}" | ||
+ | dport=" | ||
+ | protos=" | ||
+ | ipv4=" | ||
+ | ipv6=" | ||
+ | for proto in $protos | ||
+ | do | ||
+ | router " | ||
+ | protection strong | ||
+ | server $service accept | ||
+ | done | ||
+ | done | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | ===== Configuration sur coon ===== | ||
+ | |||
+ | <code bash / | ||
+ | ################################################################################ | ||
+ | # Configuration | ||
+ | ################################################################################ | ||
+ | |||
+ | myPrivateIp=" | ||
+ | myPublicIp4=" | ||
+ | myPublicIp6=" | ||
+ | |||
+ | clusterPrivateNetwork=" | ||
+ | clusterV6Network=" | ||
+ | |||
+ | # Si vous décommentez la ligne qui suit, le firewall considérera que fip | ||
+ | # pointe sur cette machine avec l' | ||
+ | |||
+ | # fip=" | ||
+ | |||
+ | declare -A dispatching=( | ||
+ | | ||
+ | [" | ||
+ | | ||
+ | [" | ||
+ | [" | ||
+ | | ||
+ | ) | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Configuration sur maine ===== | ||
+ | |||
+ | <code bash / | ||
+ | ################################################################################ | ||
+ | # Configuration | ||
+ | ################################################################################ | ||
+ | |||
+ | myPrivateIp=" | ||
+ | myPublicIp4=" | ||
+ | myPublicIp6=" | ||
+ | |||
+ | clusterPrivateNetwork=" | ||
+ | clusterV6Network=" | ||
+ | # Si vous décommentez la ligne qui suit, le firewall considérera que fip | ||
+ | # pointe sur cette machine avec l' | ||
+ | fip=" | ||
+ | declare -A dispatching=( | ||
+ | | ||
+ | [" | ||
+ | | ||
+ | [" | ||
+ | [" | ||
+ | | ||
+ | ) | ||
+ | </ |
admin/procedures/installation_serveur_physique.1498751301.txt.gz · Dernière modification : 2017/06/29 15:48 de fpoulain