LinuxQuestions.org
Visit Jeremy's Blog.
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 09-02-2006, 02:07 AM   #1
nko
LQ Newbie
 
Registered: Apr 2005
Posts: 20

Rep: Reputation: 1
Setting Up My First DHCP Server


I'm setting up my home network to teach myself a few things and round out my experience base. I'm fairly green when it comes to networking and I'm itching to learn.

I have a wireless AP / router connected to my DSL Internet connection. Two machines are connected via wireless and two other machines have wired connections. The router provides DHCP functionality.

I've decided that I'd like to offload DHCP serving to one of the wired machines. I'd also like to make this machine the default gateway. This way, I'll be set to start using this machine for a number of other central functions (DNS, filtering, proxy, firewall, etc).

I'm unsure of how to pull this off. If I turn off DHCP on the router and turn it on in the wired box, will everything still hum along like nothing happened, even after the other machines start requesting leases from the new server?

I'm taking a stab in the dark here, but it seems to me like the router is going to appear to be just one of the many machines on my network (which is now a *mesh* network, whereas before it was a *star* network, right?). However, given its physical connection to the internet, the DHCP server is going to have to treat it as a gateway, right? The *default* gateway. I think. And at that point, how do I make sure that wireless router is properly referenced by the DHCP server, seeing as the router will be requesting an IP address from the DHCP server? It seems to be a circular dependancy... unless I can refer to the router by MAC address or something?

As you may be able to tell, I've been studying, and now I'm trying to apply my textbook understanding to a real world situation. I think I've got 95% of it... there are just some big question marks hovering over my head. I'd appreciate ANY help in ironing out my understanding of these things!
 
Old 09-02-2006, 03:38 AM   #2
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
You'll be fine turning off DHCP on your router.
 
Old 09-02-2006, 10:37 AM   #3
ARC1450
Member
 
Registered: Jun 2005
Location: Odenton, MD
Distribution: Gentoo
Posts: 290

Rep: Reputation: 30
You will always have a physical star, logical bus in your home network. You're connecting to one single device, and you have a single point of failure (your router) to blow apart your network. It's a physical star because everything connects off of it, but a logical bus (I think. I could be well wrong on that one).

And the best idea is to always make a router a static IP. You CAN set it to DHCP, and in the DHCP server specify your router as a FQDN instead, but the issue is that if your DNS resolution goes *boom*, you're screwed.

And you're thinking waaaaaay too complicated about it (understandably). Best practice is to make routers/servers static IPs on your network. That way you know where they are in the scheme of addresses at all times, and if DNS resolution goes *boom*, as I said, you won't have to pull your hair out fixing it.

And yes, when you turn off the DHCP server on your router, your DHCP serving box with seemlessly take over and continue on with the same leases.
 
Old 09-02-2006, 10:45 AM   #4
drhart4000
Member
 
Registered: Aug 2006
Distribution: Centos, Fedora, Ubuntu, Slackware
Posts: 51

Rep: Reputation: 15
Corect me if im wrong but in order to setup a linux fire wall you need to hook it up this way
Modem --> Linux FW --> Router -->to computers

your linux box must havea direct connection then the router following...
you need 2 nic cards.

if there is another setup tell me but im 99% sure this is the only way to go.

NOTSURE: but i think its the same with seting up a proxy? YES - or - NO ?

again your linux box will take over the DHCP job easly... but,,, I sugest STATIC OVER DHCP TOO!

Last edited by drhart4000; 09-02-2006 at 10:51 AM.
 
Old 09-02-2006, 11:47 AM   #5
ARC1450
Member
 
Registered: Jun 2005
Location: Odenton, MD
Distribution: Gentoo
Posts: 290

Rep: Reputation: 30
Quote:
Originally Posted by drhart4000
Corect me if im wrong but in order to setup a linux fire wall you need to hook it up this way
Modem --> Linux FW --> Router -->to computers

your linux box must havea direct connection then the router following...
you need 2 nic cards.

