We are using a dhcp server configured with isc-dhcp-server on debian 8 in a small office network. The server has two network adapters one is connected to a pppoe modem and the other is connected to the local network.
/etc/network/interface
# WAN network adapter
auto dsl-provider
iface dsl-provider inet ppp
pre-up /bin/ip link set wan0 up # line maintained by pppoeconf
provider dsl-provider
auto wan0
iface wan0 inet manual
# WLAN network adapter
auto wlan1
iface wlan1 inet static
address 10.10.1.1
netmask 255.255.255.0
network 10.10.1.0
broadcast 10.10.1.255
/etc/dhcp/dhcpd.conf
ddns-update-style none;
log-facility local7;
authoritative;
option subnet-mask 255.255.255.0;
option broadcast-address 10.10.1.255;
option routers 10.10.1.1;
option domain-name-servers 10.10.1.100, 193.231.252.1, 213.154.124.1;
option domain-name "altfel.local";
option netbios-name-servers 10.10.1.100;
subnet 10.10.1.0 netmask 255.255.255.0 {
interface wlan1;
range 10.10.1.2 10.10.1.254;
deny unknown-clients;
}
update-static-leases true;
# hosts after this line...
To give internet access to local computers we used iptables.
/etc/rc.local
#
# By default this script does nothing.
# Enable access to internet
iptables -P FORWARD ACCEPT
iptables --table nat -A POSTROUTING -o wan0 -j MASQUERADE
iptables --table nat -A POSTROUTING -o ppp0 -j MASQUERADE
# Black list
iptables -A FORWARD -s 10.10.1.2 -j DROP
# the list continues...
If I use the options to obtain IP address and DNS server automatically on a windows computer all works ok. If I write the IP address and the DNS server then I have access to the local network but I don't have internet.
The problem is that I need to manually specify a AD DC server as preferred DNS server for the client computers. The domain server (10.10.1.100) is added in dhcpd.conf but I cant join the domain. I can only join the domain if is manually set as preferred.