LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Instead of Router DHCP Server, Pass DHCP Server control to Slackware (https://www.linuxquestions.org/questions/slackware-14/instead-of-router-dhcp-server-pass-dhcp-server-control-to-slackware-724569/)

orbit 05-07-2009 11:27 PM

Instead of Router DHCP Server, Pass DHCP Server control to Slackware
 
Hi all,

My current simple network setup involves a single Router (Billion 5102s) acting as a DHCP Server, passing I.P. addresses via ethernet switches to all the LAN client PC's. (BTW, every PC in the LAN is running Slackware 12.0 - 12.2).

When my Server P.C (which is always on) is Router assigned an I.P address of 192.168.1.100, everything works correctly with my Router configured Network Address Translations (NAT). I am able to ssh, remote control login (krdc), FTP serve, Internet game serve ... etc.. so all happy.

However if there is ever a power fluctuation, and there are any other PC's connected to the Network, for some reason when the systems repower, the Router assigns 192.168.1.100 to one of the other systems and the Server gets assigned some other new I.P. address (which is very frustrating as then, none of my NAT settings will work and I am unable to remotely administer my Server PC.

So I would like to take DHCP control away from the Router, and give it exclusively to the Slackware Server PC.

[My theory being, that the Server will always DHCP configure itself with the NAT happy I.P. 192.168.1.100, and then the Server PC can assign DHCP I.P. address dynamically to all the other PC's on the Network as they are connected (what I.P. addresses the other P.C's get is irrelevant) ]

Also, as my Network PC's fluctuate I want to remain using DHCP and not go to Static I.P. addressing.

So can Slackware do this (DHCP Server)?

----

I have been reading my router manual (DHCP Server section), and it says that it can 'Relay' DHCP control to an I.P. address, so this looks promising ....

----

After more reading on this forum, I have discovered that I can (apparently) make my Server PC have a specific I.P. address by editing /etc/rc.d/rc.inet1.conf, and in eth0 section add:

Code:

# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]="SERVER"
DHCP_IPADDRESS[0]="192.168.1.100"

So this sounds even more promising, that should mean that I can give the Router a 'Relay' DHCP setting and have it look for 192.168.1.100 (ServerPC) for DHCP. (havn't tried it yet).

How then would I turn my Server PC from a DHCP client (getting it's IP from Router), into a DHCP Server (assigning out all IP's to itself and everything else)?

Are there further configurations required in /etc/rc.d/rc.inet1.conf?, or is Slackware DHCP server settings controlled from somewhere else in the filesystem?

Thanks very much for any assistance or tips with this configuration.

I'll look forward to hearing from you.

Cheers

Alien Bob 05-08-2009 04:13 AM

You can entirely switch off the DHCP server functionality on your router and then enable the DHCP server of your Slackware box. There is no need for a DHCP relay unless your LAN has multiple network segments separated by other routers (highly unlikely in a domestic setup).
Alternatively you can also just assign a static IP address to your server and let the router continue serving IP addresses only to your desktops and laptops.

If you want to know more about configurign a DHCP server on Slackware, I have a section about justt hat as part of my article on how to setup a PXE (network boot) server. See http://alien.slackbook.org/dokuwiki/...kware:pxe#dhcp

Eric

mRgOBLIN 05-08-2009 04:21 AM

You'll need to set a static ip address for the server and then create yourself a config file /etc/dhcpd.conf .

I'd suggest setting the router up with a staic IP address also.

Of course you can assign a static IP address to machines with dhpcd by using the hardware mac address.

bgeddy 05-08-2009 05:28 AM

In addition to the previous replies - if you wish to setup a Slackware DHCP server have a look at dnsmasq. It's easy to setup and works well.

It's probably easiest to static IP the server and DHCP the others. Another facility that your router may have is to assign IP's by Mac address. You can reserve IP's for particular machines in a table on the router to be DHCP'd. Anyway - lots of solutions for you to play with !

janhe 05-09-2009 02:45 PM

I don't know if there is any other reason to move the DHCP service to your server.
If all you want is giving the server a constant IP, then I'd simply configure the server with a static IP instead of using DHCP.

Unless I'm wrong you cannot have the server giving itself an IP address throug DHCP, you always have to configure it with a static IP address.

You can configure a static IP address using "netconfig" in console. If you don't want that you can edit the config files yourself. A hint about what to edit can be found in the slackbook: http://www.slackbook.org/html/networ...ion-tcpip.html
Just set USE_DHCP to no and fill in the right information in the other places.

orbit 05-10-2009 06:34 PM

Hello Everyone, and thank you for all of your replies.

I have tried both methods suggested ...

When I turned off Router DHCP and configured Slackware ServerPC as a DHCP server (thank you Alien Bob for Wiki), I noticed that pages seemed to take longer to load on the workstations?
(I may have had to tweak configs further to resolve that).

I then reverted to Router DHCP, and (netconfig) set up the Slackware Server PC with a Static I.P., and everything works at normal speed again.

So far over the weekend, the Server PC has constantly maintained the correct 192.*.100 I.P address in the Router DHCP table, and there has been no I.P. stealing by the other workstations, so it appears that everything is working correctly.

I'll leave it with this current Server PC static I.P. setup as everything appears to be happy.

Thank you all for your assistance in this topic, it has been an interesting exercise.

Regards

janhe 05-11-2009 02:00 AM

Just to be safe I'd let the DHCP IP address pool on the router start at 192.168.1.101 . Your server doesn't need DHCP anymore, and if the router accidently hands out the IP to someone, things will get really strange.


All times are GMT -5. The time now is 07:46 AM.