if there is another setup tell me but im 99% sure this is the only way to go.

NOTSURE: but i think its the same with seting up a proxy? YES - or - NO ?

again your linux box will take over the DHCP job easly... but,,, I sugest STATIC OVER DHCP TOO!
Well, technically you can have the packets route however you want to, so you could have a firewall in Abu Dhabi. Same with a proxy. You can put then anywhere, you just have to route things to/from them, and that's just idiotic.

Note, though, that you have to have a VPN to the firewall out in Abu Dhabi, and deny every other connection from everywhere else, but you can do that if that's your thing.

And DHCP is easy. Just, again, don't use it on your servers or gateway. I feel I should just emphasize that point.
 
Old 09-02-2006, 02:26 PM   #6
drhart4000
Member
 
Registered: Aug 2006
Distribution: Centos, Fedora, Ubuntu, Slackware
Posts: 51

Rep: Reputation: 15
i stand corrected...

Quote:
Originally Posted by ARC1450

Quote:
Originally Posted by drhart4000
Corect me if im wrong but in order to setup a linux fire wall you need to hook it up this way
Modem --> Linux FW --> Router -->to computers

your linux box must havea direct connection then the router following...
you need 2 nic cards.

if there is another setup tell me but im 99% sure this is the only way to go.

NOTSURE: but i think its the same with seting up a proxy? YES - or - NO ?

again your linux box will take over the DHCP job easly... but,,, I sugest STATIC OVER DHCP TOO!

Well, technically you can have the packets route however you want to, so you could have a firewall in Abu Dhabi. Same with a proxy. You can put then anywhere, you just have to route things to/from them, and that's just idiotic.

Note, though, that you have to have a VPN to the firewall out in Abu Dhabi, and deny every other connection from everywhere else, but you can do that if that's your thing.

And DHCP is easy. Just, again, don't use it on your servers or gateway. I feel I should just emphasize that point.
Ya, that makes since still i don't see why someone would whant to do that.

Last edited by drhart4000; 09-02-2006 at 02:27 PM.
 
Old 09-02-2006, 03:12 PM   #7
nko
LQ Newbie
 
Registered: Apr 2005
Posts: 20

Original Poster
Rep: Reputation: 1
In my case, my only real goal is to learn.

That said, in terms of practicality, I'd like to use the router to route traffic and the server to provide all services. The router has the advantage of having a good number of ethernet ports AND that it's a wireless AP.

Its weakness is in the flexability of its software. I can't dink with any little bit that I want to.

So the idea is to make the server handle all of these things. Yes, this makes for some zig-zagging across my network (workstation -> router -> server -> router -> internet -> router -> server -> router -> workstation). But given the speed of my LAN versus the speed of my DSL connection, the functionality is way more important than the efficiency.

Quote:
You will always have a physical star, logical bus in your home network.
This makes much more sense. Thanks!! That simplifies this for me mentally.

Quote:
And the best idea is to always make a router a static IP. You CAN set it to DHCP, and in the DHCP server specify your router as a FQDN instead, but the issue is that if your DNS resolution goes *boom*, you're screwed.
Ten times simple to make the router static. I can see the logic there. The router is going to have to be the default gateway for the DHCP server, correct? Am I correct in assuming there are similar reasons why I'd want to make the DHCP server static, too?

Quote:
And you're thinking waaaaaay too complicated about it (understandably).
That's a combination of my position and my goal. My goal is to understand these concepts thoroughly, so I'm aiming high. My position is one where I know practically nothing, so subnets and topologies are overly complicated for me, let alone making them work!!!

Quote:
And yes, when you turn off the DHCP server on your router, your DHCP serving box with seemlessly take over and continue on with the same leases.
Excellent. So the order of operations is:

- configure the new DHCP server to refer to itself by a static IP
- configure the router with its own static IP and give the new DHCP server the same information, both for refering to the gateway by static IP AND after that refering to it as the default gateway (I'll have to dig deeper to see how to configure this...)
- make sure the new DHCP server starts successfully
- turn off the router's DHCP functionality
- start disconnecting / reconnecting machines to watch their assumed leases carry over to the new DHCP server.

Will I need to manually set each workstation's default gateway to the new DHCP server, or will they automagically configure this based on what the DHCP server tells them?

Thanks so much for the insights!! This is excellent!! I'm really feeling like I get it now!
 
Old 09-02-2006, 03:21 PM   #8
ARC1450
Member
 
Registered: Jun 2005
Location: Odenton, MD
Distribution: Gentoo
Posts: 290

Rep: Reputation: 30
Quote:
Originally Posted by nko
Excellent. So the order of operations is:

- configure the new DHCP server to refer to itself by a static IP
- configure the router with its own static IP and give the new DHCP server the same information, both for refering to the gateway by static IP AND after that refering to it as the default gateway (I'll have to dig deeper to see how to configure this...)
- make sure the new DHCP server starts successfully
- turn off the router's DHCP functionality
- start disconnecting / reconnecting machines to watch their assumed leases carry over to the new DHCP server.

Will I need to manually set each workstation's default gateway to the new DHCP server, or will they automagically configure this based on what the DHCP server tells them?

Thanks so much for the insights!! This is excellent!! I'm really feeling like I get it now!
Well, you don't need to configure anything on the DHCP server than telling it what leases to give out, the DNS server IP, and the IP of the default gateway (your router).

By the by, check the RFC for more info on how DHCP works. Quick runthough: everything is automagic with it. That's why it's Dynamic Host Configuration Protocol. You supply the DHCP server with info, the DHCP server passes it onto the client.

Also, you don't need to disconnect/reconnect the machines. They'll try to contact their old DHCP server first; when it's not there, they'll broadcast out and ask for a new DHCP server. When they find it, they'll relay the needed information back to the DHCP server, then everything will be good to go after that.

And as I said: EVERY server should be a static IP. DNS server, DHCP server, Samba server, Domain Controller. If its purpose is to serve something, make it static.

And don't make this stuff complicated. You're working with logic (binary), so keep it in the realm of logic. Subnets are easy, networks are easy. Topologies are boring, but easy. Just don't concentrate about it. Ask questions if you don't understand, or THINK you don't understand. Assuming you get it is the worst thing you can do, because most of this stuff builds on top of something else.

Last edited by ARC1450; 09-02-2006 at 03:26 PM.
 
Old 09-02-2006, 04:22 PM   #9
drhart4000
Member
 
Registered: Aug 2006
Distribution: Centos, Fedora, Ubuntu, Slackware
Posts: 51

Rep: Reputation: 15
What i recommend is trying to do it and see what happens. then if you have a problem ask questions, or try and figure it out on your own.

you want to know if something will work? Try it find out yourself. thats how you be come a stronger more pronounced linux user am i right? And its definitely not unusual to run into a snag that you cant figure out thats why everyones here to help everyone else. Don't think to much in advanced. Life's all about tryals, failures, and corrections. thats just what it is in the computer world. "There will always be problems".
Quote:
Assuming you get it is the worst thing you can do, because most of this stuff builds on top of something else.
Right! Start some ware ask questions when needed.

Ok, back on subject:
Yes, In theary the dhcp server will picup on all the infromaintion needed to do "IT'S JOB". "You tell the dhcp server what to give out and it will give it out".

Last edited by drhart4000; 09-02-2006 at 04:25 PM.
 
  


Reply

Tags
dhcp, networking, routing


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
Setting up a DHCP server MasterCephus Linux - Newbie 9 06-26-2005 07:41 AM
Setting up a DHCP server blazted Linux - Newbie 6 01-28-2005 03:10 AM
Setting up a DHCP server w/ the server on a wireless network Ionexchange Linux - Wireless Networking 0 05-08-2004 10:56 AM
Setting up a DHCP server. jgaraas Linux - Networking 10 06-17-2003 08:23 AM
Setting up a DHCP Server bselzler Linux - Networking 2 08-07-2001 04:28 AM


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