wiki:ServBelmez

Características

  • Sistema Operativo: Rocky Linux 9.5 (Blue Onyx)
  • CPU: 2x Procesador Intel® Xeon® E5-2680
  • RAM: 64 GB

Conectividad

  • Hostname: belmezhpe01
  • FQDN: belmezhpe01.priv.uco.es
  • Interfaz eth0
    • VLAN: TODO(No sé el ID) (Aulas)
    • Dirección IP: 172.17.224.251
    • Mascara de subred: 255.255.255.0
    • Gateway: 172.17.224.254

Servicios para arranque remoto

Software instalado:

dnf install dhcp-server
dnf install tftpd
dnf install tftp-server
dnf install nfs-utils
dnf install nmap
dnf install sssd-ldap
dnf install tftp-server

Configuración de NFS

Lo primero es traerse los datos que se van a compartir por NFS desde la cabina Unity:

mount -t nfs unitynfsi.priv.uco.es:/TS3NEW /mnt
cd /mnt/TEST
rsync -aHSv --exclude deprecated/ --exclude UBUNTU64_15 --exclude LOGS/ . /var/NFS/TS3/EXP/

En el /etc/exports exportamos el directorio /TS3 a la subred 172.17.224.0/24 y a TODO(no sé que maquina es sicsop02) (150.214.110.47), mientras que /homes solo a la subred.

/TS3		172.17.224.0/255.255.255.0(ro,no_subtree_check) 150.214.110.47(rw,no_subtree_check,no_root_squash)
/homes		172.17.224.0/255.255.255.0(rw,no_subtree_check)

Configuración de TFTP

En el /etc/systemd/system/tftp-server.service (copiado y modificado de /usr/lib/systemd/system/tftp.service) indicamos lo siguiente:

[Unit]
Description=Tftp Server
Requires=tftp-server.socket
Documentation=man:in.tftpd

[Service]
ExecStart=/usr/sbin/in.tftpd -c -p -s /var/lib/tftpboot
StandardInput=socket

[Install]
Also=tftp.socket

En el caso de /etc/systemd/system/tftp-server.socket, es una copia de de /usr/lib/systemd/system/tftp.socket

Configuración de DHCP

En /etc/dhcp/dhcpd.conf simplemente añadimos lo siguiente:

include "/var/lib/tftpboot/TS3LOCAL/dhcp/aulas.dhcp";

Y en aulas.dhcp tendríamos lo siguiente:

TODO(he omitido parte del fichero porque entiendo que eso es copiado de Córdoba y no es necesario en Belmez. También habrá que descomentar el allgroups de Belmez)

shared-network VLAN948 {
  subnet 172.17.224.0 netmask 255.255.255.0 {}

  next-server 172.17.224.251;
  option boot-size 31;
  filename "TS3LOCAL/HPAULAS64-3.9_2.39/pxelinux.0";

  include "/var/lib/tftpboot/TS3LOCAL/dhcp/belmez_allgroups.dhcp";
}

Otros servicios

cron

En el /etc/crontab se invoca /usr/local/bin/crea-homes.sh los días laborales de 8 a 21 cada 5 minutos:

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
*/5 8-21  * * 1-5   root    /usr/local/bin/crea-homes.sh

El citado script se encarga de crear, si no existen, los homes de la lista de usuarios que le devuelve ldap1.priv.uco.es. En dicha máquina se ha modificado el /var/home/usulocal/.ssh/.authorized_keys para que cuando root se conecte por ssh desde belmezhpe01 ejecute /usr/bin/cut -d: -f1 /usr/local/uco/pw/pw que devuelve el listado de usuarios.

iptables

Las reglas que se han añadido han sido las siguientes:

iptables -A INPUT -p tcp --dport 2049 -j ACCEPT   # Puerto para NFS
iptables -A INPUT -p udp --dport 2049 -j ACCEPT   # UDP para NFS
iptables -A INPUT -p udp --dport 111 -j ACCEPT    # UDP para rpcbind
iptables -A INPUT -p tcp --dport 20048 -j ACCEPT  # Mountd
iptables -A INPUT -p udp --dport 20048 -j ACCEPT  # Mountd
iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited

Al final se tiene lo siguiente:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     icmp --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:nrpe
ACCEPT     udp  --  anywhere             anywhere             udp dpt:tftp
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:tftp
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:nfs
ACCEPT     udp  --  anywhere             anywhere             udp dpt:nfs
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:sunrpc
ACCEPT     udp  --  anywhere             anywhere             udp dpt:sunrpc
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:mountd
ACCEPT     udp  --  anywhere             anywhere             udp dpt:mountd
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:npp
REJECT     all  --  anywhere             anywhere             reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
REJECT     all  --  anywhere             anywhere             reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain DOCKER-USER (0 references)
target     prot opt source               destination
Last modified 3 weeks ago Last modified on Apr 21, 2025, 12:39:24 PM