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 | ||
| docs:guide-user:services:tftp.pxe-server [2018/03/04 07:56] – better title and intro bobafetthotmail | docs:guide-user:services:tftp.pxe-server [2023/12/24 12:46] – [PXE-Boot network boot server] add a reference to USB drives quickstart akostadinov | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== PXE-Boot network boot server ===== | + | The word NetBoot can be applied to multiple concepts, see [[inbox: |
| - | You can use your OpenWRT | + | |
| + | ====== PXE-Boot network boot server | ||
| + | Note: you can also check [[: | ||
| + | |||
| + | You can use your OpenWrt | ||
| Possibilities: | Possibilities: | ||
| * Boot Ubuntu / Debian / CentOS Live Systems | * Boot Ubuntu / Debian / CentOS Live Systems | ||
| Line 7: | Line 11: | ||
| * boot a Windows image prepared for network boot (not described in this tutorial) | * boot a Windows image prepared for network boot (not described in this tutorial) | ||
| - | The following example shows how to provide PXE-Booting for Ubuntu Live System on an OpenWRT | + | The following example shows how to provide PXE-Booting for Ubuntu Live System on an OpenWrt |
| Basic idea: | Basic idea: | ||
| Line 16: | Line 20: | ||
| Booting other Linux based distributions is not very different, only the boot parameters differ and can be found everywhere on the internet. | Booting other Linux based distributions is not very different, only the boot parameters differ and can be found everywhere on the internet. | ||
| - | The following instructions have been done step-by-step on an OpenWRT | + | The following instructions have been done step-by-step on an OpenWrt |
| - | ==== 1. Install Mass Storage==== | + | ===== 1. Install Mass Storage |
| Install USB-Support | Install USB-Support | ||
| - | < | + | < |
| Show connected USB-Devices | Show connected USB-Devices | ||
| < | < | ||
| - | root@OpenWRT:~# lsusb | + | root@OpenWrt:~# lsusb |
| Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub | Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub | ||
| Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB | Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB | ||
| Line 36: | Line 40: | ||
| For more information on NTFS see [[docs: | For more information on NTFS see [[docs: | ||
| < | < | ||
| - | root@OpenWRT:~# ls -l /dev/sd* | + | root@OpenWrt:~# ls -l /dev/sd* |
| brw-r--r-- | brw-r--r-- | ||
| brw-r--r-- | brw-r--r-- | ||
| Line 42: | Line 46: | ||
| Create mountpoint for usbdevice | Create mountpoint for usbdevice | ||
| < | < | ||
| - | root@OpenWRT:~# mkdir / | + | root@OpenWrt:~# mkdir / |
| </ | </ | ||
| Enable automatic mounting of external USB Storage. For additional Information see [[docs: | Enable automatic mounting of external USB Storage. For additional Information see [[docs: | ||
| < | < | ||
| - | root@OpenWRT:~# vim / | + | root@OpenWrt:~# vim / |
| config global automount | config global automount | ||
| option from_fstab 1 | option from_fstab 1 | ||
| Line 61: | Line 65: | ||
| option enabled_fsck 0 | option enabled_fsck 0 | ||
| </ | </ | ||
| - | Now enable start of fstab-service on boot of OpenWRT | + | Now enable start of fstab-service on boot of OpenWrt |
| < | < | ||
| - | root@OpenWRT:~# / | + | root@OpenWrt:~# / |
| </ | </ | ||
| Start fstab this time manually | Start fstab this time manually | ||
| < | < | ||
| - | root@OpenWRT:~# / | + | root@OpenWrt:~# / |
| </ | </ | ||
| Verify that the USB Mass Storage /dev/sda1 is mounted to / | Verify that the USB Mass Storage /dev/sda1 is mounted to / | ||
| < | < | ||
| - | root@OpenWRT:~# mount | grep extstorage | + | root@OpenWrt:~# mount | grep extstorage |
| /dev/sda1 on / | /dev/sda1 on / | ||
| </ | </ | ||
| For testing purposes, touch a file on the usb-stick and reboot OpenWrt router: | For testing purposes, touch a file on the usb-stick and reboot OpenWrt router: | ||
| < | < | ||
| - | root@OpenWRT:~# touch / | + | root@OpenWrt:~# touch / |
| - | root@OpenWRT:~# reboot | + | root@OpenWrt:~# reboot |
| </ | </ | ||
| After the reboot you should be able to verify again that the USB Mass Storage is mounted to / | After the reboot you should be able to verify again that the USB Mass Storage is mounted to / | ||
| - | ==== 2. Prepare files for PXE-Booting ==== | + | ===== 2. Prepare files for PXE-Booting |
| Generate TFTP-Boot folder structure and files: | Generate TFTP-Boot folder structure and files: | ||
| < | < | ||
| - | root@OpenWRT:~# cd / | + | root@OpenWrt:~# cd / |
| - | root@OpenWRT:~# mkdir tftp tftp/ | + | root@OpenWrt:~# mkdir tftp tftp/ |
| </ | </ | ||
| Now you have to download syslinux. | Now you have to download syslinux. | ||
| Download [[https:// | Download [[https:// | ||
| - | Direct-Link to 13-Oct-2013 [[https:// | + | Direct-Link to 13-Oct-2013 [[https:// |
| - | The basic wget from OpenWRT | + | The basic wget from OpenWrt |
| - | Because the basic OpenWRT | + | Because the basic OpenWrt |
| < | < | ||
| - | root@OpenWRT:~# opkg update | + | root@OpenWrt:~# opkg update |
| - | root@OpenWRT:~# opkg install wget tar | + | root@OpenWrt:~# opkg install wget tar |
| </ | </ | ||
| - | Now we can download the syslinux archive and extract it. We do not have the public SSL-CAs on our OpenWRT | + | Now we can download the syslinux archive and extract it. We do not have the public SSL-CAs on our OpenWrt |
| < | < | ||
| - | root@OpenWRT:~# mkdir / | + | root@OpenWrt:~# mkdir / |
| - | root@OpenWRT:~# cd / | + | root@OpenWrt:~# cd / |
| - | root@OpenWRT:/ | + | root@OpenWrt:/ |
| - | root@OpenWRT:/ | + | root@OpenWrt:/ |
| </ | </ | ||
| Line 117: | Line 121: | ||
| As one single long copy-command: | As one single long copy-command: | ||
| < | < | ||
| - | root@OpenWRT:~# cd / | + | root@OpenWrt:~# cd / |
| - | root@OpenWRT:/ | + | root@OpenWrt:/ |
| </ | </ | ||
| Line 125: | Line 129: | ||
| Now we create our default menu-file: | Now we create our default menu-file: | ||
| < | < | ||
| - | root@OpenWRT:~# vim / | + | root@OpenWrt:~# vim / |
| DEFAULT vesamenu.c32 | DEFAULT vesamenu.c32 | ||
| PROMPT 0 | PROMPT 0 | ||
| - | MENU TITLE OpenWRT | + | MENU TITLE OpenWrt |
| label Ubuntu | label Ubuntu | ||
| - | MENU LABEL Ubuntu Live 13.10 64-Bit | + | MENU LABEL Ubuntu Live 16.04 64-Bit |
| - | KERNEL disks/ubuntu/ | + | KERNEL disks/ubuntu1604-64/ |
| - | APPEND boot=casper ide=nodma netboot=nfs nfsroot=192.168.1.1:/ | + | APPEND boot=casper ide=nodma netboot=nfs nfsroot=192.168.1.1:/ |
| TEXT HELP | TEXT HELP | ||
| - | Starts the Ubuntu Live-CD - Version | + | Starts the Ubuntu Live-CD - Version |
| ENDTEXT | ENDTEXT | ||
| </ | </ | ||
| Line 141: | Line 145: | ||
| As you can see we need nfs for this operating system. Other operating systems like clonezilla can be fully booted via TFTP an do not need an additional nfs service. | As you can see we need nfs for this operating system. Other operating systems like clonezilla can be fully booted via TFTP an do not need an additional nfs service. | ||
| - | We now have to download and extract the Ubuntu | + | We now have to download and extract the Ubuntu |
| - | One Option is to do this directly on the OpenWRT | + | One Option is to do this directly on the OpenWrt |
| Finally, you should have something like the following folder structure: | Finally, you should have something like the following folder structure: | ||
| < | < | ||
| - | root@OpenWRT:~# cd .. | + | root@OpenWrt:~# cd .. |
| - | root@OpenWRT:~# # find / | + | root@OpenWrt:~# # find / |
| / | / | ||
| / | / | ||
| - | / | + | / |
| - | / | + | / |
| ... | ... | ||
| - | / | + | / |
| ... | ... | ||
| - | / | + | / |
| - | / | + | / |
| - | / | + | / |
| - | / | + | / |
| - | / | + | / |
| - | / | + | / |
| - | / | + | / |
| - | / | + | / |
| - | / | + | / |
| - | / | + | |
| ... | ... | ||
| - | / | + | / |
| ... | ... | ||
| - | / | + | / |
| - | / | + | |
| ... | ... | ||
| - | / | + | / |
| - | / | + | / |
| - | / | + | / |
| - | / | + | / |
| ... | ... | ||
| - | / | + | / |
| - | / | + | / |
| ... | ... | ||
| / | / | ||
| Line 189: | Line 191: | ||
| </ | </ | ||
| - | ==== 3. Enable TFTP and NFS Service==== | + | ===== 3. Enable TFTP and NFS Service |
| Configure dnsmasq service to enable read-only tftp-service | Configure dnsmasq service to enable read-only tftp-service | ||
| < | < | ||
| - | root@OpenWRT:~# vim / | + | root@OpenWrt:~# vim / |
| config dnsmasq | config dnsmasq | ||
| ... a lot of config done before... | ... a lot of config done before... | ||
| Line 204: | Line 206: | ||
| option filename ' | option filename ' | ||
| option serveraddress ' | option serveraddress ' | ||
| - | option servername 'OpenWRT' | + | option servername 'OpenWrt' |
| - | root@OpenWRT:~# / | + | root@OpenWrt:~# / |
| </ | </ | ||
| + | |||
| + | Some devices requires two additional lines in section //config boot linux//: | ||
| + | < | ||
| + | list dhcp_option ' | ||
| + | option force ' | ||
| + | </ | ||
| + | Without this parameters some PXE devices won't boot to default menu. | ||
| Now we have to install and configure the NFS-Service: | Now we have to install and configure the NFS-Service: | ||
| < | < | ||
| - | root@OpenWRT:~# opkg install nfs-kernel-server | + | root@OpenWrt:~# opkg install nfs-kernel-server |
| </ | </ | ||
| Configure NFS-Share now | Configure NFS-Share now | ||
| < | < | ||
| - | root@OpenWRT:~# vim / | + | root@OpenWrt:~# vim / |
| / | / | ||
| </ | </ | ||
| Line 222: | Line 231: | ||
| Now enable portmap and nfsd and (re)start them | Now enable portmap and nfsd and (re)start them | ||
| < | < | ||
| - | root@OpenWRT:~# / | + | root@OpenWrt:~# / |
| - | root@OpenWRT:~# / | + | root@OpenWrt:~# / |
| - | root@OpenWRT:~# / | + | root@OpenWrt:~# / |
| - | root@OpenWRT:~# / | + | root@OpenWrt:~# / |
| </ | </ | ||
| - | ====4. Testing it out==== | + | ===== 4. Testing it out ===== |
| - | And now we are ready to go! Just grab a computer (or Virtual Machine) and PXE Boot - you should be able to fully boot into Ubuntu | + | And now we are ready to go! Just grab a computer (or Virtual Machine) and PXE Boot - you should be able to fully boot into Ubuntu |
| Hint: you often have to enable PXE-Booting in BIOS and press e.g. F12 to get into the Boot-Menu. | Hint: you often have to enable PXE-Booting in BIOS and press e.g. F12 to get into the Boot-Menu. | ||
| Line 257: | Line 266: | ||
| Tue Nov 7 19:28:20 2017 daemon.info dnsmasq-tftp[16313]: | Tue Nov 7 19:28:20 2017 daemon.info dnsmasq-tftp[16313]: | ||
| Tue Nov 7 19:28:20 2017 daemon.info dnsmasq-tftp[16313]: | Tue Nov 7 19:28:20 2017 daemon.info dnsmasq-tftp[16313]: | ||
| - | Tue Nov 7 19:28:34 2017 daemon.info dnsmasq-tftp[16313]: | + | Tue Nov 7 19:28:34 2017 daemon.info dnsmasq-tftp[16313]: |
| - | Tue Nov 7 19:28:42 2017 daemon.info dnsmasq-tftp[16313]: | + | Tue Nov 7 19:28:42 2017 daemon.info dnsmasq-tftp[16313]: |
| Tue Nov 7 19:29:24 2017 daemon.info dnsmasq-dhcp[16313]: | Tue Nov 7 19:29:24 2017 daemon.info dnsmasq-dhcp[16313]: | ||
| Tue Nov 7 19:29:24 2017 daemon.info dnsmasq-dhcp[16313]: | Tue Nov 7 19:29:24 2017 daemon.info dnsmasq-dhcp[16313]: | ||
| Tue Nov 7 19:29:24 2017 daemon.info dnsmasq-dhcp[16313]: | Tue Nov 7 19:29:24 2017 daemon.info dnsmasq-dhcp[16313]: | ||
| Tue Nov 7 19:29:24 2017 daemon.info dnsmasq-dhcp[16313]: | Tue Nov 7 19:29:24 2017 daemon.info dnsmasq-dhcp[16313]: | ||
| - | Tue Nov 7 19:29:24 2017 daemon.notice rpc.mountd[16219]: | + | Tue Nov 7 19:29:24 2017 daemon.notice rpc.mountd[16219]: |
| </ | </ | ||
| - | {{tag>tftpd}} | + | ===== 5. Trouble shooting ===== |
| + | |||
| + | < | ||
| + | >> | ||
| + | >> | ||
| + | >> | ||
| + | Station IP address is 192.168.1.239 | ||
| + | |||
| + | Server IP address is 192.168.1.1 | ||
| + | NBP filename is pxelinux.0 | ||
| + | NBP filesize is 0 Bytes | ||
| + | PXE-E23: Client received TFTP error from... | ||
| + | </ | ||
| + | |||
| + | Check that your tftp-server is up and running and serves the file ' | ||
| + | |||
| + | < | ||
| + | user@server: | ||
| + | user@server: | ||
| + | user@server: | ||
| + | tftp> get pxelinux.0 | ||
| + | tftp> error received from server <file / | ||
| + | tftp> aborting | ||
| + | tftp> | ||
| + | </ | ||
| + | |||
| + | If the file pxelinux.0 is at the expected location, try restarting the tftp server: | ||
| + | |||
| + | < | ||
| + | user@server: | ||
| + | udhcpc: started, v1.35.0 | ||
| + | udhcpc: broadcasting discover | ||
| + | udhcpc: no lease, failing | ||
| + | user@server: | ||
| + | </code> | ||