ejes consulting

Techincal Consulting Design and Automation

GNU dnsmasq for OpenSolaris SPARC

with 2 comments

I recently have been trying to migrate my FreeNAS server to a SPARC based system runing OpenSolaris.  Mainly for the benefits of ZFS – but also to learn more about OpenSolaris and shellcode on SPARC.

In this light of learning more about OpenSolaris, I’ve been porting some of my lesser power hungry network applications to my little sparc pizzabox as well.  Since the pizzabox server is a little underpowered I wanted to use some pertty trim services to keep it’s availablility up as a NAS.

The first service I thought about was dnsmasq, who on my OpenBSD system works as my DHCP and dynmaically updateable DNS server.  I really like dnsmasq (http://www.thekelleys.org.uk/dnsmasq/doc.html), and have been using it as my primary dns/dhcp server for some time now – it’s fast, feature rich, easy to configure and cheap on resources.  It’s perfect for the home user.

Now just to get in running on my sparc.  After all the searching in the world, I couldn’t find any (trivial) dnsmasq on Solaris documentation. 

This left me no choice:

I’m not afraid of compling source.  Thankfully, DNSmasq 2.52 (http://www.thekelleys.org.uk/dnsmasq/dnsmasq-2.52.tar.gz) compiles cleanly on sparc – so this is the base I used.  In order to compile and run make install properly, I had to change the “Makefile” to use “ginstall” instead of BSD install that is used by default on Solaris systems; the Makefile also uses “cc” instead of “gcc” so I symlinked my “gcc” binary from /usr/bin to /usr/bin/cc.

Once installed I had to deal with the silly Solaris SMF (Service Management Facility).  In order to maintain some continuity across all my services I decded to build a nice smf xml for my dnsmasq as well.  I just copied ssh’s, and modified it to support my newly compiled dnsmasq package.  I also had to write a simple starup script since the SMF facility is just a fancy way of calling /lib/svc/method/ shell scripts who look suspcisouly like “init.d” type scripts.

Compiled, scripted and input into my smf (using svccfg import), my dnsmasq seems to starup great – my netbook got an ip, and it’s pingable by using “ping netbook” .

GREAT!

To save you wonderful internet users some headaches, I built a Solaris “.pkg” file for general consumption.  (http://www.filehosting.org/file/details/143734/GNUdnsmsq.pkg

I followed the instructions here (http://www.ibiblio.org/pub/packages/solaris/sparc/html/creating.solaris.packages.html ) for creaing the Solaris package, then used “pkgtrans -s . GNUdnsmaq.pkg” to translate the package to a “.pkg” file.

Enjoy!

Advertisements

Written by ejes

May 12, 2010 at 12:18 pm

Posted in Hacking, Tutorials

Tagged with , ,

2 Responses

Subscribe to comments with RSS.

  1. I have followed your description in order compile the same Dnsmasq version (2.52) for OpenSolaris x86. Though, everything seems to work fine, I am experiencing problems with multiple DHCP ranges on different interfaces. Only the first one that encounters a DHCP request is answering, while all the others drop silently. No log messages, even in debug mode, it is thus random how DHCP is assigned. Do you have any experiences with that?

    Maverick

    May 25, 2010 at 10:10 am

    • I have not had this problem.

      Does it work with 1 zone? Can you run a snoop and see if the request is being received?

      ejes

      May 25, 2010 at 3:06 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: