Re: [Nolug] Configure DHCP on RH7.3

From: Christoph <jcboget_at_yahoo.com>
Date: Sat, 29 Nov 2003 16:56:39 -0600
Message-ID: <001101c3b6cc$48d41cb0$0700a8c0@mourning>

I tried setting the dhcp server up today. I had a
lot of problems. Now, I'm going to be tossing out
alot of information here. I don't know if it is
or is not relevant and I also don't know if this is
all the information you'll need. If you need anything
more, please let me know.

This is what I put in my dhcpd.conf file:

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.150 192.168.0.200;
default-lease-time 604800;
max-lease-time 604800;
option subnet-mask 255.255.255.0;
option routers 192.168.0.1;
option domain-name-servers 209.124.193.250;
}

Whenever I try to restart my dhcp daemon (using
K35dhcpd script in /etc/rc3.d), I get an error
saying that there is no configuration for eth1.
And the dhcp server fails to start. When I just
try to run "/sbin/dhcpd eth0", I lose all internet connectivity.

What I don't understand is that eth1 is a dhcp
client. It gets it's information from my provider's dhcp server. I don't
want to set up a configuration
for it, do I? I just want to leave things as they
are with eth1?

Other issues I came across:

The following is in my IPTABLES script to allow for
dhcp traffic (presumably):

____________________________
LOCAL_INTERFACE_1="eth0" # internal LAN interface
EXTERNAL_INTERFACE="eth1" # external net interface
BROADCAST_SRC="0.0.0.0" # broadcast source address
BROADCAST_DEST="255.255.255.255" # broadcast destination address
PRIVPORTS="0:1023" # well known, privileged port range
UNPRIVPORTS="1024:65535" # unprivileged port range

# %%%%%%%%%%%%%%
# DHCP client %%
# %%%%%%%%%%%%%%

# Read DHCP info
 if [ -f /etc/dhcpc/dhcpcd-$EXTERNAL_INTERFACE.info ];then
    . /etc/dhcpc/dhcpcd-$EXTERNAL_INTERFACE.info
    DHCP_SERVER=$DHCPSID
    IPADDR=$IPADDR
    HOST=$HOSTNAME
    DOMAIN=$DOMAIN
# MAILSERVER="mail.$DOMAIN"
# NEWSSERVER="news.$DOMAIN"
 fi

 echo "DHCP INFO..."
 echo "Host Name: $HOST"
 echo "Domain Name: $DOMAIN"
 echo "HOST IP: $IPADDR"
 echo "DHCP SERVER IP: $DHCP_SERVER"

 DHCP_SERVER="0/0"

# allow dhcp server (67) to connect to dhcp client (68)
# Note: the DHCP server is the only externel source of broadcast
# messages we should see, ever.

 $IPTABLES -A INPUT -i $EXTERNAL_INTERFACE -p udp -s $DHCP_SERVER --sport
67 -d $IPADDR --dport 68 -j ACCEPT
 $IPTABLES -A OUTPUT -o $EXTERNAL_INTERFACE -p udp -s $IPADDR --sport 68 -d
$DHCP_SERVER --dport 67 -j ACCEPT
 $IPTABLES -A INPUT -i $EXTERNAL_INTERFACE -p udp -s $DHCP_SERVER --sport
67 -d $BROADCAST_DEST --dport 68 -j ACCEPT
 $IPTABLES -A OUTPUT -o $EXTERNAL_INTERFACE -p udp -s
$BROADCAST_SRC --sport 68 -d $DHCP_SERVER --dport 67 -j ACCEPT

# Get renumbered

 $IPTABLES -A INPUT -i $EXTERNAL_INTERFACE -p udp -s
$BROADCAST_SRC --sport 67 -d $BROADCAST_DEST --dport 68 -j ACCEPT
 $IPTABLES -A OUTPUT -o $EXTERNAL_INTERFACE -p udp -s
$BROADCAST_SRC --sport 68 -d $BROADCAST_DEST --dport 67 -j ACCEPT

# As a result of the above, we're supposed to change our IP
# address with this message, which is addressed to our new
# address before the dhcp client has received the update.

 $IPTABLES -A INPUT -i $EXTERNAL_INTERFACE -p udp -s $DHCP_SERVER --sport
67 --dport 68 -j ACCEPT
 $IPTABLES -A INPUT -i $EXTERNAL_INTERFACE -p udp --sport 67 -d
$IPADDR --dport 68 -j DROP
____________________________

In the file
/etc/dhcpc/dhcpcd-$EXTERNAL_INTERFACE.info
there is the following information:

For eth0:

IPADDR=192.168.1.102
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
GATEWAY=192.168.1.1
DNS=192.168.1.1
DHCPSID=192.168.1.1
DHCPGIADDR=0.0.0.0
DHCPSIADDR=0.0.0.0
DHCPCHADDR=00:04:5A:74:D7:A0
DHCPSHADDR=00:06:25:BF:24:F9
DHCPSNAME=
LEASETIME=300
RENEWALTIME=150
REBINDTIME=262
INTERFACE=eth0
CLASSID="Linux 2.4.18-3 i586"
CLIENTID=00:04:5A:74:D7:A0

For eth1
IPADDR=64.237.76.167
NETMASK=255.255.255.0
NETWORK=64.237.76.0
BROADCAST=64.237.76.255
GATEWAY=64.237.76.254
DOMAIN=eatel.net
DNS=209.124.193.250,209.124.203.12
DHCPSID=209.124.203.21
DHCPGIADDR=0.0.0.0
DHCPSIADDR=209.124.203.21
DHCPCHADDR=00:04:5A:68:D4:91
DHCPSHADDR=00:10:67:00:86:B5
DHCPSNAME=
LEASETIME=28800
RENEWALTIME=14400
REBINDTIME=25200
INTERFACE=eth1
CLASSID="Linux 2.4.18-3 i586"
CLIENTID=00:04:5A:68:D4:91

In the eth0 file, why is the ip address set to
IPADDR=192.168.1.102? It should be 192.168.0.1.

If these files exist, the dhcp information is
retrieved from them and if they do not exist, the
information is retrieved from elsewhere (and I do
not know from where) and the files are created. If
I delete the files to get them to be recreated,
IPTABLES gives me an error saying that 68 is an
invalid argument. Why? Are those lines wrong in my
IPTABLES script?

I've got to be doing something wrong here. Everyone
I've talked to said that setting up a dhcp server is
as simple as setting up the right configuration file.
That does not seem to be the case for me where I have
one NIC being a dhcp client (of my provider) and the
other NIC being a dhcp server (for my internal PCs).

Any ideas? Do you need any further information?

Thanks for your continued time and assitance. I am
definitely feeling kind of overwhelmed...

Chris

___________________
Nolug mailing list
nolug@nolug.org
Received on 11/29/03

This archive was generated by hypermail 2.2.0 : 12/19/08 EST