How to set up private gateway server with specific features
rance at frontiernet.net
rance at frontiernet.net
Wed Jun 7 01:45:22 UTC 2006
I have a new freebsd6.1-stable install
I've almost got it configured the way I want it.
Except Ive got a couple of problems and dont see what to do about it.
requirements I cant figure out how to do are:
specific setup issues are I have two nics and one is named red, and the
other green, as you can imagine the red one is out to the internet, and
the green one is the internal net.
green ip = 192.168.1.1
red ip = DHCP
1. I need a dhcp server on the green net that can update the dns
server automatically when a dhcp lease is accepted.
2. The freebsd server needs to be able to be a dns server for the
green net and forward other requests to the nameserver obtained from
the DHCP setup.
3. the dns server needs to be setup to look to itself for name
resolution first so that it can resolve names of internal clients as
well as external ones.
4. Id like to be able to assign the same ip address from the dhcp pool
to the same host for testing purposes when building new servers.
I find that configuring the dhcp server to assign the same lease via
hostname works better than configuring temporary hostnames.
WHAT I've done so far...
I already know how to configure dnsmasq to do both the dns and dhcp
part of my requirements and that is currently setup and running. except
that the server is not looking to itself for name resolution first.
Ive used dnsmasq before and in this setup it requires that the dhcp
client that runs on the red interface NOT create a new /etc/resolv.conf
but instead create that file in some other defined location like
dnsmasq can then be configured to look to the other resolv.conf for
domains which are not local, and the server looks to dnsmasq for its
own name resolution because I've hardcoded its own static internal ip
using the default dhclient, I can not configure it to NOT replace the
/etc/resolv,conf and instead replace some other file. (actually I could
get by with just NOT replacing /etc/resolv.conf and I can hardcode the
other one, but dhclient just doesnt seem to have this feature.) yes I
read the man page!
I cant not seem to get any dhcp server Ive used (isc-dhcp-server, and
dnsmasq build-in) to properly read the hostname and send the same ip
address each time.
seems that one of my freebsd clients does not report its hostname to
the dhcp server in the way I expect.
assume a fqdn of myhost.myinternaldomain.net
windows boxes and some unix boxes report to the dhcp server a hostname
of "myhost", but my dhcp server couldnt match to a client hostname of
"myhost" and serve out the IP I requested. I altered the dhcp server
to expect a hostname of the full fqdn, but it didnt match on that
so what "hostname" does dhclient report when its trying to get an ip address.
For security reasons I dont want to use bind. so I looked at using
tinydns and dnscache, that sort of worked, but again I couldn't make
the dhcp server update the DNS database.
dnsmasq works because it is its own dhcp server. so the name server
portion automatically reads the dhcp leases database when answering
Has anyone else been able to set this up with these requirements?
Im stuck taking this server to the "next level" all my internet sharing
and such works now, so it isnt a major issue, but I'd to fix it just
the same ( if for no other reason than a learning process)
Thanks for suggestions
More information about the freebsd-questions