Re: DHCP Servr configuration

2001-11-11 Thread Michel Loos
On Sat, 2001-11-10 at 23:21, Osamu Aoki wrote:
 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.

Seems to me that what you are looking for is not DHCP but NAT.

1) Configure your second eth card to 192.168.0.1.

2) Activate nat on your gnu/linux box

echo 1  /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
(on a 2.4 kernel)
eth0 is my external(cable modem) interface, for you it could be pppx for
a modem.

3)On the MS machine use a 192.168.0.xx IP and define 192.168.0.1 as your
gateway. You are set.

On a 2.2 kernel it is similar and even easier: install the ipmasq
package, 

Michel.



DHCP Servr configuration

2001-11-10 Thread Eric Smith
I am attempting to set up a dhcp server and its going rather
slowly.

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.

The debian runs the dhcpcd and is configured thus by the ISP:
  inet addr:24.132.170.14  Bcast:24.132.171.255  Mask:255.255.254.0
So now this machine has internet access.

I configure eth0 as follows:
 ifconfig  eth0 204.254.239.10  up

Here is the dhcp.conf which I had a go at:
---
option domain-name loots.com;

default-lease-time 600;
max-lease-time 7200;

subnet 128.164.1.0 netmask 255.255.255.0 {
  range 128.164.1.0  128.164.1.20;
  option broadcast-address 128.164.1.10;
}
---
I am sure the broadcast-address is wrong.

/usr/sbin/dhcpd eth0

This manages to configure the client windows machine and I
may telnet from it to the debian.  To get internet access, however,
I experimented manually adding a default route (to both eth0
and eth1 of the debian).  Nothing works to give the windows machine
internet access.

What could I be missing?


-- 
Eric Smith



Re: DHCP Servr configuration

2001-11-10 Thread Osamu Aoki
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 [EMAIL PROTECTED], GnuPG-key: 1024D/D5DE453D  +
+  My debian quick-reference, http://www.aokiconsulting.com/quick/+