Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Oct 2000 02:04:17 -0700
From:      jay.krell@cornell.edu
To:        <questions@freebsd.org>
Subject:   FreeBSD 3.x->4.1, my experience, Samba, dhcpd, ppp, nat, dns, named
Message-ID:  <001001c03686$e697a7b0$8001a8c0@jayk3>

next in thread | raw e-mail | index | archive | help
So.. I'm afraid this is mostly whining, but
maybe someone can figure out some appropriate fixes
maybe someone will search the mailing list archives and gain help, since I
at least provide resolutions partly specific to my configuration

About a year ago I had FreeBSD 3.4, 3.3, and I think 3.2 setup about how I
wanted them. I don't remember if I started with 3.3 or 3.2, but this was by
"upgrading" either with cvsup and rebuild or reinstall and copy over files
from /etc, etc. This was on one or two machines. FreeBSD paniced a lot on
the second machine, it was suggested it was a hardware problem, so I mostly
gave up on FreeBSD and that machine for a while, not wanting to give up NT4
on my main machine..

So now it's a while later, I have a new secondary machine, and FreeBSD 4.1
is probably the version to use.

The configuration I was after, at least:
two machines
dialup ppp to an isp
FreeBSD is the, in Microsoft terms, "internet connection provider" -- the
other machine is running NT and whenever it or the FreeBSD machine needs
internet access, the FreeBSD machine dials its modem; they are networked via
ethernet, of course. The NT machine has no hardcoded network configuration.
It uses "dhcp".
The FreeBSD machine provides dhcp and dns. The FreeBSD machine is also a
Samba server. It's still unclear which among ppp, dhcpd, samba, named is
providing dns, but it works. I think it is named providing dns and ppp just
writes into /etc/resolve.conf. Anyway, most of this I vaguely figured out
enough in the 3.x timeframe..

Ok.. so, I'm not a good story teller.
The problems I ran into were:
getting Samba/smb/nmb to start
getting dhcpd to start and work
getting my keyboard to work

the resolutions were
Samba
--------
    There is conflicting information here.
    1) Samba installs /usr/local/etc/rc.d/samba.sh.sample, with the
implication that you just
    cp /usr/local/etc/rc.d/samba.sh.sample /usr/local/etc/rc.d/samba.sh
    2) /etc/inetd.conf has two lines commented out referring to smbd and
nmbd and a comment saying to uncomment them to enable Samba "within inetd".

    Maybe #2 works and I screwed it up otherwise. This is what I did in the
3.x timeframe. My experience is that the comment in /etc/inetd.conf should
be modified something like, add:
    # For some versions of Samba you should uncomment these lines. Others
install /usr/local/etc/rc.d/samba.sh.sample. If your version includes
samba.sh.sample, make a copy of it in the same directory without "sample" in
the name, and leave these lines alone.
    Its possible that people starting from scratch just find docs referring
to samba.sh.sample and never notice inetd.conf, that I'm just unusual in
that I searched out the wrong/different answer due to past experience. But I
also usually miss various messages installing ports/packages because I leave
them to install unattended.

Dhcp server
----------------
    This wasn't easy in the 3.x timeframe. First, at that time there was the
isc-dhcp and wide-dhcp ports. I arbitrarily tried the isc one and got it to
work. On the 4.1 CD, isc is marked broken due to security problems (I think
only the client), so I tried wide. I was unable to configure wide to work.

    step 1) get a current ports.tar.gz; it has a no longer broken isc-dhcpd;
don't use wide-dhcpd unless you can figure out how to configure it

    Ok, now there's isc-dhcpd2 and isc-dhcp3. I was unable to get isc-dhcp3
to work, with my configuration file from FreeBSD 3.x. I think the difference
I observed is that isc3 started allocating from the high end of its range
and 2 from the low end. Maybe it's a bug in the NT4 dhcp client. I don't
know.

    step 2) all other things being equal, use isc-dhcpd2, not isc-dhcp3
(and, again, not wide-dhcp)

    step 3) In the 3.x timeframe, this is what I did to get isc-dhcp to
start up at boot:

add to /etc/rc.conf:
-- /etc/rc.conf --
# Dhcp enables clients to not need hardcoded ip addresses.
# This requires setting up /etc/rc.local (is there a better way?)
# and installing /usr/ports/net/isc-dhcp.
dhcpd_enable="YES"
dhcpd_flags="-q" # don't print the verbose splash messsage/copyright
-- rc.conf --

rc.conf is all nice and magic, if something else honors it; in this case you
need to supply the magic. You need an /etc/rc.local that looks like

-- /etc/rc.local --
#!/bin/sh

## This part is boilerplate, per the comment in /etc/rc
# If there is a global system configuration file, suck it in.
#
if [ -f /etc/defaults/rc.conf ]; then
 . /etc/defaults/rc.conf
