WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Opinions needed putting together a TC based PXE server  (Read 5657 times)

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 764
Opinions needed putting together a TC based PXE server
« on: September 24, 2014, 11:33:58 PM »
I have a CentOS6 based PXE environment running Bind, TFTPd, DHCPd and other services which for one reason or another seems to bog down the machine while doing nothing to where DHCPd and TFTPd do not even respond to certain hardware clients - specifically, IBM eServer x305 machines tend to get ignored while Atom based machines are usually quick to get an answer to the broadcast.

Instead of trying to track down the problems as the machine itself is intended to be decommissioned and used for something else, I've decided to take a VIA C3 (1GB RAM, a couple 100GB drives and a flash based 128MB CF which is intended to be used as the static boot drive.)

After reading a ton of different blog entries, I'm finding a lot of different opinions as to which direction to take, and am looking for a more "specific" set of opinions based on the needs of the system.

I need the machine to be able to handle static addressing in DHCP (reservations), PXE "options" such as web server and boot file, DNS services (local network plus forwarding when unanswered by the local network) and TFTP to handle file transfers to get the boot process going.

I've selected TC 4.7.7 as the foundation (BusyBox 1.20.2) which covers DHCPd and TFTPd, but not DNS -- and I've read that DHCPd does not support static reservations.  DNSMasq sounds like a good potential for DHCP and DNS, but also has potential issues with static addressing.  Does anyone have a good combination they've tried (example configs would be truly appreciated) while trying to maintain a slim installation?

DHCP/TFTP: Up to two dozen machines may hit this server at any given time using an onboard T100 NIC for DNS and DHCP and a GBe NIC for TFTP, CIFS, NFS, etc.
DNS: Whether using a BIND type of layout or HOSTS, machine names will be added for local serving but will need to forward the request when local services do not have a record.

Thanks for your time and responses!

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Opinions needed putting together a TC based PXE server
« Reply #1 on: September 25, 2014, 12:02:01 AM »
Dnsmasq will do dhcp with static reservations, dns, ant tftp.
Dnsmasq is the dns/dhcp server used in many routers.

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 764
Re: Opinions needed putting together a TC based PXE server
« Reply #2 on: September 26, 2014, 04:29:48 AM »
I must be dense.  DNSmasq is loaded, the basic settings are in place (trying to put together one service at a time) but for the life of me, no matter how many variations I've tried (dnsmasq.conf) I can't seem to get DHCP(d) to function.  DNS works (I only tried a couple test entries in /etc/hosts, but answers as expected) and though the app/pid isn't listed in netstat -anup at least the binding is...  and only that one.

The last configuration I put together follows this example:
http://sfxpt.wordpress.com/2013/11/30/dnsmasq-installation-configuration-5/
(/etc/dnsmasq.d is handled and persists on a drive which copies its contents over to the file system on boot before dnsmasq is launched.)
pidof dnsmasq comes back as expected.
pkill -SIGHUP works to reload info/records...  so far so good.
killall -9 dnsmasq has to be used otherwise the service hangs the socket when stopping manually.
syslog shows no errors...

(crickets chirping in the background...)

nope!  I've tried dhcping'ing from another machine down to running dhcpcd -T on the same machine; for the life of me she's just being stubborn! :)

This machine: 10.1.0.1
Test machine: 10.0.0.10
(same physical switch in this case)
Network: 10.0.0.0/8  BC:10.255.255.255 GW:10.0.0.254

Any ideas would be appreciated!

Offline Drew

  • Jr. Member
  • **
  • Posts: 57
