LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-25-2004, 07:06 PM   #1
Hunza
LQ Newbie
 
Registered: May 2004
Location: Aussie lost in Switzerland
Distribution: Debian (Have I seen the lite?)
Posts: 23

Rep: Reputation: 15
Angry DHCP Subnet Problems


I am going friggin insane over DHCP server. This problem is probably a no brainer for you guru types but it is sending me to the funny farm.

All i ever get is "No Subnet declaration for ETH1". Now please correct me if I am wrong, but isnt that the first line in my dhcp.conf below??? If not please feel free to suggest an alternative.

subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
range 192.168.1.2 192.168.1.60;
}

ddns-update-style none ;
ddns-updates off ;
default-lease-time 600;
log-facility local7;
max-lease-time 7200;
option broadcast-address 192.168.1.255;
option domain-name-servers 212.4.64.140;
option netbios-dd-server 192.168.1.1;
option netbios-name-servers 192.168.1.1;
option netbios-scope "";
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;

I have been through every howto and help file I can find and have still had no joy.
I am using ISC's DHCP Server V3.0.1rc12 on suse 9.0

I have noticed that there are a number of posts relating to similar probs, tried the fixes offered there as well to no avail.
Is it just me or has Suse managed to completely botch up DHCP server??
 
Old 05-25-2004, 07:53 PM   #2
Hunza
LQ Newbie
 
Registered: May 2004
Location: Aussie lost in Switzerland
Distribution: Debian (Have I seen the lite?)
Posts: 23

Original Poster
Rep: Reputation: 15
Tried Hakcenters suggestion of adding the line DHCPARG=eth0 in to dhcpd.conf (a redhat fix for the same problem apparently, thx hakcenter).

Had a modicum of success in that the subnet dec issue went away and was replaced by a subnet not in the 192.168.1.2 - 192.168.1.60 range. Problem is that when I change it to be in the same range, the subnet dec issue comes back.

I have very little hair left now...........................
 
Old 05-26-2004, 01:31 PM   #3
Medievalist
Member
 
Registered: Aug 2003
Distribution: Dead Rat
Posts: 175

Rep: Reputation: 37
I'd remove the aforementioned "Red Hat hack" (I've been running ISC's DHCPd on Red Hat for eight years, and I never heard of that before).

But the main problem is you've got at least two interfaces and you've only defined one of them in your DHCP config. You have to tell the DHCPd what to do with all your interfaces, even if the configuration is "do nothing for this interface".

Post the output from "ifcfg" and we'll see what's up.

Incidentally, IMnsvHO, your global options should be before subnet declarations, not after. Also, supplying any value whatsoever for netbios-scope is usually a prelude to disaster.

--Charlie
 
Old 05-27-2004, 05:49 AM   #4
Hunza
LQ Newbie
 
Registered: May 2004
Location: Aussie lost in Switzerland
Distribution: Debian (Have I seen the lite?)
Posts: 23

Original Poster
Rep: Reputation: 15
I tried putting in a second subnet declaration to see what would happen but still got the same error. (I probably screwed it up tho)
As for the order of text in the dhcpd.conf file, thats the way Yast writes it. I have modified myself several times manually but if I run Yast later it just rewrites in the opposite order.

ifcfg below

linux:/home/karl # ifconfig -a


eth0 Link encap:Ethernet HWaddr 00:02:44:4C:20:3C

inet addr:192.168.0.189 Bcast:192.168.0.255 Mask:255.255.255.0

inet6 addr: fe80::202:44ff:fe4c:203c/64 Scope:Link

UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1

RX packets:131 errors:0 dropped:0 overruns:0 frame:0

TX packets:143 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:100

RX bytes:19771 (19.3 Kb) TX bytes:21824 (21.3 Kb)

Interrupt:5 Base address:0x9400



eth1 Link encap:Ethernet HWaddr 00:00:F4:C9:6E:80

inet addr:198.162.1.1 Bcast:198.162.1.255 Mask:255.255.255.0

inet6 addr: fe80::200:f4ff:fec9:6e80/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:0 errors:0 dropped:0 overruns:0 frame:0

TX packets:0 errors:51 dropped:0 overruns:0 carrier:51

collisions:0 txqueuelen:100

RX bytes:0 (0.0 b) TX bytes:6053 (5.9 Kb)

Interrupt:11 Base address:0x9000



lo Link encap:Local Loopback

inet addr:127.0.0.1 Mask:255.0.0.0

inet6 addr: ::1/128 Scope:Host

UP LOOPBACK RUNNING MTU:16436 Metric:1

RX packets:294 errors:0 dropped:0 overruns:0 frame:0

