Subject: Re: dhclient -and- dhcp server in same box?
To: Mike Cheponis <mac@Wireless.Com>
From: Eric Fox <eric@fox.phoenix.az.us>
List: netbsd-help
Date: 10/10/2003 06:08:48
The trick is to specify which network interface is to be used by dhclient
and dhcpd.  These can be set in rc.conf by setting using dhclient_flags
and dhcpd_flags to the interface names you want to use.

EXAMPLE
Assume you have ex0 connected to your DSL modem.
Assume ne0 is connected to your LAN with IP address 192.168.1.1.
Asusme your DNS server is 205.138.230.66.

In /etc/rc.conf, you would had the following entries:

  dhclient=YES		dhclient_flags="ex0"
  dhcpd=YES		dhcpd_flags="ne0"

You could then create a simple /etc/dhcpd.conf file:

  # global
  option domain-name "my_domain.com";
  option domain-name-servers 205.138.230.66;
  option subnet-mask 255.255.255.0 ;
  default-lease-time 600;
  max-lease-time 7200;
  authorative;
  ddns-update-style none;

  subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.100 192.168.1.254;
    option routers 192.168.1.1;
  }


Both dhclient and dhcpd can now be started and should happily coexist.

---
  /\---/\  Eric J Fox
 /  o o  \ Home & Small Business Computer Support
 \.\   /./ in the Phoenix Metropolitan Area
    \@/    http://fox.phoenix.az.us/support
.


On Tue, 21 Oct 2003, Mike Cheponis wrote:

> Hi,
>
> I have DSL that gives me one IP address via DHCP.
>
> But I have several other machines that I would like to either assign
> permanent non-routable addresses or have them be "local clients" to
> my internal net getting their IP info via DHCP.
>
> I'd like all the machines to have Internet access through the main
> NetBSD box (which has 2 ethernet interfaces - one that connects to the
> DSL modem, the other that connects to a switch that has all my other
> local machines.)
>
>
> How do I do this?  What I find is that since the machine that's
> connected to DSL is up all the time (except when I install patches
> or whatever) and the IP address is assigned and kept the same while
> the machine stays up.
>
> But I don't know know to work that into a "dynamic" DHCP server for
> my other local machines.  I didn't see anything explaining how to
> do this in dhcpd.conf(5) or dhcpd(8).
>
> Thanks for any ideas on this!
>
>
> -Mike
>