# This next line was not needed in 3.x but is needed in 4.x
 source_rc_confs
elif [ -f /etc/rc.conf ]; then
 . /etc/rc.conf
fi

## This the dhcp server specific part.
# Start Dynamic Host Configuration Protocol Daemon, so
# that other machines on the local net don't need
# hardcoded IP address or DNS server addresses or anything.
if [ "X${dhcpd_enable}" = X"YES" ]; then
 echo -n ' dhcpd'
 ${dhcpd_program-"/usr/local/sbin/dhcpd"} ${dhcpd_flags}
fi
-- /etc/rc.local --

Ok well, the answer is embedded in there. The boilerplate for /etc/rc.local
apparently changed between 3.x and 4.x. Upgrading requires updating it,
adding the "source_rc_confs" line. A better solution might be copy the last
part of rc.local to something like /usr/local/etc/rc.d/dhcpd.sh. I don't
know. This works for me.

Keyboard
------------
The machines are on a KVM (keyboard, video, mouse) switchbox. I had problems
with the mouse part of that long ago, so they have their own mice, but share
the keyboard and video. If the switchbox is switched away from FreeBSD 4.x
upon boot, the keyboard doesn't work with it. The solution here is to
reconfigure and rebuild your kernel.

GENERIC:
device  atkbd0 at atkbdc? irq 1 flags 0x1

LINT tells us:
# `flags' for atkbd:
#       0x01    Force detection of keyboard, else we always assume a
keyboard
#       0x02    Don't reset keyboard, useful for some newer ThinkPads
#       0x04    Old-style (XT) keyboard support, useful for older ThinkPads

Works, remove the flags:
device  atkbd0 at atkbdc? irq 1

Several times I had to su and reboot using the mouse to paste characters
from the motd (message of the day, printed at the end of the boot message),
since I had networking problems too.

This is probably specific to not using USB.

One more networking thing
------------------------------------
Since I'm on dialup ppp, I don't really, at least in my ignorant mind, have
a domain. I wanted the FreeBSD hostname to just be "jayk2". This seems to
cause problems, with Apache and/or Samba. I recommend you invent a domain
too, like use "jayk2.jaykhome". And probably make sure /etc/rc.conf and
/etc/hosts agree.

The named and ppp configurations migrated fine, modulo the change require
going to 3.4+
< authname #jaykrell
> authname "#jaykrell"

I can provide more /etc exracts if anyone needs. The main ones are
-- /etc/rc.conf --
named_enable="YES"
# next line for 4.x to run it more securely, not an option I think in 3.x
named_flags="-u bind -g bind"
ppp_enable="YES"
# next line is machine specific
ppp_profile="netcom"
ppp_nat="YES" # Have ppp provide the gateway/nat functionality.
-- /etc/rc.conf --

-- /etc/ppp/ppp.conf ---
make sure "enable dns" is not commented out
make the timeout value higher, it's too low by default, so the modem doesn't
hangup and redial so much
-- /etc/ppp/ppp.conf ---

-- /etc/namedb/named.conf --
edit this part
// If you've got a DNS server around at your upstream provider, enter
// its IP address here, and enable the line below.  This will make you
// benefit from its cache, thus reduce overall DNS traffic in the Internet.
 forwarders {
# the next line is specific to your isp, but maybe ppp updating the
resolve.conf file is sufficient?
  207.69.188.185; 207.69.188.186; 207.69.188.187;
 };
-- /etc/namedb/named.conf --

dhcpd.conf
This is particular to your local configuration.
192.168.1.1 is the hardcoded (it has to be) address of the FreeBSD machine
This file says to allocate addresses in the range 192.168.1.128 to
192.168.1.255. Your address is set in /etc/rc.conf with a line like
ifconfig_fxp0="inet 192.168.1.1 netmask 255.255.255.0"
where "fxp" is specific to what type of network card you have.
-- /etc/local/etc/dhcpd.conf --

subnet 192.168.1.0 netmask 255.255.255.0 {
 range 192.168.1.128 192.168.1.255;
 option routers 192.168.1.1;
 option domain-name-servers 192.168.1.1;
}
-- /etc/local/etc/dhcpd.conf --

Given that FreeBSD includes the isc-dhcp client, why not the server?

This functionality is all _vastly_ easier to get working in Windows 2000
Pro, taking under an hour vs. days. The biggest problem I had there was
having to "unconfigure" the client, to stop using hardcoded IP addresses,
which you have to do for FreeBSD too. In the pre Win2k timeframe though, I
don't think you could do this with NT4 Workstation, and I've never
configured NT4 Server to do this. I want the FreeBSD machine around too for
other reasons.

 - Jay



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001001c03686$e697a7b0$8001a8c0>