TX packets:294 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:24465 (23.8 Kb) TX bytes:24465 (23.8 Kb)



sit0 Link encap:IPv6-in-IPv4

NOARP MTU:1480 Metric:1

RX packets:0 errors:0 dropped:0 overruns:0 frame:0

TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
 
Old 05-27-2004, 05:59 AM   #5
Hunza
LQ Newbie
 
Registered: May 2004
Location: Aussie lost in Switzerland
Distribution: Debian (Have I seen the lite?)
Posts: 23

Original Poster
Rep: Reputation: 15
I should add what I am trying to achieve here. Basically to replace my windows LAN with a LINUX LAN.

ETH0 faces my ISP, receives its IP via DHCP from the ISP. The ip shown in the ifconfig is a result of the linux box being connected to my windows LAN.

When the Linux is connect to the ISP, the IP issued is always 212.4.74.xxx, default gateway is 212.4.74.1, subnet is 255.255.255.0.

I would like to share the internet connection via ETH1 (in the same manner that you can with windows) via DHCP to 3 other linux boxes + 1 windows box, but present only the IP from eth0 (ip masq?) but at this stage i would be happy just to be able get everything talking to each other and web access from each machine.
 
Old 05-27-2004, 05:10 PM   #6
Medievalist
Member
 
Registered: Aug 2003
Distribution: Dead Rat
Posts: 175

Rep: Reputation: 37
Ah, I see. I don't know how windows does that sort of thing, I only use it for desktop stuff and run linux in server/infrastructure roles.

You can get everything you want very easily with smoothwall. Download a CD from www.smoothwall.org and run it on an old 486 or similar junker. I run mine on an old industrial PC (basically a very small, low-power-draw p-233 with a solid-state 80 MB hard drive and no fans). It runs transparent squid, the Snort intrusion detection system, firewalling, address masquerading, DNS caching, DHCP etc. etc. etc. and it took about twenty minutes to set the whole thing up.

But, assuming you want to keep going with ISC DHCPd, I'll continue... I looked at the dhcpd.conf man page, and it specifically says that the global options need to go before the subnet declarations. So YAST seems to be buggy, better not use YAST for this.

Also it says "For every subnet which will be served, and for every subnet to which the dhcp server is connected, there must be one subnet declaration, which tells dhcpd how to recognize that an address is on that subnet. A subnet declaration is required for each subnet even if no addresses will be dynamically allocated on that subnet."

Now, I know from experience that I don't have to declare loopback. But, you've got a whole bunch of interfaces lit up on your machine and they are going to need to be declared to DHCPd. For instance, you've got three IPv6 interfaces and two IPv4 interfaces. Since you've only got two physical network cards, this is going to require that the subnet declarations for some of these networks be enclosed in shared-network declarations.

Why are you running IPv6? Is this a requirement? It's going to make your machine configuration significantly more difficult for nearly everything that has anything to do with the network (firewalling and masqerading, for example).
 
Old 05-27-2004, 05:42 PM   #7
RHELL
Member
 
Registered: Feb 2004
Location: Outermost mingetty
Distribution: RHEL3,RH4U4,Sol9, Sol10
Posts: 321

Rep: Reputation: 31
Is eth1 supposed to be 192.168.1.1 ?

quote:>eth1 Link encap:Ethernet HWaddr 00:00:F4:C9:6E:80
>inet addr:198.162.1.1 Bcast:198.162.1.255 Mask:255.255.255.0
 
Old 05-27-2004, 07:14 PM   #8
Hunza
LQ Newbie
 
Registered: May 2004
Location: Aussie lost in Switzerland
Distribution: Debian (Have I seen the lite?)
Posts: 23

Original Poster
Rep: Reputation: 15
As far as I know (and I am by no means an expert on this) but windows does some sort of autoconfig in a very basic, convoluted DHCPd mated with iptables fashion. not that it matters now as I have come to the decision that DHCPd is not only a complete pain in the rear, but also inadequate for what I want to do. Although security is not an immediate issue, when the time comes DHCPd will not give me any real diversity.

I tried declaring subnets for both NIC's and got the same error for each card (no subnet declaration) I think I agree that the suse Yast is doing something strange when it writes the conf file.

in answer to the IPv6 question, it is the default IPver that suse runs. Its supposed to be backwards compatable to IPv4 so there should be no real issues there.

As for smoothwall, I think that i will give it a try. I have webmin which has a neat GUI for smoothwall so I will give it a go and see if i can preserve what remains of my hair. are there any tips or "traps for new players" that I should be aware of??

