Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
projects:livenet:server [2018/03/12 23:24] – nicola | projects:livenet:server [2018/03/13 00:14] – [BUILD IMAGE CLIENT] nicola | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Software richiesto | + | ===== Requirements |
+ | ** HW**: 2 nic device | ||
- | **Sistema operativo**: Ubuntu server 17.10 | + | **OS**: Ubuntu server 17.10 |
- | apt install bash debootstrap schroot syslinux nfs-kernel-server tftpd-hpa xorriso pigz zfsutils-linux | + | < |
- | **software facoltativo ma usato nel test** | + | **Optional config** |
+ | |||
+ | < | ||
+ | |||
+ | **network config ** | ||
+ | nano / | ||
+ | |||
+ | < | ||
+ | # This file describes the network interfaces available on your system | ||
+ | # For more information, | ||
+ | network: | ||
+ | version: 2 | ||
+ | renderer: networkd | ||
+ | ethernets: | ||
+ | ens3: | ||
+ | dhcp4: no | ||
+ | addresses: [10.1.22.2/ | ||
+ | gateway4: 192.168.122.1 | ||
+ | nameservers: | ||
+ | addresses: [8.8.8.8, | ||
+ | ens4: | ||
+ | dhcp4: yes | ||
+ | |||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | < | ||
+ | ===== Build livenet environment ===== | ||
+ | ==== Preparazione dell' | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | Download package | ||
+ | edit / | ||
+ | |||
+ | < | ||
+ | # folder that contains livenet system | ||
+ | BASE=/ | ||
+ | IMAGES=${BASE}/ | ||
+ | BOOT=${BASE}/ | ||
+ | </ | ||
+ | |||
+ | ===== Trivial FTP ===== | ||
+ | edit / | ||
+ | < | ||
+ | TFTP_USERNAME=" | ||
+ | TFTP_DIRECTORY="/ | ||
+ | TFTP_ADDRESS=" | ||
+ | TFTP_OPTIONS=" | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | |||
+ | cp -a / | ||
+ | |||
+ | cp / | ||
+ | |||
+ | edit / | ||
+ | < | ||
+ | default menu.c32 | ||
+ | prompt 0 | ||
+ | #timeout 100 | ||
+ | |||
+ | menu title PXE Special Boot Menu | ||
+ | MENU AUTOBOOT Starting Livenet in # seconds | ||
+ | |||
+ | label bootlocal | ||
+ | menu label ^Boot local disk | ||
+ | menu default | ||
+ | | ||
+ | |||
+ | label nfs | ||
+ | menu label Ubuntu 18.04 - diskless | ||
+ | | ||
+ | | ||
+ | |||
+ | label nfs | ||
+ | menu label Ubuntu 14.04 - install | ||
+ | | ||
+ | | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== BUILD IMAGE CLIENT ==== | ||
+ | zfs create livenet/ | ||
+ | debootstrap --arch amd64 bionic / | ||
+ | |||
+ | cd / | ||
+ | run .... | ||
+ | < | ||
+ | R=bionic | ||
+ | cat > ${R}/ | ||
+ | 127.0.0.1 | ||
+ | ::1 | ||
+ | ff02:: | ||
+ | ff02:: | ||
+ | QWK | ||
+ | |||
+ | chroot ${R} lsb_release -c | awk ' | ||
+ | chroot bionic/ | ||
+ | chroot ${R} apt-get -y -q install locales dialog | ||
+ | chroot ${R} locale-gen en_GB.UTF-8 | ||
+ | chroot ${R} locale-gen it_IT.UTF-8 | ||
+ | chroot ${R} update-locale LANG=it_IT.UTF-8 LANGUAGE=it: | ||
+ | echo Europe/Rome > ${R}/ | ||
+ | cp ${R}/ | ||
+ | cat > ${R}/ | ||
+ | #!/bin/sh | ||
+ | |||
+ | # dpkg/apt not start any daemons when things are installed in the chroot | ||
+ | |||
+ | if [ ! " | ||
+ | exit 101 | ||
+ | fi | ||
+ | QWE | ||
+ | |||
+ | chmod +x ${R}/ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | |||
+ | DISTR=bionic | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | |||
+ | ===== DHCP ===== | ||
+ | ==== Abilitare dhcpd su specifica scheda ==== | ||
+ | Editare la riga in | ||
+ | |||
+ | / | ||
+ | |||
+ | < | ||
+ | |||
+ | ==== Configurazione dhcpd ==== | ||
+ | editare il file / | ||
+ | al termine service isc-dhcp-service restart | ||
+ | < | ||
+ | ddns-update-style none; | ||
+ | authoritative; | ||
+ | |||
+ | option domain-name | ||
+ | option domain-name-servers | ||
+ | |||
+ | allow bootp; | ||
+ | allow booting; | ||
+ | |||
+ | option space PXE; | ||
+ | # Code 1: Multicast IP address of bootfile | ||
+ | option PXE.mtftp-ip code 1 = ip-address; | ||
+ | # Code 2: UDP port that client should monitor for MTFTP responses | ||
+ | option PXE.mtftp-cport code 2 = unsigned integer 16; | ||
+ | # Code 3: UDP port that MTFTP servers are using to listen for MTFTP requests | ||
+ | option PXE.mtftp-sport code 3 = unsigned integer 16; | ||
+ | # Code 4: Number of secondes a client must listen for activity before trying | ||
+ | # to start a new MTFTP transfer | ||
+ | option PXE.mtftp-tmout code 4 = unsigned integer 8; | ||
+ | option PXE.mtftp-delay code 5 = unsigned integer 8; | ||
+ | # Code 5: Number of secondes a client must listen before trying to restart | ||
+ | # a MTFTP transfer | ||
+ | option PXE.discovery-control code 6 = unsigned integer 8; | ||
+ | option PXE.discovery-mcast-addr code 7 = ip-address; | ||
+ | set vendor-string = option vendor-class-identifier; | ||
+ | |||
+ | class " | ||
+ | match if substring(option vendor-class-identifier, | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | class " | ||
+ | match if substring(option vendor-class-identifier, | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | class " | ||
+ | match if (substring(option vendor-class-identifier, | ||
+ | log ( info, " | ||
+ | } | ||
+ | |||
+ | shared-network " | ||
+ | subnet 10.1.22.0 netmask 255.255.255.0 { | ||
+ | option subnet-mask 255.255.255.0; | ||
+ | option routers 10.1.22.2; | ||
+ | # | ||
+ | # | ||
+ | |||
+ | pool { | ||
+ | # restringe il lease solo alla classe LIVENET | ||
+ | allow members of " | ||
+ | range 10.1.22.10 10.1.22.100; | ||
+ | filename "/ | ||
+ | next-server 10.1.22.2; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | </ | ||
- | apt install isc-dhcp-server | ||