LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-10-2012, 08:01 AM   #1
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,079

Rep: Reputation: 790Reputation: 790Reputation: 790Reputation: 790Reputation: 790Reputation: 790Reputation: 790
DHCP vs. Fixed IP


For the past, oh, 25-30 years or so I've been using fixed IP addressing for all my Ethernet equipment; servers, printers, plotters, etc. No wi-fi, everything has a CAT-5 or CAT-6 cable. Everything has a name, everything is added to /etc/hosts on every server, everybody can find everybody else with no problem. I run everything internally as 192.168.x.x with a router that has an assigned fixed IP address facing the outside world.

I've also done the "hosts" trick with sites that are frequently visited, where the site name and address are in /etc/hosts which avoids doing a look up at a DNS server (real quick, that). Not many, just a few.

The only thing I ever use DHCP for is a laptop that might get lugged somewhere with internet services (library, hotel, those kinds of places) but that doesn't happen too often (maybe once every six months).

So, I'm wondering -- other than lugging a laptop around to public access points, what if any advantage is there to DHCP? If somebody brings a Windows laptop around, I'll plug it in to my router and that works just fine but outside of that I really can't see what advantage there might be; am I missing something?
 
Old 11-10-2012, 08:12 AM   #2
zk1234
Member
 
Registered: Oct 2010
Location: Poland
Distribution: 4MLinux, Slackware, Slitaz, Mint
Posts: 117

Rep: Reputation: 7
Yes, you've missed the fact that 99% percent of users have never configured their network manually (IP, gateway and so in)., so for them DHCP is more "user-friendly" :-)
 
Old 11-10-2012, 09:39 AM   #3
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: Slackware, Slackware64
Posts: 1,730

Rep: Reputation: 830Reputation: 830Reputation: 830Reputation: 830Reputation: 830Reputation: 830Reputation: 830
Quote:
Originally Posted by tronayne View Post
So, I'm wondering -- other than lugging a laptop around to public access points, what if any advantage is there to DHCP? If somebody brings a Windows laptop around, I'll plug it in to my router and that works just fine but outside of that I really can't see what advantage there might be; am I missing something?
As an example, here's my office's DHCP server configuration:

Code:
# /etc/dhcpd.conf
authoritative;
default-lease-time 86400;
max-lease-time 86400;
option broadcast-address 192.168.2.255;
option subnet-mask 255.255.255.0;
option routers 192.168.2.254;
option domain-name-servers 192.168.2.1;
option domain-name "microlinux.montpezat";

subnet 192.168.2.0 netmask 255.255.255.0 {
	range 192.168.2.100 192.168.2.200;
}

host alphamule {
	hardware ethernet 00:1D:92:B2:F3:9E;
	fixed-address 192.168.2.2;
	option host-name "alphamule";
}

host bernadette {
	hardware ethernet 00:0d:61:a6:e7:1e;
	fixed-address 192.168.2.3;
	option host-name "bernadette";
}

host raymonde {
	hardware ethernet 00:20:ed:b8:e8:ec;
	fixed-address 192.168.2.4;
	option host-name "raymonde";
}

host betadine {
  hardware ethernet 00:19:DB:44:C5:94;
  fixed-address 192.168.2.5;
  option host-name "betadine";
}

host buzz-wired {
  hardware ethernet 00:0B:97:96:3C:E1;
  fixed-address 192.168.2.6;
  option host-name "buzz";
}

host buzz-wireless {
  hardware ethernet 00:13:CE:EE:20:3A;
  fixed-address 192.168.2.6;
  option host-name "buzz";
}

host bebette-wired {
  hardware ethernet 00:27:19:F1:BC:3A;
  fixed-address 192.168.2.7;
  option host-name "bebette";
}

host bebette-wireless {
  hardware ethernet 00:19:E0:83:3A:C1;
  fixed-address 192.168.2.7;
  option host-name "bebette";
}

host jukebox {
  hardware ethernet 00:30:1B:AF:43:D3;
  fixed-address 192.168.2.8;
  option host-name "jukebox";
}
And here's part of our school's configuration for DHCP:

Code:
# /etc/dhcpd.conf
authoritative;
default-lease-time 86400;
max-lease-time 86400;
option broadcast-address 192.168.2.255;
option subnet-mask 255.255.255.0;
option routers 192.168.2.1;
option domain-name-servers 192.168.2.1;
option domain-name "scholae.sainthippo";

subnet 192.168.2.0 netmask 255.255.255.0 {
	range 192.168.2.10 192.168.2.90;
}

host poste1 {
	hardware ethernet 00:30:05:55:ba:23;
	fixed-address 192.168.2.101;
	option host-name "poste1";
}

host poste2 {
	hardware ethernet 00:30:05:55:db:06;
	fixed-address 192.168.2.102;
	option host-name "poste2";
}

host poste3 {
	hardware ethernet 00:30:05:55:dc:47;
	fixed-address 192.168.2.103;
	option host-name "poste3";
}

host poste4 {
	hardware ethernet 00:30:05:45:a7:08;
	fixed-address 192.168.2.104;
	option host-name "poste4";
}

host poste5 {
	hardware ethernet 00:30:05:53:45:6c; 
	fixed-address 192.168.2.105;
	option host-name "poste5";
}

host poste6 {
	hardware ethernet 00:30:05:55:dc:37;
	fixed-address 192.168.2.106;
	option host-name "poste6";
}

host poste7 {
	hardware ethernet 00:30:05:56:27:a7;
	fixed-address 192.168.2.107;
	option host-name "poste7";
}

host poste8 {
	hardware ethernet 00:30:05:4b:82:fd;
	fixed-address 192.168.2.108;
	option host-name "poste8";
}

