LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Problems concerning DHCP-server on my Debian 3.0r2 server (https://www.linuxquestions.org/questions/linux-networking-3/problems-concerning-dhcp-server-on-my-debian-3-0r2-server-243311/)

spaceuser 10-16-2004 02:23 AM

Problems concerning DHCP-server on my Debian 3.0r2 server
 
It's hard to be a newbie, that's for sure.

The goal
========
My goal is to setup a text based (no X) file/print/internet/webserver server using Debian 3.0r2. With use of Samba for a few Windows clients, using DHCP for addressing. The server should have a shareable Internet connection using a 56K modem. No direct NET or DSL possible here, I'm affraid. It should also have a laser printer connected on the parallell port. The PC is an old Packard Bell 266 Intel P2 w 384 MB ram & 120 MB hdd. It has only one ethernet card, a 3COM, 3C905CX, with static IP, set to 192.168.7.1. The Apache webserver should be for local net use only. The server is UPS secured by an APC (Smart-UPS) for power loss, using the apcupsd daemon, which is not yet tested. It shouldn't be that hard to fix, I thought for a couple of weeks ago anyway. Later, Webmin and PHP4 will be added.

When installing I set no domain name, since it's local and no local DNS is used
Only a workgroup name is already set, to be able to get Samba working.

The Problem
============
My problem is to configuring the /etc/dhcpd.conf file.

After running:
dhcpd start

I receive:
"No subnet declaration for start(0.0.0.0)
Please write a subnet declaration in your dhcpd.conf file for the
network segment to which interface start is attached.
exiting."

An ifconfig etho command, seems ok, with the right IP-address etc.

I seached the net and found tons of people having the same error message, but noone seems to be able to solve it. The few answers I found, didn't help me anyway. Some says "you should have the options declaration within the subnet declarations", others don't. No one seems to actually knowing, only guessing.

My /etc/dhcpd.conf file:
subnet 192.168.7.0 netmask 255.255.255.0 {
range 192.168.7.10 192.168.7.20;
option domain-name "192.168.7.1";
option broadcast-address 192.168.7.255;
option subnet-mask 255.255.255.0;
default-lease-time 600;
max-lease-time 7200;
}

I would really appreciate if anyone could share some light on this.

TIA

mritch 10-16-2004 05:29 AM

try to start the server with "dhcpd eth0".
add a line:
option routers <internel_iface_ip>;
to you conf.

sl mritch.

spaceuser 10-16-2004 07:22 AM

Quote:

option routers <internel_iface_ip>;
Tried that one and also to start using, dhcpd eth0, and receive the same answer as before.

BTW, the /etc/init.d/dhcp script already contains an INTERFACES = "eth0" tag. Do I really have to point out the ethernet card anyway, there is only one in the computer. Also the start script for dhcpd assumes eth0.

So the problem is still there... sorry to say

mritch 10-16-2004 11:10 AM

Quote:

... already contains an INTERFACES = "eth0" tag.
no you don't. was just an idea.

..but i thought the router option would help :-(

option routers <internel_iface_ip> = option routers 192.168.7.1
...internal_...


sl mritch.

spaceuser 10-16-2004 12:47 PM

Yes it's strange that it wont work for me.

I put the option routers line like below:

subnet 192.168.7.0 netmask 255.255.255.0 {
range 192.168.7.10 192.168.7.20;
option domain-name "192.168.7.1";
option broadcast-address 192.168.7.255;
option subnet-mask 255.255.255.0;
option routers 192.168.7.1;
default-lease-time 600;
max-lease-time 7200;
}

I hope the order of the dhcpd.conf contents is not important

Thanks for your effort to help.

mritch 10-16-2004 02:19 PM

the "dhcpd eth0" was because...

you're a dhcp client from your isp and
a dhcpd-server for your inner net.

..so i wanted to go sure dhcpd doesn't look around to see whats on. afaik there are other dhcp-servers around. try another? i just know udhcpd for now.

sl ritch.

TigerOC 10-16-2004 04:06 PM

You need a couple of things to complete the project.
To configure the network you need to edit /etc/network/interfaces and add;

auto eth0
iface eth0 inet dhcp

To allow other computers to use the route you need to install ip-masq (apt-get install ip-masq). Iwould suggest using MonMoth's firewall which will do both firewalling and forwarding for you.
Edit: Link is doing some weird stuff but MonMothas firewall is very popular and there are a number of artciles on it and they will come up on a google search.

spaceuser 10-17-2004 02:55 AM

I find this strange...
Quote:

iface eth0 inet dhcp
Could that really be the right thing to do, since my Internet connection is established using a 56K modem, and the eth0 is used to be able to create a local LAN. Shouldn't my dhcp settings be static for eth0 then. My current /etc/network/interfaces looks like this:

Code:

# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during Debian installation
# (network, broadcast and gateway are optional)
auto eth0
iface eth0 inet static
            address 192.168.7.1
            netmask 255.255.255.0
            network 192.168.7.0
            broadcast 192.168.7.255


BTW, thanks for the tip about the firewall

TigerOC 10-17-2004 03:54 AM

If you not going to run a dhcp server then using static addressing for the interface is fine. You can leave it as is.
If you are using a modem connection then using MonMotha's firewall is all you need. When you configure the script you tell it that the external interface is the modem ppp0 and the internal interface is eth0. With ip-masq installed the script then takes care of ip-forward and ip-masquerading for you and acts as a firewall into the bargain. There is no need for dhcp at all which is really an old M$ concept.

spaceuser 10-17-2004 12:30 PM

Quote:

There is no need for dhcp at all which is really an old M$ concept.
Didn't know that M$ was behind the dhcp thing, but I like it anyway, it's kind of neat when you as me move between LANs, and you don't need to change the static IPs on the laptop all the time.

I need to confess that I think I have found why I receive the dhcp respone, "No subnet declaration for start(0.0.0.0)....."

I downloaded and followed the document, "Installing Debian GNU/Linux 3.0 For Intel x86", from the debian.org site. In the chapter 4.5.3, I quote,
Quote:

After you have edited the `dhcpd' configuration file, restart it with `/etc/init.d/dhcpd restart'
I have all the time tried, /etc/init.d/dhcpd start
But to start/stop it, I should have use, /etc/init.d/dhcp start
So now, I can connect my clients to it as expected.

Thanks, for all the help anyway. I will now configuring Samba and printing and also the MonMotha's firewall, so hopefully I will manage a few hours.


All times are GMT -5. The time now is 08:34 AM.