Re: DHCP Servr configuration
I do this dhcp server for home LAN system on gateway machine. eth0 for
cable connection and eth1 for LAN side.
On Sat, Nov 10, 2001 at 10:56:01PM +0100, Eric Smith wrote:
> Would like to have the bare minimum config for a single networked
> (windows) machine which I want to give internet access to from my
> debian server.
LAN uses 1-127 for fixed address machines. Now examples:
# dhcpd.conf
# option definitions common to all supported networks...
option domain-name "lan.aokiconsulting.com";
option domain-name-servers 192.168.1.1;
option subnet-mask 255.255.255.0;
default-lease-time 600;
max-lease-time 7200;
host hub {
hardware ethernet 00:40:05:df:79:6d;
fixed-address 192.168.1.201;
}
# DHCP 100-200
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.128 192.168.1.200;
option domain-name-servers 192.168.1.1;
option domain-name "lan.aokiconsulting.com";
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
default-lease-time 600;
max-lease-time 7200;
}
______
Also "/etc/init.d/dhcp" is modified to run on eth1 for LAN.
#! /bin/sh
#
# Start or stop dhcpd daemon
#
# Add all interfaces you want dhcpd to handle here
test -x /usr/sbin/dhcpd || exit 0
# Set run_dhcpd to 1 to start dhcpd at boot or 0 to disable it.
run_dhcpd=1
if [ $run_dhcpd = 0 ]; then
cat <<EOF
Please edit the file /etc/dhcpd.conf according to your needs. The current
/etc/dhcpd.conf is just the sample file that is provided with the DHCP
package from the Internet Software Consortium, so it will not be useful
at all for you.
After you have edited /etc/dhcpd.conf you will have to edit
/etc/init.d/dhcp as well. There you will have to set the variable
run_dhcpd to 1, and then type "/etc/init.d/dhcp start" to start the
dhcpd daemon.
EOF
exit 0
fi
DHCPDPID=/var/run/dhcpd.pid
case "$1" in
start)
start-stop-daemon --start --quiet --pidfile $DHCPDPID \
--exec /usr/sbin/dhcpd -- eth1
;;
stop)
start-stop-daemon --stop --quiet --pidfile $DHCPDPID
;;
restart)
start-stop-daemon --stop --quiet --pidfile $DHCPDPID
sleep 2
start-stop-daemon --start --quiet --pidfile $DHCPDPID \
--exec /usr/sbin/dhcpd -- eth1
;;
*)
echo "Usage: /etc/init.d/dhcp {start|stop|restart}"
exit 1
esac
exit 0
--
~\^o^/~~~ ~\^.^/~~~ ~\^*^/~~~ ~\^_^/~~~ ~\^+^/~~~ ~\^:^/~~~ ~\^v^/~~~
+ Osamu Aoki <debian@aokiconsulting.com>, GnuPG-key: 1024D/D5DE453D +
+ My debian quick-reference, http://www.aokiconsulting.com/quick/ +
Reply to: