Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Aug 2010 13:15:25 -0700
From:      Nerius Landys <nlandys@gmail.com>
To:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   DHCP server and bridge, mixed w/ some static IP assignments
Message-ID:  <AANLkTik6Mu7Lv0DBg89yFdg0_-i5U1vnuZF%2BEXQvVNM0@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
I'm trying to add some sort of DHCP server functionality to my router
box running FreeBSD 7.1.  First, let me explain the current network.
This is how my rc.conf is currently configured, and everything is
running smoothly:

gateway_enable="YES"
hostname="speedy.i"
ifconfig_fxp2="DHCP" # Connecting to the outside internet via AT&T UVerse
cloned_interfaces="bridge0"
ifconfig_bridge0="addm re0 addm ath0 addm fxp0 addm fxp1 up" # Bridge
consisting of four interfaces
ifconfig_re0="up" # My gigabit wired interface
ifconfig_ath0="ssid speedy.i mode 11g mediaopt hostap up" # Wireless interface
ifconfig_fxp0="up" # 100 megabit wired
ifconfig_fxp1="up" # 100 megabit wired
ipv4_addrs_bridge0="192.168.0.254/24"
ipnat_enable="YES"
hostapd_enable="YES"

So as you can see, I have an internal network with 192.168.0.0/24 IP
addresses.  Both the wired and wireless are in the same network, and
this is the way I've decided that I want it.  All the machines
connected to this internal network are using static IP addresses, even
the wireless laptops.

Now, I'd like to add a DHCP server capability to the 192.168.0.0/24
network, but I'd like to allow some machines to still connect with
static IP addresses (of their own choice, not controlled by the router
via MAC address lookups for example).

So, I'm reading this:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-dhcp.html
under the server section.

And I have a few questions.

First, I look in /usr/ports/net/ and I find both isc-dhcp31-server and
isc-dhcp41-server.  The manual says to use the 31 version.
Q1: Which do you recommend?  I know that the manual is oftentimes out
of date.  I'm on FreeBSD 7.1.

Next, would it be possible to, for example, DHCP-lease out IP
addresses above 192.169.0.127, but leave IP addresses below that as
statically assigned?  For example my plan for dhcpd.conf:

option domain-name "i";
option domain-name-servers 192.168.0.254;
option subnet-mask 255.255.255.0;
default-lease-time 3600;
max-lease-time 86400;
ddns-update-style none;
subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.128 192.168.0.253;
  option routers 192.168.0.254;
}

And in my rc.conf I plan to add:

dhcpd_enable="YES"
dhcpd_ifaces="bridge0"

Q2: Now is it legal to assign a bridge to a dhcpd interface?  That
would be nice, because then both wired and wireless machines could
connect via DHCP.  If it's not possible to do this, can I at least
assign the ath0 (my wireless interface) to the dhcpd interface, even
though ath0 is part of a bridge?

Q3: I have some machines connected via static IP addresses, e.g.
192.168.0.9 and 192.168.0.10.  I would like to keep it this way, and
let the clients themselves control which IP addresses they want to
use.  Am I allowed to mix DHCP leases with static assignments on the
same network like this?

I'm afraid to get locked out of my router, because right now it's only
accessible over the network.  If I get locked out I'll have to hook up
either the serial console via null modem cable or a monitor/keyboard,
which could be a pain.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTik6Mu7Lv0DBg89yFdg0_-i5U1vnuZF%2BEXQvVNM0>