For the moment though I am now have NIC issues (it just gets better and better!!) for some bizarre reason my Linux box can no longer get an IP via DHCP from my ISP. first I thought it was the NIC, but having replaced both the NIC and trying to connect with a completely different machine as well i still get no joy. Windows box is fine when I connect it. Linux box/s wont work. I had exactly the opposite problem last night in that the windows box couldnt connect but the Linux box/s could. I have a horrible feeling that when my ISP issues a DHCP lease, the lease is valid only for the NIC it gets issued to for the duration of the lease. Anyone heard of this sort of thing or got any thoughts??

By the way, i can ask for a IP lease renew in windows with ipconfig /renew without having to stop and start the NIC interface, is there a similar command for linux or is ifdown and ifup the only option?

RHELL, Eth1 was intentionally configed as 192.168.1.1 It was going to be the static IP for DHCPd server.
 
Old 05-28-2004, 10:28 AM   #9
zaphodiv
Member
 
Registered: Oct 2003
Distribution: Slackware
Posts: 388

Rep: Reputation: 30
dhcpd looks at the subnets to work out which interfaces to work on.

You have told dhcpd to use subnet 192.168.1.0 netmask 255.255.255.0
If eth1 has the address 192.168.1.1 then that is not in the subnet
you have told dhcpd to use.

Your router address should be within the subnet you are giving to clients.
Use 192.168.0.1 instead.

>You have to tell the DHCPd what to do with all your interfaces,
>even if the configuration is "do nothing for this interface".

No you don't. If you don't want to use dhcp on an interface you can
not configure it for that interface and ignore the message about
no subnet declaration.

>As far as I know (and I am by no means an expert on this) but
>windows does some sort of autoconfig in a very basic, convoluted
>DHCPd mated with iptables fashion.

No, if you leave windows set to "automatically obtain an ip address"
it does uses DHCP to try to get one.

>By the way, i can ask for a IP lease renew in windows with
>ipconfig /renew without having to stop and start the NIC interface,
>is there a similar command for linux or is ifdown and ifup the only option?

Read the man page for whatever dhcp client redhat uses.
 
Old 05-28-2004, 11:13 AM   #10
Medievalist
Member
 
Registered: Aug 2003
Distribution: Dead Rat
Posts: 175

Rep: Reputation: 37
Quote:
>>You have to tell the DHCPd what to do with all your interfaces,
>even if the configuration is "do nothing for this interface".

No you don't. If you don't want to use dhcp on an interface you can
not configure it for that interface and ignore the message about
no subnet declaration.
OK, allow me to revise my statement. Unless you don't mind "normal errors" and are willing to ignore warning messages, you have to tell the DHCPd about all your interfaces .

I consider a system that issues warnings or error messages when it is running properly to be broken, myself, but that's clearly a matter of opinion and preference. Still, I stand corrected.


Anyway, about the actual bug:

zaphodiv and RHELL nailed it. You don't have any interfaces in the subnet you've defined the range for.

Your dhcpd.conf has a subnet definition of

subnet 192.168.1.0 netmask 255.255.255.0

Your interfaces are

eth0
IPv4 address:192.168.0.189 /24
IPv6 address: fe80::202:44ff:fe4c:203c /64

eth1
IPv4 address:198.162.1.1 /24
IPv6 address: fe80::200:f4ff:fec9:6e80 /64

So, you don't have any interfaces on the subnet you've told the DHCP daemon to distribute addresses for. Looks like a subtle typographical error to me... I didn't spot it in the ifconfig and that's exactly the bug I was looking for!


About the capabilities of the ISC DHCPd:

It's unlikely that the software is "not adequate" for your uses; as the reference implementation of the protocol it is capable of doing anything that the protocol can do. This is far more than the Windows or Novell dhcp servers can do, and consequently those tools have simpler interfaces and are useable with less planning and research. If you need to do something that the ISC DHCPd can't do, you don't need DHCP, you need something else.

And finally, about the IPv6:

The Internet runs on IPv4 (Internet Protocol Version Four). You are unlikely to be communicating with anyone using any other protocol. IPv5 (streams internet) was a failure for all practical purposes. IPv6 is a new version that includes optional enhanced security and quality of service features as well as a vastly increased address space. In the year 2040, you will probably need IPv6 although some people say you'll never ever need it.

