Páginas

jueves, 10 de diciembre de 2015

PXE Servidor FreeBSD

Instalar OpenBSD Soekris net 5501 FreeBSD.

Disco duro Intel SSD Serie 320 Sata II - 40 GB

Creación de un servidor de arranque de Red FreeBSD PXE

Necesita:
Habilitar SSH
Servidor DHCP
Servidor TFTP
Null modem cable
USB serial converter cable
Es un servidor FreeBSD con dos NIC una para el acceso desde la red externa
(em1 - WAN = 192.168.1.0/24), y otra para actuar como servidor de la red de arranque
(em0 - LAN = 192.168.3.0/24). IPFilter Firewall.
Salida VGA

Conectar al servidor para su configuración :
# ssh 192.168.3.1

Servidor dhcp

# pkg install isc-dhcp42-server
# echo 'dhcpd_enable="YES"'>>/etc/rc.conf
# echo 'dhcpd_ifaces="em0"'>>/etc/rc.conf

$ sed -e '/^[ ]*#/d' -e '/^$/d' /usr/local/etc/dhcpd.conf


Archivo /etc/rc.conf

Servidor tftpd

# sed -e '/^[ ]*#/d' -e '/^$/d' /etc/inetd.conf
tftp dgram udp wait root /usr/libexec/tftpd tftpd -l -s /tftpboot


Archivo /etc/resolv.conf servidor

search unix.bcn
nameserver 127.0.0.1
nameserver 208.67.222.222
nameserver 208.67.220.220
options edns0

Archivo /etc/resolv.conf cliente
search unix.bcn
nameserver 192.168.1.1
lookup file bind

# sockstat -4 | grep inetd
root     inetd      702   5  udp4   *:69  *:*
# mkdir /tftpboot
# chmod 755 /tftpboot

Comprobar tftp desde el cliente:
$ hostname
openBSD.unix.bcn
$ tftp 192.168.3.1
tftp> get index.txt
Received 1380 bytes in 0.1 seconds
tftp> quit
$

Descargar archivos del servidor OpenBSD 5.7 i386 (soekris net5501)

# cd /tftpboot
# fetch http://mirror.codigo23.net/pub/OpenBSD/5.7/i386/index.txt
index.txt                                     100% of 1489  B   35 kBps 00m00s
Successfully retrieved file.

Bajar todos los ficheros listados dentro de index.txt
# cat index.txt | grep -v '.iso' | tee index.txt | while read file ;  do \
>  ftp http://mirror.roothell.org/pub/OpenBSD/5.7/i386/"$file" \
> done
100% |********************************************************************************|   106 KB    00:00  
100% |********************************************************************************| 22356       00:00  
100% |********************************************************************************|  1022       00:00  
100% |********************************************************************************| 46941 KB    00:27  
100% |********************************************************************************|  6539 KB    00:02  
100% |********************************************************************************|  6558 KB    00:03  
100% |********************************************************************************|  5461 KB    00:02  
100% |********************************************************************************|
...

Ahora crear el fichero /etc/boot.conf con este contenido:
stty com0 19200
set tty com0

Soekris utiliza esta configuración para poder acceder a la consola serie. Después de que su servidor de instalación se haya reiniciado, el proceso es el mismo que en una instalación normal.

Nota: Las tarjetas Compact Flash conectan a 115,200. Algo así:
# cu -l /dev/ttyU0 -s 115,200

Bibliografía:
http://wiki.soekris.info/Connecting_to_the_serial_console
http://dustingram.com/articles/2009/08/25/creating-a-freebsd-pxe-network-boot-server/
http://meinit.nl/install-your-soekris-or-any-other-machine-openbsd-using-openbsd

Unix es genial!.

No hay comentarios:

Publicar un comentario