Re: Opinions needed putting together a TC based PXE server
« Reply #3 on: September 26, 2014, 08:06:58 AM »
Are your targets set up for PXE boot?  Just making sure the silly stuff is out of the way, it will get you every time.

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 764
Re: Opinions needed putting together a TC based PXE server
« Reply #4 on: September 26, 2014, 11:09:44 AM »
Haven't even gotten to TFTP/PXE yet, aimed first at DNS then DHCP...  then roadblock :)
(This, after reading everywhere how dnsmasq is the easiest thing on Earth "out of the box" so to speak; one would think I'm new at computing!)

In a nutshell, I cannot get 'er to respond/answer to broadcasts (using the tools noted above.)

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Opinions needed putting together a TC based PXE server
« Reply #5 on: September 26, 2014, 11:18:13 AM »
Do you have another dhcp server on your network?
http://www.thekelleys.org.uk/dnsmasq/doc.html

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 764
Re: Opinions needed putting together a TC based PXE server
« Reply #6 on: September 26, 2014, 01:00:41 PM »
On the machine I tested with - and it was disabled (along with bind, tftp, etc.)

I have a few WiFi routers/repeaters which also serve on different subnets which I also shut down as a precaution (I know from experience the "broadcast confusion" of having more than one dhcp server so I wasn't going to take a chance.)  If that were the case, though, I would imagine "something" would have answered; both client tests indicated timeouts/no answer at all.  :-\

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 764
Re: Opinions needed putting together a TC based PXE server
« Reply #7 on: September 26, 2014, 01:04:43 PM »
You know... I wonder if it's IPv6 related??

#netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:domain          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN
tcp        0     64 10.1.0.1:ssh            10.0.0.111:56877        ESTABLISHED
netstat: /proc/net/tcp6: No such file or directory
udp        0      0 0.0.0.0:domain          0.0.0.0:*
netstat: /proc/net/udp6: No such file or directory
netstat: /proc/net/raw6: No such file or directory

Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node Path
unix  4      [ ]         DGRAM                      1800 /dev/log
unix  2      [ ACC ]     SEQPACKET  LISTENING       1247 @/org/kernel/udev/udevd
unix  2      [ ]         DGRAM                     14902
unix  2      [ ]         DGRAM                      1807
unix  3      [ ]         DGRAM                      1255
unix  3      [ ]         DGRAM                      1254

#pidof dnsmasq
2376

in /var/log/messages:
Jan 24 15:42:53 box daemon.info dnsmasq[2376]: started, version 2.55 cachesize 150
Jan 24 15:42:53 box daemon.info dnsmasq[2376]: compile time options: IPv6 GNU-getopt no-DBus no-I18N DHCP TFTP
Jan 24 15:42:53 box daemon.info dnsmasq[2376]: reading /etc/resolv.conf
Jan 24 15:42:53 box daemon.info dnsmasq[2376]: using nameserver 10.0.0.254#53 <-- also internet router
Jan 24 15:42:53 box daemon.warn dnsmasq[2376]: ignoring nameserver 127.0.0.1 - local interface
Jan 24 15:42:53 box daemon.info dnsmasq[2376]: read /etc/hosts - 7 addresses

Edit: /etc/dnsmasq.d as follows:

dnsmasq.debug.conf:
log-queries
log-dhcp

dnsmasq.intranet.conf:
server=10.0.0.254
dhcp-range=10.0.5.1,10.0.5.250,48h

dnsmasq.service.conf:
domain-needed
bogus-priv
stop-dns-rebind
rebind-localhost-ok
bogus-nxdomain=64.94.110.11
no-resolv
server=8.8.8.8
expand-hosts
# enable dhcp
dhcp-authoritative
dhcp-option=6,0.0.0.0

/usr/local/etc/dnsmasq.conf just points to this directory (nothing else enabled within it.)
« Last Edit: September 26, 2014, 01:09:40 PM by centralware »

Offline Drew

  • Jr. Member
  • **
  • Posts: 57
Re: Opinions needed putting together a TC based PXE server
« Reply #8 on: September 26, 2014, 03:13:30 PM »
Haven't even gotten to TFTP/PXE yet, aimed first at DNS then DHCP...  then roadblock :)
(This, after reading everywhere how dnsmasq is the easiest thing on Earth "out of the box" so to speak; one would think I'm new at computing!)

In a nutshell, I cannot get 'er to respond/answer to broadcasts (using the tools noted above.)
Sorry, different issue then.  Thought you were trying to set up a PXE server to hand out IP via DHCP.  In that case, the client would need to be set for PXE boot.  But again, sorry for misunderstanding your issue.

We have a Fog server that had similar issues, or so I thought.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Opinions needed putting together a TC based PXE server
« Reply #9 on: September 26, 2014, 03:25:42 PM »
Why
Quote
# enable dhcp
commented out?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 764
Re: Opinions needed putting together a TC based PXE server
« Reply #10 on: September 26, 2014, 08:47:38 PM »
Drew: This IS intended for PXE (but also intended for standard DHCP use as well)

Tiny: "Enable DHCP" was just a comment, not a command

Thanks guys.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Opinions needed putting together a TC based PXE server
« Reply #11 on: September 26, 2014, 09:30:29 PM »
You really need to read the official dnsmasq docs.

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 764
Re: Opinions needed putting together a TC based PXE server
« Reply #12 on: September 26, 2014, 10:03:06 PM »
Gerald...  that was the first place (kellys) I went long before coming here.
http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

The reason I landed here was 1) hoping for those who've experienced issues similar to read the post and possibly respond 2) I've already spent a good number of hours researching possible issues/scenarios (four days thus far) and 3) I'm an engineer and developer...  I don't normally run TO a help desk, I usually AM the help desk, so asking someone else is not the first thing on the list unless digging for opinions.  Thank you for the feedback, though.

Offline CentralWare

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 764
Re: Opinions needed putting together a TC based PXE server
« Reply #13 on: September 27, 2014, 12:27:27 AM »
BUG REPORT:
The version of dnsmasq in the 4.x/x86 directory of TC is NOT reading /usr/local/etc/dnsmasq.conf by default and is falling back to its internal, compiled defaults.
(Thus why I can't get DHCP settings to launch.)

This was determined by accident after creating a service command similar to that found in CentOS/Fedora/RedHat and using the general command line of:
sudo /usr/local/sbin/dnsmasq --no-daemon
as my test environment, after putting a line into the dnsmasq configuration file (called ErrorHERE!) with the intention of it causing a failed startup...  which it did not.  (The "service" app simply makes it a lot less typing, so I added functionality for a lot of other services such as sshd, acpid, etc. for start/stop/restart/status options with a lot less typing and a lot less permission hurdles.)

The compilation in TCZ hasn't been traced back as to WHERE exactly it's looking for dnsmasq.conf (I'm assuming /etc/dnsmasq.conf) thus command-line variables are required to force it to look where the example configs are located (/usr/local/etc/)

I still don't have it properly answering DHCP, but DO have DHCP activity finally showing in debug mode using the full command of:
sudo /usr/local/sbin/dnsmasq --no-daemon --conf-dir=/etc/dnsmasq.d

LOL...  back to the drawing board now to see why I'm not getting a complete packet to satisfy udhcpc's broadcast request.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Opinions needed putting together a TC based PXE server
« Reply #14 on: September 27, 2014, 12:36:32 AM »
You need to read the info file that comes with  dnsmasq.tcz.
It tells you where it looks for the default config file and how to start it with a different config file.