Although IPv6 is, technically, in some senses, "backwards compatible" with IPv4, you cannot communicate with your ISP via IPv6. You are running multiple separate protocol stacks (three, actually, since you've got an encapsulation layer as well as both IPv4 and IPv6 running) and that is wasting resources and providing additional security hazards as well as significantly complicating the configuration of your system. You should get rid of it. Think of it as a can opener attached to your washing machine - every time you use the washer, the can opener is running, even though you don't need to open any cans, and the rotating machinery wastes power and presents a minor hazard to anyone using the washroom.

--Charlie
 
Old 05-28-2004, 11:14 AM   #11
charon79m
Member
 
Registered: Oct 2003
Distribution: Just about anything... so long as it is Debain based.
Posts: 297

Rep: Reputation: 30
Zaphodiv,

You're post is informative but wrong.

192.168.1.1 is absolutely on the network 192.168.1.0 255.255.255.0. That's what the subnet mask tells us. the network part of the IP address is 192.168.1 and the nodes on that address are 1-254 (255 is the broadcast).

An address of 192.168.0.1 255.255.255.0 has a network address of 192.168.0; therefore, it is not on the same subnet as the 192.168.1.1 address.

Regarding not declaring an interface in dhcpd.conf:
If you read the man page (man dhcpd.conf) you will find this:

"For every subnet which will be served, and for every subnet to which
the dhcp server is connected, there must be one subnet declaration,
which tells dhcpd how to recognize that an address is on that subnet.
A subnet declaration is required for each subnet even if no addresses
will be dynamically allocated on that subnet."

It's quite clear that the designers of dhcpd want a mention of each interface. I know on my server if I do not have a info on each interfacd dhcpd bombs.

Cheers,
MrKnisely
 
Old 05-28-2004, 03:30 PM   #12
zaphodiv
Member
 
Registered: Oct 2003
Distribution: Slackware
Posts: 388

Rep: Reputation: 30
>You're post is informative but wrong.

I accidentally typed the right ip address instead of the incorrect one that Hunza
is using.

Let me try that again.

You have told dhcpd to use subnet 192.168.1.0 netmask 255.255.255.0
If eth1 has the address 198.162.1.1 then that is not in the subnet
you have told dhcpd to use.
Use 192.168.1.1 instead


>192.168.1.1 is absolutely on the network
You are correct.

>I know on my server if I do not have a info on each
>interfacd dhcpd bombs.

Works for me. I fail to see why I should tell dhcpd about a subnet that it has
nothing to do with. The abstraction between the hardware interface, ethernet
transport, routing and ip host levels are a fundamental part of networking.
That's a difference of opinion between me and the people who created the software.

>It's quite clear that the designers of dhcpd want a mention of each interface.
I accept that but I see no practical reason for it.
 
Old 05-29-2004, 01:57 PM   #13
RHELL
Member
 
Registered: Feb 2004
Location: Outermost mingetty
Distribution: RHEL3,RH4U4,Sol9, Sol10
Posts: 321

Rep: Reputation: 31
OK boys and girls, eth1 is misconfigured with a public internet address:198.162.1.1 Bcast:198.162.1.255 Mask:255.255.255.0,
which does not exist on the private network 192.168.1.0.

Would be cool to keep the signal to noise ratio down.
 
Old 06-02-2004, 09:52 AM   #14
Medievalist
Member
 
Registered: Aug 2003
Distribution: Dead Rat
Posts: 175

Rep: Reputation: 37
OK.

Hunza, are you fixed now?

--Charlie
 
Old 06-14-2004, 04:38 AM   #15
Hunza
LQ Newbie
 
Registered: May 2004
Location: Aussie lost in Switzerland
Distribution: Debian (Have I seen the lite?)
Posts: 23

Original Poster
Rep: Reputation: 15
I had hoped to be posting a solution to this issue by now, however the saga continues.

We had a Suse guru here from one of Suse's support partners last Monday, spent the whole day here and even he couldnt fix it!!

Basically the prob remains the same. We can see the ISP and get an IP via DHCP. The machines on the LAN are all static IP and can see each other. The issue is the routing between the two NICs in the gateway box. They simply cannot (or will not) route between themselves. We got it sort of working using squid but for web content only, couldnt get email to work through the squid proxy.

Anyway, the Suse man has taken the issue up with Suse and hopefully they will come up with an answer. For the time being I am still using the WINXP box as a gateway, but I will continue to bang away at this myself.

Watch this space for the solution from SUSe (if they can work it out!!)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DHCP: Bad subnet number/mask combination OliXNet Linux - Networking 4 01-07-2010 11:17 AM
ADSL DHCP A-OK, but Mandrake 10.1 to be DHCP for other subnet is a problem turnbui Linux - Networking 2 08-20-2005 10:34 AM
Help Me ! Subnet Selection On Sun 8 Dhcp Server !!!! honganhptit Solaris / OpenSolaris 2 05-26-2004 12:04 AM
dhcp subnet is 255.255.252.0 why does dhclient not find it???? baked Linux - Wireless Networking 0 01-06-2004 09:25 AM
unable to get out of my subnet w/o dhcp wendallsan Linux - Networking 8 10-13-2003 03:52 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration