LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   dhcpd confusions (https://www.linuxquestions.org/questions/linux-networking-3/dhcpd-confusions-251135/)

kidicarus 11-04-2004 01:21 PM

dhcpd confusions
 
Hi.

I recently decided to try comcast cable modems, switching from AOL DSL. With AOL DSL, I would connect to the net with ppp0, then use firestarter to share the connection, and then i would use dhcpd to assign the other computers an ip address.

Right now I think I'm stuck on the last part. I changed firestarter and my dhcpd conf to work with my new configurations, but when i try and start up dhcpd i get:
Starting dhcpd: Internet Software Consortium DHCP Server 2.0pl5
Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.
All rights reserved.

Please contribute if you find this software useful.
For info, please visit http://www.isc.org/dhcp-contrib.html

Listening on Socket/eth1/192.168.0.0
Sending on Socket/eth1/192.168.0.0
No subnet declaration for eth0 (24.x.x.x).
Please write a subnet declaration in your dhcpd.conf file for the
network segment to which interface eth0 is attached.
exiting.

I've tried different subnets and different configurations, even tried a class A network, my last attempt was with this:
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.100;
option domain-name-servers 216.x.x.x;
option domain-name "attbi.com";
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
default-lease-time 9000;
max-lease-time 10000;
}

I really don't know what the subnet should be:
eth0 Link encap:Ethernet HWaddr 00:E0:29:3E:EB:C4
inet addr:24.x.x.x Bcast:255.255.255.255 Mask:255.255.240.0

I don't understand why the first octet is 24 first of all, second, i don't know what that 240 is.

My last configuration worked fine like this:
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.100;
option domain-name-servers 198.x.x.x;
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
default-lease-time 9000;
max-lease-time 10000;
}

And never complained when ppp0 was connected, any advice?

musicman_ace 11-04-2004 03:34 PM

Your internal subnet ( the default) should be 255.255.255.0 {and you did change it to this on your final attempt}

I'm assuming that Eth0 is your internet connection.
The 24 in 24.x.x.x is part of your IP address. Your ISP assigns you one of their IP addresses and it just happens that yours starts with 24. There isn't anything you can do (except down the nic) and it isn't going to hurt you, so I wouldn't
worry about it. The 240 in the subnet mask is just because the ISP probably has many subnets for your surrounding areas. You are on the 255.255.240 subnet, and again you should worry about that. Neither of those things will affect your NAT if your are connecting multiple computers.

Since you changed your internal network to
192.168.x.x and the subnet is its default of 255.255.255.0, you've setup
everything correctly and consequently it worked. Since you did get it to
work, I'm wondering what question (besides just answering the Why is this number...) you have.

Just because the default subnet for 192.168.x.x is 255.255.255.0 doesn't mean you couldn't make your internal network just like the ISPs. You could change it to 255.255.240.0, but you wouldn't gain or lose anything so why bother. If you want more info on subnets, check out learntosubnet.com

kidicarus 11-04-2004 04:01 PM

No, I still haven't got it to work, even if i set the ip address manually on my windows machine it will not work.

What worked was my old configuration, which was like this: Eth0 connected to the adsl modem, which when connected would bring up ppp0. I would then set firestarter to share the connection (NAT) and then I would use DHCPD to assign ip addresses automatically. It worked great.

Now, however, I replaced my dsl modem with cable, and eth0 comes up and connects fine, as does firestarter, but my internal network is not working except for pinging:

eth1 looks like this:

eth1 Link encap:Ethernet HWaddr 00:20:78:1C:8F:06
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.240.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:222 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:43157 (42.1 Kb) TX bytes:0 (0.0 b)
Interrupt:9 Base address:0x1400

(ip address set manually)

dhcpd.conf looks like this:
subnet 192.168.0.0 netmask 255.255.240.0 {
range 192.168.0.2 192.168.0.100;
option domain-name-servers 216.x.x.x;
option domain-name "attbi.com";
option routers 192.168.16.1;
option subnet-mask 255.255.240.0;
option broadcast-address 192.168.0.255;
default-lease-time 9000;
max-lease-time 10000;
}
when i type /etc/init.d/dhcpd start
the error I get is this:


Listening on Socket/eth1/192.168.0.0
Sending on Socket/eth1/192.168.0.0
No subnet declaration for eth0 Please write a subnet declaration in your dhcpd.conf file for the
network segment to which interface eth0 is attached.
exiting.
[FAILED]


Here, a gentleman had much the same problem, and I'm not sure what he did to fix it.

kidicarus 11-04-2004 04:04 PM

Basically I'm not sure if my internal network should be 192.168.0.x, nor am I sure what the subnet declaration should be.

musicman_ace 11-04-2004 04:11 PM

The default for 192.168.x.x is 255.255.255.0

Now I'm curious why the router is 192.168.16.1
I would assume for a home network that it be 192.168.0.1

musicman_ace 11-04-2004 04:13 PM

If it says no declaration for eth0, it sounds like dhcpd is listening to eth0 and you don't want that.

also, I'm not at all familiar with firestarter, so I have to assume that is working properly.

kidicarus 11-04-2004 04:19 PM

Quote:

Now I'm curious why the router is 192.168.16.1
That was just a trial, it's back to 192.168.0.1 and it's still not working. If eth0 is down it works, but that doesn't really solve anything, i think eth0 always comes into play.


All times are GMT -5. The time now is 05:23 PM.