Current status: Two new-tube computers, one as a PXE server and the other one as a client, can run nicely. We want to make a diskless computing system so that we need a PXE Server. PXE stands for "Pre-boot eXecution Environment". PXE is a special extension of services provided by the Dynamic Host Configuration Protocol (DHCP). It uses a Trivial File Transfer Protocol (TFTP) server to provide minimal boot to a network client. Let's try to configure it! #contents * Small subnet for testing DHCP [#f0142583] **What we need [#pe839496] - A computer with linux operating system to be configured as a server. Here we use Fedora Linux. This computer should have at least two network interface cards (NIC). One of the cards will be used to connect the server with client. - Computer that acts as a client. For a checking purpose we need this computer to have SSH facility (it does not matter to use Windows or Linux). - Network hub and cables. **Checking [#r1faf503] ***Network setting [#j7b294ed] - Turn on the hub, connect a network cable from Fedora Linux computer (PXE server) to the hub (e.g. to channel 1) -Note: Form now we will address this Fedora Linux machine as PXE Server although it is not configured yet as PXE server. - Connect again a network cable from the client computer (Windows/Linux) to the hub (e.g. to channel 2). - Open Network configuration on PXE server using root privilege (i.e login or su as root). We should set network interface card that has been connected to the hub. - Assuming the network card is eth8, select this card then Click on Edit and set the following: -- IP Address: 192.168.2.30 -- Subnet Mask: 255.255.255.0 --After that activate this NIC if it is not activated yet. - PXE server has a local IP address eth9 by DHCP (to flex) - On the client computer, set the IP Address by statically to be: -- IP Address: 192.168.2.100 -- Subnet Mask: 255.255.255.0 -- gateway 192.168.2.30 (specified by dhcpd.conf and ipfowarding is needed) - We adopt the PXE server which will be used as the OS of diskless PXE client ***SSH check [#tad4148a] - Open SSH software on client computer, for example, Putty or any command line software: ssh username@192.168.2.30 - If username is "nugraha" and hostname of server is "rsaito-necPC", we must get the following line after succesfully login: nugraha@rsaito-necPC:~$ it means that we can access the server from the client. * Setting for the PXE server machine [#fea55b57] ** SElinux should be in permissive mode. [#e2317643] - edit /etc/sysconfig/selinux SELINUX=permissive !SELINUXTYP=targeted ** Install DHCP and TFTP Server etc [#s9d399d8] - Install dhcp, syslinux, tftp-server, nfs-utils, system-config-netboot(su root) # yum install dhcp syslinux tftp-server nfs-utils system-config-netboot - Check if the software is nicely installed # rpm -qa | grep syslinux syslinux-2.2.2.2.2 -- If we can see name + version, then ok. If not, yum install again. ** DHCP Configuration [#b4fdd07c] - Edit /etc/dhcpd.conf. The following is a configuration for a network that uses: -- 192.168.2.0/255.255.255.0 addressing -- Dynamic address will be provided between 192.168.2.100 and 192.168.2.240 -- DHCP server (next server) at IP address 192.168.2.30 allow booting; allow bootp; ddns-update-style interim; ignore client-updates; subnet 192.168.2.0 netmask 255.255.255.0 { option subnet-mask 255.255.255.0; option broadcast-address 192.168.2.255; range dynamic-bootp 192.168.2.200 192.168.2.240; next-server 192.168.2.30; } host trytube1 { # hostname hardware ethernet 00:30:48:d4:a9:7c; # MAC address of NIC fixed-address 192.168.2.101; # corresponding IP address filename "/linux-install/pxelinux.0"; } class "pxeclients" { match if substring(option vendor-class-identifier, 0, 9) = "PXEClient"; next-server 192.168.2.30; filename "/linux-install/pxelinux.0"; } Warning: Do not use the IP address of PXE-Client within the range 200-240. -- Turn on dhcpd # /sbin/service dhcpd restart # chkconfig dhcpd on (the last line is for activating dhcp on booting process) -- Check if the dhcp server can work. --- Open a client computer which is connected to server --- Set the TCP/IP to dynamically set for IP address. --- Connect by ssh % putty username@192.168.2.30 ---If we can connect, it means DHCP has successfully been configured. % ipconfig -a --- Please keep Mac Address of the client PC, in this case 00-21-70-c9-e7-de (another Dell PC). ** TFTP Configuration [#nfd5db55] - Edit /etc/xinetd.d/tftp of the PXE server machine # default: off # description: The tftp server serves files using the trivial file transfer \ # protocol. The tftp protocol is often used to boot diskless \ # workstations, download configuration files to network-aware printers, \ # and to start the installation process for some operating systems. service tftp { disable = no socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot per_source = 11 cps = 100 2 flags = IPv4 } - (1) disable = no, and (2) server_args = -s /tftpboot should be changed. - Possible problems: (1) tftp does not work, (2) tftp does not find the files. - tftpd is running under the xinetd. We restart xinetd # service xinetd restart ** NFS configuration [#r08426e2] *** Copy system data for booting [#v32daf81] - We will make file systems /nfsboot # mkdir /nfsboot # mkdir /nfsboot/root - rsync will be used for copying the files. # rsync -v -a \ --exclude='/proc/*' --exclude='/sys/*' --exclude='/dev/*'\ --exclude='/media/*' --exclude='/tmp/*' --exclude='/misc/*'\ --exclude='/nfsboot/*' / /nfsboot/root - 10GB files (10min) are needed. The file system will be used as NFS files. *** Firewall and starting NFS [#u8bca647] - NFS hosts is PXE server (192.168.2.30). - Edit /etc/exports /nfsboot 192.168.2.0/255.255.255.0(rw,no_root_squash,async) - Edit /etc/sysconfig/nfs -- uncomment MOUNTD_PORT # Port rpc.mountd should listen on. #MOUNTD_PORT=892 MOUNTD_PORT=892 - Change firewall for NFS, run system-config-firewall # system-config-firewall -- add 111 tcp -- add 111 udp -- add 892 tcp -- add 892 udp --- for 892 port, we set by hand. - Start nfs # service nfs restart # cd /etc/rc5.d/ # mv K20nfs S20nfs # ./S20nfs restart Shutting down NFS mountd: [ OK ] Shutting down NFS daemon: [ OK ] Shutting down NFS quotas: [ OK ] Shutting down NFS services: [ OK ] Starting NFS services: [ OK ] Starting NFS quotas: [ OK ] Starting NFS daemon: [ OK ] Starting NFS mountd: [ OK ] # ./S20nfs status rpc.mountd (pid 12153) is running... nfsd (pid 12150 12149 12148 12147 12146 12145 12144 12143) is running... rpc.rquotad (pid 12138) is running... - 'K' in 'K20nfs' means that file does not run by default, then we change into 'S'. ** Netboot [#nd1b2b49] - Files directory is made automatically by # system-config-netboot - or we can use: GNOME System - Administration - Server Setting - Network Booting Service -- push Diskless button for the first time -- then Diskless identifier windows starts Name: fedora64bit Description: fedora bla... bla... bla... -- NFS information: server 192.168.2.30 directory /nfsboot -- Select a newer Kernel. -- Automatically it will generate /tftpboot/linux-install/fedora64bit/ and --- /tftpboot/linux-install/fedora64bit/initrd.img --- /tftpboot/linux-install/fedora64bit/vmliuz -- New windows appears IP address/subnet: 255.255.255.0 <- we use subnet information operating system: fedora64bit Other part should be as it is. -- /nfsboot/snapshot/255.255.255.0/ will be generated automatically. --- FFFFFF00 (255.255.255.0) file is generated as above. # cd /tftpboot/linux-install/pxelinux.cfg # mv default default.org # ln -s FFFFFF00 01-00-21-70-c9-e7-de --- when default exists, PXE client first try to read this. --- 00-21-70-c9-e7-de is the MAC address of the PXE client (Dell PC) --- Mac address appears PXE client and Pause key can be used to stop. --- PXE try to read 01-00-21-70-c9-e7-de the file first. -- An important thing is to put "01-" at the top of the name. --- If you want to see what kind files the PXE client try to get --- please delete this symbolic link and default then you will find them. * Set PXE client [#j2d1c71b] - Start BIOS and select BOOT. - Select Network boot (no submenu exist). - Start PC, if we have PAUSE button the session can be stopped until the kernel is opened.