informatica:certificaciones:lpic:lpic-2:lab
Diferencias
Muestra las diferencias entre dos versiones de la página.
| Próxima revisión | Revisión previa | ||
| informatica:certificaciones:lpic:lpic-2:lab [2021/03/24 19:38] – creado tempwin | informatica:certificaciones:lpic:lpic-2:lab [2021/04/02 13:21] (actual) – tempwin | ||
|---|---|---|---|
| Línea 2: | Línea 2: | ||
| Laboratorio para el curso de LPIC-2 | Laboratorio para el curso de LPIC-2 | ||
| + | |||
| + | Necesario tener instalado: | ||
| + | |||
| + | * [[informatica: | ||
| + | * [[informatica: | ||
| El entorno virtualizado se compone de 3 máquinas virtuales: | El entorno virtualizado se compone de 3 máquinas virtuales: | ||
| - | ^ Sistema Operativo | + | ^ Sistema Operativo |
| - | | Centos 7.2 | 192.168.2.5 | + | | Centos 7.2 | 192.168.2.5 |
| - | | Debian 10 | 192.168.2.10 | + | | Debian 10 | 192.168.2.10 |
| - | | Centos 6.7 | 192.168.2.152 | | + | | Centos 6.7 | 192.168.2.152 |
| Las credenciales: | Las credenciales: | ||
| Línea 19: | Línea 24: | ||
| * Usuario: '' | * Usuario: '' | ||
| * Contraseña: | * Contraseña: | ||
| + | |||
| + | <WRAP center round important 60%> | ||
| + | En la máquina con Debian no podemos conectarnos vía SSH con la cuenta de root, así que habrá que entrar con la de '' | ||
| + | </ | ||
| + | |||
| + | ===== Despliegue del entorno ===== | ||
| + | |||
| + | Necesitamos un fichero llamado '' | ||
| + | |||
| + | < | ||
| + | # CentOS-Base.repo | ||
| + | # | ||
| + | # The mirror system uses the connecting IP address of the client and the | ||
| + | # update status of each mirror to pick mirrors that are updated to and | ||
| + | # geographically close to the client. | ||
| + | # unless you are manually picking other mirrors. | ||
| + | # | ||
| + | # If the mirrorlist= does not work for you, as a fall back you can try the | ||
| + | # remarked out baseurl= line instead. | ||
| + | # | ||
| + | # | ||
| + | |||
| + | [base] | ||
| + | name=CentOS-$releasever - Base | ||
| + | mirrorlist=http:// | ||
| + | # | ||
| + | baseurl=https:// | ||
| + | gpgcheck=1 | ||
| + | gpgkey=file:/// | ||
| + | |||
| + | #released updates | ||
| + | [updates] | ||
| + | name=CentOS-$releasever - Updates | ||
| + | mirrorlist=http:// | ||
| + | # | ||
| + | baseurl=https:// | ||
| + | gpgcheck=1 | ||
| + | gpgkey=file:/// | ||
| + | |||
| + | #additional packages that may be useful | ||
| + | [extras] | ||
| + | name=CentOS-$releasever - Extras | ||
| + | mirrorlist=http:// | ||
| + | # | ||
| + | baseurl=https:// | ||
| + | gpgcheck=1 | ||
| + | gpgkey=file:/// | ||
| + | |||
| + | #additional packages that extend functionality of existing packages | ||
| + | [centosplus] | ||
| + | name=CentOS-$releasever - Plus | ||
| + | mirrorlist=http:// | ||
| + | # | ||
| + | baseurl=https:// | ||
| + | gpgcheck=1 | ||
| + | enabled=0 | ||
| + | gpgkey=file:/// | ||
| + | |||
| + | #contrib - packages by Centos Users | ||
| + | [contrib] | ||
| + | name=CentOS-$releasever - Contrib | ||
| + | mirrorlist=http:// | ||
| + | # | ||
| + | baseurl=https:// | ||
| + | gpgcheck=1 | ||
| + | enabled=0 | ||
| + | gpgkey=file:/// | ||
| + | </ | ||
| + | |||
| + | El entorno se monta mediante un '' | ||
| + | |||
| + | <code ruby> | ||
| + | # -*- mode: ruby -*- | ||
| + | # vi: set ft=ruby : | ||
| + | |||
| + | ## | ||
| + | ##Pass: vagrant | ||
| + | |||
| + | ##user:root | ||
| + | ## | ||
| + | Vagrant.configure(" | ||
| + | config.vm.define " | ||
| + | config.vm.boot_timeout = 400 | ||
| + | centos7.vm.box = " | ||
| + | # | ||
| + | centos7.vm.network " | ||
| + | centos7.vm.hostname = " | ||
| + | | ||
| + | end | ||
| + | |||
| + | config.vm.define " | ||
| + | debian.vm.box = " | ||
| + | config.vm.boot_timeout = 400 | ||
| + | # | ||
| + | debian.vm.network " | ||
| + | debian.vm.hostname = " | ||
| + | # | ||
| + | # SHELL | ||
| + | | ||
| + | end | ||
| + | |||
| + | |||
| + | config.vm.define " | ||
| + | centos6.vm.box = " | ||
| + | config.vm.boot_timeout = 400 | ||
| + | # | ||
| + | centos6.vm.network " | ||
| + | centos6.vm.hostname = " | ||
| + | centos6.vm.provision " | ||
| + | rm -rf / | ||
| + | cp / | ||
| + | yum clean all | ||
| + | SHELL | ||
| + | | ||
| + | end | ||
| + | |||
| + | end | ||
| + | </ | ||
| + | |||
| + | Lo creamos con: | ||
| + | |||
| + | <code bash> | ||
| + | vagrant up | ||
| + | </ | ||
| + | |||
| + | Para detener todas las máquinas: | ||
| + | |||
| + | <code bash> | ||
| + | vagrant halt | ||
| + | </ | ||
| + | |||
| + | Si queremos suspenderlas: | ||
| + | |||
| + | <code bash> | ||
| + | vagrant suspend | ||
| + | </ | ||
| + | |||
| + | Si queremos reanudar la ejecución (tras una suspensión): | ||
| + | |||
| + | <code bash> | ||
| + | vagrant resume | ||
| + | </ | ||
| + | |||
| + | Destruir todas las máquinas: | ||
| + | |||
| + | <code bash> | ||
| + | vagrant destroy -f | ||
| + | </ | ||
| + | |||
| + | ==== Configuración host ==== | ||
| + | |||
| + | **Centos 7**: | ||
| + | |||
| + | <code bash> | ||
| + | hostnamectl set-hostname sercentos7.curso.esp | ||
| + | </ | ||
| + | |||
| + | Contenido de ''/ | ||
| + | |||
| + | < | ||
| + | sercentos7.curso.esp | ||
| + | </ | ||
| + | |||
| + | Modificar ''/ | ||
| + | |||
| + | < | ||
| + | 127.0.0.1 | ||
| + | ::1 | ||
| + | 192.168.2.5 sercentos7.curso.esp sercentos7 | ||
| + | 192.168.2.152 orion.curso.esp orion | ||
| + | 192.168.2.10 debian10.curso.esp debian10 | ||
| + | </ | ||
| + | |||
| + | Deshabilitar SELinux en ''/ | ||
| + | |||
| + | < | ||
| + | SELINUX=disabled | ||
| + | </ | ||
| + | |||
| + | |||
| + | En **Debian 10**: | ||
| + | |||
| + | <code bash> | ||
| + | hostnamectl set-hostname debian10.curso.esp | ||
| + | </ | ||
| + | |||
| + | Modificar ''/ | ||
| + | |||
| + | < | ||
| + | 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 | ||
| + | ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 | ||
| + | 192.168.2.10 | ||
| + | 192.168.2.5 | ||
| + | 192.168.2.152 | ||
| + | </ | ||
| + | |||
| + | En **Centos 6**: | ||
| + | |||
| + | Editar ''/ | ||
| + | |||
| + | < | ||
| + | NETWORKING=yes | ||
| + | HOSTNAME=orion.curso.esp | ||
| + | </ | ||
| + | |||
| + | Modificar ''/ | ||
| + | |||
| + | < | ||
| + | 127.0.0.1 | ||
| + | ::1 | ||
| + | 192.168.2.5 | ||
| + | 192.168.2.152 | ||
| + | 192.168.2.10 | ||
| + | </ | ||
| + | |||
| + | Deshabilitar SELinux en ''/ | ||
| + | |||
| + | < | ||
| + | SELINUX=disabled | ||
| + | </ | ||
| + | ==== Configuración NTP ==== | ||
| + | |||
| + | En **Centos 7**: | ||
| + | |||
| + | Instalamos ntp: | ||
| + | |||
| + | <code bash> | ||
| + | yum install ntp -y | ||
| + | </ | ||
| + | |||
| + | Establecemos la zona horaria: | ||
| + | |||
| + | <code bash> | ||
| + | timedatectl set-timezone " | ||
| + | </ | ||
| + | |||
| + | Editamos el fichero ''/ | ||
| + | |||
| + | < | ||
| + | server 0.es.pool.ntp.org iburst | ||
| + | server 1.es.pool.ntp.org iburst | ||
| + | server 2.es.pool.ntp.org iburst | ||
| + | server 3.es.pool.ntp.org iburst | ||
| + | </ | ||
| + | |||
| + | Arrancamos servicio y lo habilitamos al arranque NTP: | ||
| + | |||
| + | <code bash> | ||
| + | systemctl start ntpd | ||
| + | systemctl enable ntpd | ||
| + | </ | ||
| + | |||
| + | Sincronizamos: | ||
| + | |||
| + | <code bash> | ||
| + | timedatectl set-ntp true | ||
| + | ntpq -p | ||
| + | </ | ||
| + | |||
| + | En **Centos 6**: | ||
| + | |||
| + | <code bash> | ||
| + | yum install ntp -y | ||
| + | cp / | ||
| + | rm -rf / | ||
| + | ln -s / | ||
| + | </ | ||
| + | |||
| + | Editamos ''/ | ||
| + | |||
| + | < | ||
| + | server 0.es.pool.ntp.org iburst | ||
| + | server 1.es.pool.ntp.org iburst | ||
| + | server 2.es.pool.ntp.org iburst | ||
| + | server 3.es.pool.ntp.org iburst | ||
| + | </ | ||
| + | |||
| + | Arrancamos servicio y lo habilitamos al arranque NTP: | ||
| + | |||
| + | <code bash> | ||
| + | service ntpd start | ||
| + | chkconfig --level 3 ntpd on | ||
| + | </ | ||
| + | |||
| + | En **Debian 10**: | ||
| + | |||
| + | <code bash> | ||
| + | apt-get update | ||
| + | apt-get install ntp -y | ||
| + | timedatectl set-timezone " | ||
| + | </ | ||
| + | |||
| + | Editamos el fichero ''/ | ||
| + | |||
| + | < | ||
| + | server 0.es.pool.ntp.org iburst | ||
| + | server 1.es.pool.ntp.org iburst | ||
| + | server 2.es.pool.ntp.org iburst | ||
| + | server 3.es.pool.ntp.org iburst | ||
| + | </ | ||
| + | |||
| + | Arrancamos servicio y lo habilitamos al arranque NTP: | ||
| + | |||
| + | <code bash> | ||
| + | systemctl start ntp | ||
| + | systemctl enable ntp | ||
| + | timedatectl set-ntp true | ||
| + | ntpq -p | ||
| + | </ | ||
informatica/certificaciones/lpic/lpic-2/lab.1616611088.txt.gz · Última modificación: por tempwin
