LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 05-07-2009, 11:27 PM   #1
orbit
Member
 
Registered: Sep 2006
Location: Australia
Distribution: Slackware
Posts: 176

Rep: Reputation: 30
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
 
Old 05-08-2009, 04:13 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,259

Rep: Reputation: Disabled
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
 
Old 05-08-2009, 04:21 AM   #3
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 227Reputation: 227Reputation: 227
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.
 
Old 05-08-2009, 05:28 AM   #4
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 227Reputation: 227Reputation: 227
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 !
 
Old 05-09-2009, 02:45 PM   #5
janhe
Member
 
Registered: Jul 2007
Location: Belgium
Distribution: slackware64 13.1, slackware 13.1
Posts: 369

Rep: Reputation: 45
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.
 
Old 05-10-2009, 06:34 PM   #6
orbit
Member
 
Registered: Sep 2006
Location: Australia
Distribution: Slackware
Posts: 176

Original Poster
Rep: Reputation: 30
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

Last edited by orbit; 05-10-2009 at 06:43 PM.
 
Old 05-11-2009, 02:00 AM   #7
janhe
Member
 
Registered: Jul 2007
Location: Belgium
Distribution: slackware64 13.1, slackware 13.1
Posts: 369

Rep: Reputation: 45
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.
 
  


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
All in one Proxy Server, DHCP server & Router binary1011100 Linux - Networking 1 05-08-2006 11:18 AM
Static IP Address with DHCP server control taylortbb Linux - Networking 1 06-28-2005 01:43 PM
local web server behind dhcp router j4b Linux - Networking 10 08-09-2004 10:21 PM
Home network using linksys router -- DHCP server? GoinEasy9 Linux - General 12 04-01-2004 11:32 PM
dhcp server in linksys router maxvenum Linux - Networking 3 09-02-2003 07:56 AM


All times are GMT -5. The time now is 05:49 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