host poste9 {
	hardware ethernet 00:30:05:53:53:ba;
	fixed-address 192.168.2.109;
	option host-name "poste9";
}

host poste10 {
	hardware ethernet 00:30:05:4b:81:d0;
	fixed-address 192.168.2.110;
	option host-name "poste10";
}

host bigbrother {
	hardware ethernet 00:16:41:37:4a:c8;
	fixed-address 192.168.2.200;
	option host-name "bigbrother";
}

host littlesister {
	hardware ethernet 00:16:41:37:7f:d7;
	fixed-address 192.168.2.201;
	option host-name "littlesister";
}

host oldbox {
	hardware ethernet 00:0d:61:ae:6b:8f;
	fixed-address 192.168.2.250;
	option host-name "oldbox";
}

host surfingscholae {
	hardware ethernet 30:46:9a:01:99:2e;
	fixed-address 192.168.2.253;
	option host-name "surfingscholae";
}

host babar {
	hardware ethernet 00:0c:76:25:eb:39;
	fixed-address 192.168.2.254;
	option host-name "babar";
}
In both cases, everything is managed centrally: IP addresses as well as hostnames. So if one of the fifty-something students connects his or her laptop, I can be sure there's no conflicting IP address. And if some piece of hardware needs to be changed (which happens, I just changed "raymonde" and "bernadette" here in my office), all I have to change in the setup are the according MAC addresses in dhcpd.conf, and everything else stays pretty much the same. With the according DNS configuration (Bind as primary master), hosts can be resolved with their names.

Configuring everything statically on each host with an entry for every other machine in /etc/hosts is not only a nightmare in terms of sheer work, but you're also much more prone to conflicting addresses. Besides, nobody else can "just connect" to your network.

Cheers,

Niki
 
Old 11-10-2012, 10:09 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,551
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
For small, slowly changing networks fixed IPs and hosts files are simpler and more robust than having (to rely on) a DHCP server.

For large and/or rapidly changing networks it is simpler to have a DHCP server (or, better, a failover pair of DHCP servers) and dynamic DNS; the complexity is outweighed by the advantages of having a single configuration file.
 
Old 11-10-2012, 12:52 PM   #5
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,971

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
Nowadays DHCP is state of the art. Normally if you have a router in your home-network (or office) it provides also DHCP, why not use it? I've only configured my Server with a fixed IP-adress.

Markus
 
Old 11-10-2012, 01:33 PM   #6
ReaperX7
Senior Member
 
Registered: Jul 2011
Distribution: LFS-SVN, FreeBSD 10.0
Posts: 3,405
Blog Entries: 15

Rep: Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951
Static Addressing is useful if you need to track certain machines in a large environment such as a school or business and manage the endpoint machines, but in smaller networks DHCP works fine. Static mostly is now a fall-back/fail-safe in case DHCP doesn't work correctly.
 
Old 11-12-2012, 07:27 PM   #7
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 276

Rep: Reputation: 65
Network Control

Quote:
Originally Posted by ReaperX7 View Post
Static Addressing is useful if you need to track certain machines ...
Static, documented IP addresses can enable more flexibility/control in setting up firewall rules, fancier routing schemes, and traffic logging. (along with MAC if appropriate) Not something most people would probably be concerned with at home however.
 
Old 11-12-2012, 08:24 PM   #8
XGizzmo
Member
 
Registered: Mar 2007
Distribution: Slackware
Posts: 264

Rep: Reputation: 68
DHCP is for automatic network configuration, the static vs. dynamic ip address debate is pointless since dhcpd can assign both static and dynamic ip addresses.
 
Old 11-12-2012, 08:38 PM   #9
ReaperX7
Senior Member
 
Registered: Jul 2011
Distribution: LFS-SVN, FreeBSD 10.0
Posts: 3,405
Blog Entries: 15

Rep: Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951
DHCP basically saves you the admin and user the excruciating headache of knowing which IP address scheme is used, if the IP address is available, which subnet address is valid, the gateway address, etc. etc. etc...

In short... DHCP is, to an extent, idiot-proof network addressing.
 
Old 11-12-2012, 09:12 PM   #10
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,501

Rep: Reputation: 623Reputation: 623Reputation: 623Reputation: 623Reputation: 623Reputation: 623
I used to use manually set up static assignments, but got really tired of having to configure the network every time I wanted to hook a new device up to the network, do a trial OS install on some machine's spare partition, boot from a USB drive to do disk imaging or a standalone backup, etc. Now I have a DHCP server configured with fixed assignments for known MAC addresses and with dynamic assignment from a different part of the address space for unknown new devices. Makes life a whole lot easier.
 
Old 11-13-2012, 08:24 PM   #11
frankbell
Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Mageia, Mint
Posts: 7,919

Rep: Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494
I use static IP addresses for my file server and my printer, so it's easy for me to connect to them from other computers.

Everything else is DHCP.
 
Old 11-13-2012, 09:43 PM   #12
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,519

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Since I run my own local DNS service on a Slackware box in my local network, I have my DHCP server tell my DNS server what new machines have shown up in my network.

Everybody has a name and everybody uses the name. It makes life easier.
 
  


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
[SOLVED] dhcp fixed address not working [GOD]Anck Slackware 6 06-07-2010 05:25 AM
Wlan0 is DHCP, eth1 fixed IP SteveT Linux - Networking 0 05-14-2006 02:36 PM
DHCP with fixed IPs alithenake Slackware 4 03-18-2005 09:02 AM
Fixed IP Address with DHCP dgreenbean Linux - Networking 9 09-19-2004 01:12 PM
Changing dhcp ip -> fixed ip Lakani Linux - Networking 0 05-05-2004 05:32 AM


All times are GMT -5. The time now is 11:16 AM.

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