LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Setting Up My First DHCP Server (http://www.linuxquestions.org/questions/linux-networking-3/setting-up-my-first-dhcp-server-479671/)

nko 09-02-2006 02:07 AM

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!

Micro420 09-02-2006 03:38 AM

You'll be fine turning off DHCP on your router.

ARC1450 09-02-2006 10:37 AM

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.

drhart4000 09-02-2006 10:45 AM

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!

ARC1450 09-02-2006 11:47 AM

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.

drhart4000 09-02-2006 02:26 PM

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.

nko 09-02-2006 03:12 PM

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!

ARC1450 09-02-2006 03:21 PM

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.

drhart4000 09-02-2006 04:22 PM

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".


All times are GMT -5. The time now is 12:58 PM.