Instalar UBUNTU desde red usando UBUNTU como servidor

¿En qué podemos ayudarte?
< Regresar
Estás aquí:
Imprimir

Pre Requisitos

  1. Se recomienda no usar la red inalambrica ya que es muy lento y pude haber corrupción en la instalación.

Requerimientos

  1. Actualizar el sistema
  2. Instalar syslinux-common, syslinux-efi, isc-dhcp-server, tftpd-hpa, nfs-kernel-server
  3. Crea directorios y Copiar archivos de sistema.
  4. Crear y modificar configuraciones
  5. Descargar imagen de OS
  6. Probar la configuración

Actualizar sistema

# sudo apt-get update

#sudo apt-get upgrade

Instalar componentes

#sudo apt-get install -y syslinux-common syslinux-efi isc-dhcp-server tftpd-hpa nfs-kernel-server

Crea directorios y Copiar archivos de sistema

#sudo mkdir /pxeboot

#cd /usr/lib/syslinux/modules/efi64/

#sudo cp ldlinux.e64 /pxeboot/

#sudo cp {libutil.c32,menu.c32} /pxeboot/

#cd /usr/lib/SYSLINUX.EFI/efi64/

#sudo cp syslinux.efi /pxeboot/

#cd /pxeboot/

#sudo mkdir pxelinux.cfg

 

Configuracion del servicio tftpd

 

# sudo nano /etc/default/tftpd-hpa

# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/pxeboot"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure"

 

Si hay fairwall corriendo validar que el puerto 69 este abierto

 

# sudo systemctl restart tftpd-hpa

# sudo systemctl status tftpd-hpa

 

Configuración del servicio dhcp

 

Solo debe existir un servicio de dhcp en la red, si el router o modem puede dar configuraciones de boot en la red entonces hacerlo ahi, de lo contrario configurara el dhcp como sige:

# sudo nano /etc/dhcp/dhcpd.conf

# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
# Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as
# configuration file instead of this file.
#
# My subnet configuration
subnet 192.168.100.0 netmask 255.255.255.0 {
        range 192.168.100.200 192.168.100.250;
        option routers 192.168.100.1;
        default-lease-time 3600;
        max-lease-time 86400;
        next-server 192.168.100.48;
        option bootfile-name "syslinux.efi";
}

host 3400Dell {
   hardware ethernet 2c:ea:7f:29:6d:dc;
   fixed-address 192.168.100.48;
  }
# option definitions common to all supported networks...
option domain-name "example.org";
option domain-name-servers 1.1.1.1, 1.0.0.1;

#default-lease-time 600;
#max-lease-time 7200;

# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;

 

# sudo nano /etc/default/isc-dhcp-server

# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)

# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf

# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPDv4_PID=/var/run/dhcpd.pid
#DHCPDv6_PID=/var/run/dhcpd6.pid

# Additional options to start dhcpd with.
#       Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="enp1s0"
INTERFACESv6=""

 

El parámetro de la interfase se obtiene del comando “ip a”, con esto especificamos porue interfase se quire que se propague el dhcp

#sudo systemctl start isc-dhcp-server

#sudo systemctl status isc-dhcp-server

 

Descargar la imagen en un directorio que no sea /pxeboot

#cd ~/imagenes/

#wget https://releases.ubuntu.com/jammy/ubuntu-22.04.4-live-server-amd64.iso

#sudo mkdir -pv /pxeboot/images

#sudo mount -o loop ubuntu-22.04.4-live-server-amd64.iso /mnt

#sudo rsync -avz /mnt/ /pxeboot/images/ubuntu-22.04

 

configurar nfs

#sudo nano /etc/exports

 

# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/pxeboot *(ro,sync,no_wdelay,insecure_locks,no_root_squash,insecure,no_subtree_check)

 

#sudo exportfs -av

 

configurar archivo default del pxeboot

 

#cd /pxeboot/pxelinux.cfg/

#sudo nano default

UI menu.c32
LABEL Ubuntu 22.04 Net boot
MENU LABEL Ubuntu 22.04
KERNEL images/ubuntu-22.04/casper/vmlinuz
initrd images/ubuntu-22.04/casper/initrd
append ip=dhcp netboot=nfs nfsroot=192.168.100.48:/pxeboot/images/ubuntu-22.04 ro boot=casper ---
TEXT HELP
Ubuntu 22.04 minimal installation
ENDTEXT
 

# sudo systemctl restart tftpd-hpa

# sudo systemctl status tftpd-hpa

Table of Contents

Deja un comentario