TP sysres IMA2a5 2020/2021 G9 : Différence entre versions
De Wiki d'activités IMA
					
										
					
					 (→Modification du fichier de configuration)  | 
				 (→Modification du fichier de configuration)  | 
				||
| Ligne 89 : | Ligne 89 : | ||
                ]  |                 ]  | ||
  #  |   #  | ||
| + | |||
| + | |||
| + | '''Modification du fichier de configuration des points de montages /etc/fstab'''  | ||
| + |  # /etc/fstab: static file system information.  | ||
| + |  #  | ||
| + |  # <file system> <mount point>   <type>  <options>       <dump>  <pass>  | ||
| + |  proc            /proc           proc    defaults        0       0  | ||
| + |  devpts          /dev/pts        devpts  rw,noexec,nosuid,gid=5,mode=620 0  0  | ||
| + |  /dev/xvda1 none swap sw 0 0  | ||
| + |  /dev/xvda2 / ext4 noatime,nodiratime,errors=remount-ro 0 1  | ||
| + |  /dev/xvda3 /home ext4 noatime,nodiratime,errors=remount-ro 0 1  | ||
| + |  /dev/xvda4 /var ext4 noatime,nodiratime,errors=remount-ro 0 1  | ||
| + |  ~   | ||
| + |  ~  | ||
Version du 17 octobre 2020 à 18:56
By Crispin DJAMBA
Sommaire
Présentation du projet
Le projet de Systèmes et Réseaux a pour but de nous donner les rudiments nécessaires pour :
- Assurer la redondance matérielle au sein d'une infrastructure réseau
 - Gérer des partitions virtuelles
 - Créer une machine virtuelle
 - Installer un serveur web sécurisé et y déployer un site
 - Attaquer un réseau Wifi
 
Installation de la machine virtuelle avec xen sur Capbreton
Installation de la machine virtuelle
ssh root@capbreton.polytech-lille.info
Création et lancement de la machine virtuelle
xen-create-image --hostname=NightHawk --ip=193.48.57.170 --gateway=193.48.57.163 --netmask=255.255.255.240 --dir=/usr/local/xen --dist=beowulf --password=glopglop
Modification du fichier de configuration
Le fichier de configuration (vim /etc/xen/NightHawk.cfg) a été modifié pour utiliser une RAM 1024 et le bridge IMA2a5.
Si le bridge n'est pas renseignée la VM ne démarrera pas.
# 
# Configuration file for the Xen instance NightHawk, created
# by xen-tools 4.8 on Fri Sep 25 10:36:53 2020.
#
#
#  Kernel + memory size
#
kernel      = '/boot/vmlinuz-4.19.0-9-amd64'
extra       = 'elevator=noop'
ramdisk     = '/boot/initrd.img-4.19.0-9-amd64'
vcpus       = '1'
memory      = '1024'
#
#  Disk device(s).
#
root        = '/dev/xvda2 ro'
disk        = [
                 'file:/usr/local/xen/domains/NightHawk/disk.img,xvda2,w',
                 'file:/usr/local/xen/domains/NightHawk/swap.img,xvda1,w',
             ]
#
#  Physical volumes
#
#
#  Hostname
#
name        = 'NightHawk'
#
#  Networking
#
vif         = [ 'mac=00:16:3E:CC:33:F4 ,bridge=IMA2a5' ]
#
#  Behaviour
#
on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'
Lecture du fichier de config et Lancement de la machine virtuelle
xl create /etc/xen/NightHawk.cfg xl console NightHawk
Connexion à la VM
login: root mdp : glopglop
Création de deux partitions virtuelles sur le volume virtual
lvcreate -L10240M -n NightHawk_home virtual; mke2fs -t ext4 /dev/virtual/NightHawk_home lvcreate -L10240M -n NightHawk_var virtual; mke2fs -t ext4 /dev/virtual/NightHawk_var
Modification du fichier de configuration pour monter les deux partitions /home , /var comme disque dans la machine virtuelle
#  Disk device(s).
#
root        = '/dev/xvda2 ro'
home        = '/dev/xvda3 ro'
var         = '/dev/xvda4 ro'
disk        = [
                 'phy:/dev/virtual/NightHawk_var,xvda4,w',
                 'phy:/dev/virtual/NightHawk_home,xvda3,w',                
                 'file:/usr/local/xen/domains/NightHawk/disk.img,xvda2,w',
                 'file:/usr/local/xen/domains/NightHawk/swap.img,xvda1,w',
              ]
#
Modification du fichier de configuration des points de montages /etc/fstab
# /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0 /dev/xvda1 none swap sw 0 0 /dev/xvda2 / ext4 noatime,nodiratime,errors=remount-ro 0 1 /dev/xvda3 /home ext4 noatime,nodiratime,errors=remount-ro 0 1 /dev/xvda4 /var ext4 noatime,nodiratime,errors=remount-ro 0 1 ~ ~