6

Using iOmega IX4-200d as DHCP, DNS, TFTP and PXE server

 4 years ago
source link: https://myvirtualcloud.net/using-iomega-ix4-200d-as-dhcp-dns-tftp-and-pxe-server/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Using iOmega IX4-200d as DHCP, DNS, TFTP and PXE server

  • 02/03/2011

This article is a bit off-topic if compared to what I usually write about ‘VDI’, but I thought it was worth to share. I really like the benefits of PXE booting and wanted to run PXE boot in my homelab, however my LinkSys WRT320N wireless router only provides very basic DHCP functionality. The other option would be Windows DHCP and DNS in a VM; however if the VM or host (I have a homelab in a box) is down for any reason all other devices in the house that use DHCP would not be able to get to the network and internet, including iPhones, PlayStation, Microwave, Oven etc…

I needed a solution in a device that is always powered on and do not have dependencies on the host server. My iOmega IX4-200d! The iOmega IX4-200d is a Linux based device and is capable of providing shell access, therefore it is possible to use it to install and execute additional services. I have chosen dnsmasq because it’s an all-in-one stable solution, providing DHCP, DNS and TFTP in a single service.

Follow the steps below to transform your iOmega IX4-200d (The solutions also works well for different models).

Enabling SSH

1 – Download and install firmware 2.1.38.22294 or earlier

2 – Browse http://your-nas-ip-address/support.html and enable the SupportAccess option. (This will enable SSH/Shell access)

3 – Using Putty connect via SSH to your iOmega IX4-200d IP address (User:root Password: see reference post below)

Reference for the password: http://www.pkguild.com/2010/01/shell-access-to-your-ix2ix4-exposed-get-yer-red-hot-ssh-here/

Installing dnsmasq

Copy/Past the below in the SSH session.

cat <<EOF > /etc/ipkg.conf
src cross
http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable
src native http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/native/unstable
EOF

ipkg update

After that you can check the list of available packages by typing

ipkg list 

To install dnsmasq package type:

ipkg install dnsmasq

Configuring dnsmasq

Edit the dnsmasq configuration file:

vi /opt/etc/dnsmasq.conf

if you are not familiar with vi editor, here is a quick guide.

Enable DHCP in dnsmasq configuration file:

domain=yourdomain.com,subnet/24 (add your FQDN domain and netmask)

dhcp-range=x.x.x.x,x.x.x.x.,12h (add your IP range and lease period)

dhcp-option=3,x.x.x.x (replace x.x.x.x with the network gateway)

pxe-service=x86PC, “Install Linux”, pxelinus (remove #)

Enable TFTP in dnsmasq configuration file:

enable-tftp (remove #)

tftp-root=/boot/ftpd (required because /var/ftpd doesn’t have enough space for ESX boot files)

tftp-no-blocksize (remove #)

For initial troubleshooting purpose enable logging

vi /opt/etc/dnsmasq.conf

log-queries (remove #)

log-dhcp (remove #)

Configure the upstream DNS nameserver to be used when sending queries. These are most likely your ISP DNS servers. Keep the first line with 127.0.0.1 nameserver.

vi /etc/resolv.conf

nameserver 127.0.0.1

nameserver x.x.x.x

nameserver x.x.x.x

Start dnsmasq service typing

/opt/etc/initd/S56dnsmasq start

If you are not interested in PXE server configuration you may stop here. For every configuration change it is required to restart the service. The options are as below.

/opt/etc/initd/S56dnsmasq start

/opt/etc/initd/S56dnsmasq stop

/opt/etc/initd/S56dnsmasq restart

Configuring PXE boot filename

The services are configured and now it’s necessary to deploy the PXE boot files:

Create the TFTP root folder

mkdir /boot/ftpd

mkdir /boot/ftpd/pxelinux.cfg

mkdir /boot/ftpd/vmware/esx4.1

Download pxelinux.0 from here and using WinSCP or other SCP file manager copy pxelinux.0 to /boot/ftpd

Open ESXi4.1 ISO and extract the following files:

  • cim.vgz
  • ienviron.vgz
  • install.vgz
  • mboot.c32
  • menu.c32
  • sys.vgz
  • vmkboot.gz
  • vmkernel.gz

Using WinSCP or other SCP file manager copy the files to /boot/ftpd/vmware/esx4.1

Configuring ESXi4.1 bootstrap

Create a default file in /boot/ftpd/pxelinux.cfg

vi /boot/ftpd/pxelinux.cfg/default

Now, past the following into default

default 1

prompt 1

menu title VMware VMVisor Boot Menu

timeout 50

label 1

kernel vmware/esx4.1/mboot.c32

append vmware/esx4.1/vmkboot.gz ks=ftp://x.x.x.x/pxe/ks.cfg nameserver=x.x.x.x — vmware/esx4.1/vmkernel.gz — vmware/esx4.1/sys.vgz — vmware/esx4.1/cim.vgz — vmware/esx4.1/ienviron.vgz — vmware/esx4.1/install.vgz

label 0

localboot 0x80

Replace all x.x.x.x with the your iOmega IX4-200d IP address.

Configuring ESXi4.1 kickstart repository

I decided to use iOmega IX4-200d own’s FTP server to host the kickstart script (ks.cfg) and the ESX4.1 source files. It’s also possible to use the built-in HTTP server, however because it is mounted as read-only I didn’t want to touch it.

Go to Setting and Enable FTP Access.

Using WinSCP or any other FTP tool connect to the iOmega IX4-200d IP address and login as anonymous with no password.

Create a folder named pxe and copy the ks.cfg file into this new folder.

A simple ks.cfg using DHCP would be as below.

accepteula

rootpw yourpassword

autopart –firstdisk –overwritevmfs

install url ftp://your-nas-ip-address/pxe/esx4.1

network –bootproto=dhcp –device=vmnic0

reboot

If you want to learn more about ESX scripted installation:

http://www.virtuallyghetto.com/2010/09/automating-esxi-41-kickstart-tips.html

http://www.kendrickcoleman.com/index.php?/Tech-Blog/esxi-41-kickstart-install-wip.html

Copying ESXi4.1 Source Files

The last step is to copy the ESXi4.1 source files to the FTP repository that will host the installation files. Using WinSCP or any other FTP tool connect to the iOmega IX4-200d IP address and login as anonymous with no password.

Create a folder called esx4.1 and copy all the files from the ESXi4.1 ISO into this folder.

(Attention, Do not copy the ISO itself)

Make sure you change the DNS nameserver for all your computers and VMs that use static addressing. You now have your  iOmega IX4-200d configured as DHCP, DNS, TFTP, FTP and PXE boot server. To test the solution I like to use VMware Workstation empty VMs.

Additionally, don’t forget to disable any other DNS and DHCP services running in your network.

Last  but not least, this procedure is not supported by iOmega and you may use this tutorial on your own risk.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK