LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 11-06-2009, 04:00 AM   #1
dvdljns
Member
 
Registered: Sep 2003
Posts: 210

Rep: Reputation: 30
help understanding dhcp


I think I am in the right place.

http://www.yolinux.com/TUTORIALS/DHCP-Server.html

Ok! I need to get eth1 to send requests to my dhcp3-sever instead of wlan2. The first howto I found did ip routing from eth1 to wlan2 bypassing my dhcp server but that does not work. the tutoial above has this.

Lease Request: Client broadcasts request to DHCP server with a source address of 0.0.0.0 and a destination address of 255.255.255.255. The request includes the MAC address which is used to direct the reply.

but do I assign 0.0.0.0 to eth1 or do I assign a gateway ip to eth1. When I send reguests to get leases I state a gateway. That should be eth1 right?
Does any one understand this.
 
Old 11-06-2009, 04:23 AM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello dvdljns,

I'm not sure if I really understood your question...

DHCP works only within a subnet, therefore there is no gateway needed for the DHCP-protocol to work properly. The IP-adresses in the request are only to identify that there is a client broadcasting for a lease (broadcasts are blocked by the router, so they reach every computer within a subnet but only within that subnet).

Within the subnet all network-traffic goes via ethernet (which doesn't need a gateway).

The configuration for DHCP takes place on the client and for each nic. So you'll have to tell wlan0 to use DHCP and eth0 to use DHCP. Both interfaces are independend as if they were different computers.

How to configure this depends on your distro, so we'll need more information.

Markus

Last edited by markush; 11-06-2009 at 04:24 AM.
 
Old 11-06-2009, 05:48 AM   #3
dvdljns
Member
 
Registered: Sep 2003
Posts: 210

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by markush View Post
Hello dvdljns,

I'm not sure if I really understood your question...

DHCP works only within a subnet, therefore there is no gateway needed for the DHCP-protocol to work properly. The IP-adresses in the request are only to identify that there is a client broadcasting for a lease (broadcasts are blocked by the router, so they reach every computer within a subnet but only within that subnet).

Within the subnet all network-traffic goes via ethernet (which doesn't need a gateway).

The configuration for DHCP takes place on the client and for each nic. So you'll have to tell wlan0 to use DHCP and eth0 to use DHCP. Both interfaces are independend as if they were different computers.

How to configure this depends on your distro, so we'll need more information.

Markus
I am using hardy but that should not matter for my question. the command may be a little diferant but what happens is the same thing. What is happening now is all requests for leases is going from eth1 to wlan2 I need to stop that.

Heres the way I understad it. The client sets itself to 0.0.0.0 sends a request on 255.255.255.255 on port 68 to port 67 then listens to port 68 for an answer. my dhcp server should listen to port 67 then send a lease to port 68. My cleint software is doing the samething but It is sending all requests to 192.168.1.1 Since I connect to roadrunner through this gateway why don't I need something like it on my side. Both wlan2 and eth1 has dhcp turned on but when I do a discovery with my router it claims I am using static ip. How do I stop this.
 
Old 11-06-2009, 07:51 AM   #4
dvdljns
Member
 
Registered: Sep 2003
Posts: 210

Original Poster
Rep: Reputation: 30
Ok! lets work on it one conection at a time. How do I get my dhcp server to assign an ip address to my router.
 
Old 11-06-2009, 10:27 AM   #5
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello,

Quote:
Originally Posted by dvdljns View Post
Ok! lets work on it one conection at a time. How do I get my dhcp server to assign an ip address to my router.
Never!

A router has a static IP-adress. It makes no sense to assign an IP-adress to a router via DHCP and it is not possible to do this.

Markus

Last edited by markush; 11-06-2009 at 05:08 PM.
 
Old 11-06-2009, 10:59 AM   #6
dvdljns
Member
 
Registered: Sep 2003
Posts: 210

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by markush View Post
Hello,



Never!

A router has a static IP-adress. It makes no sense to assign an IP-adress to a router and it is not possible to do this.

Markus
That does not make any sense one of the things you have to have to use a router is a dhcp server. all the wan port does is request an ip address.
Your wan port is a dhcp cleint. the static ip is for connecting with your lan. that way you can connect two seperate networks together. the router does the network translation. a.k.a nat.

Are you telling me my isp does not have a dhcp server.
 
Old 11-06-2009, 11:07 AM   #7
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Well, your router is a dhcp-client seen from the isp. That is correct. But your router (which is your gateway to the internet) must have a static IP-configuration on the side of your own subnet. It is very common to use the same machine as a router as well as a dhcp-server. But this server has a static IP, lets say 192.168.1.1/24. This nic is connected to your subnet (192.168.1.0/24). The other nic of the server is connected to your isp and may be a dhcp-client for the isp.
If you want to configure this server as a dhcp-server you can assign IP-configurations to the clients within your 192.168.1.0/24 subnet.
But what you wrote would mean that your dhcp-server assignes a dhcp-configuration to himself, and this indeed makes no sense.

Markus

Last edited by markush; 11-06-2009 at 11:08 AM.
 
Old 11-06-2009, 12:47 PM   #8
dvdljns
Member
 
Registered: Sep 2003
Posts: 210

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by markush View Post
Well, your router is a dhcp-client seen from the isp. That is correct. But your router (which is your gateway to the internet) must have a static IP-configuration on the side of your own subnet. It is very common to use the same machine as a router as well as a dhcp-server. But this server has a static IP, lets say 192.168.1.1/24. This nic is connected to your subnet (192.168.1.0/24). The other nic of the server is connected to your isp and may be a dhcp-client for the isp.
If you want to configure this server as a dhcp-server you can assign IP-configurations to the clients within your 192.168.1.0/24 subnet.
But what you wrote would mean that your dhcp-server assignes a dhcp-configuration to himself, and this indeed makes no sense.

Markus
No you did not understand what I was asking. My router does not know one dhcp server from another. I am trying to get my dhcp server working. If it will not assign an ip to the router it will not assign it to anything.
I am trying to replace a old nt4 server with a linux machine. The nt4 is a frontend. It is the first server to the outside world. The router was a firewall and nat between my nt4 and lan. The nt4 handled dhcp+dns for outgoing and incoming traffic. The router handled the traffic that requested lan access. My dhcp server is not working. It should give my wan port on the router a ip address like the nt server did. I can connect to the router with my lan and my wan2 is getting a a ip from my isp but what I beleive is happening is my router is seeing wan2. i.e requesting a lease from wan2. When I check ifconfig it shows a ip being assigned to wlan2 from my isp but not one being assigned to eth1. I am thinking maybe my dhcp server should assign a ip to eth1 and then I should put that in my router as a gateway. Maybe not but in order for eth1 to work shouldn't it have a ip assigned to it from my dhcp. I know that to reach a dhcp server on the web I have to type an ip address of the comp it is located on. regardless of how the routing of the dhcp request is handled by the computor the ip is still the address of the computor. I think I have a routing problem inside the comp. But do not know how to trouble shoot it.
 
Old 11-06-2009, 01:27 PM   #9
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello,

it would be nice if you could post a drawing of you setup.

I indeed did not understand your question. Are both, the router and the dns/dhcp-server in the same subnet or do you have a DMZ?

Markus
 
Old 11-06-2009, 04:10 PM   #10
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Man for dhclient.

The DHCP client normally transmits any protocol messages it sends before acquiring an IP address
to, 255.255.255.255, the IP limited broadcast address. For debugging purposes, it may be useful
to have the server transmit these messages to some other address. This can be specified with the
-s flag, followed by the IP address or domain name of the destination.
 
Old 11-06-2009, 04:19 PM   #11
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Or you can REDIRECT any dhcp requests from ethX to wlanX with Iptables redirect rule.
 
Old 11-06-2009, 04:54 PM   #12
dvdljns
Member
 
Registered: Sep 2003
Posts: 210

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by markush View Post
Hello,

it would be nice if you could post a drawing of you setup.

I indeed did not understand your question. Are both, the router and the dns/dhcp-server in the same subnet or do you have a DMZ?

Markus

I want it to be but will do it any way it works. heres how it was before.
looking from the outside comming in. roadrunner always assigns a address starting at 24.xx.xx.xx to the broadband router they suplied, then there router gave me a address 192.168.1.100 the nt4 comp conected to that using dhcp. I keep calling this a nt4 machine which is really a backoffice server. It handled everything. including correcting me when I made a mistake. Then it went to my router which routed over to my lan which I used. On my side I broke the backoffice servers off into diferrent comps still controlled by the management srver that came with backoffice. this router hides the network from the internet server while allowing still to connect to the internet. And the frontend computor only lets trusted hosts in. Since the firewall router does network translation it does not matter to my vpn only to my frontend. the dhp should assign the same subnet then the router will do if need be but I should be able to keep everything pretty close. I will try to post my ifconfig log.
 
Old 11-06-2009, 05:02 PM   #13
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hi dvdljns,

it would be nice, if possible, to see as well the output of "ipconfig /all" from your old nt4 (if it is still online and the configuration hasn't changed).

Markus

Last edited by markush; 11-06-2009 at 05:09 PM.
 
Old 11-06-2009, 07:00 PM   #14
dvdljns
Member
 
Registered: Sep 2003
Posts: 210

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by markush View Post
Hi dvdljns,

it would be nice, if possible, to see as well the output of "ipconfig /all" from your old nt4 (if it is still online and the configuration hasn't changed).

Markus
It does not exist anymore. If it did I would have gave up all ready. I could not get linux to load on it. It was only 300 mhz. You may end up seeing it loaded on the one I got ubuntu on now but It's a pain to load and slow but it really did do most of config work itself. Tried to write it to ausb drive but can't do that. You do not permission to do stuff in xwindows. Calling this a gui system is a joke.
 
Old 11-06-2009, 07:36 PM   #15
dvdljns
Member
 
Registered: Sep 2003
Posts: 210

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by nimnull22 View Post
Or you can REDIRECT any dhcp requests from ethX to wlanX with Iptables redirect rule.

Thats what the howto I started out with had me do but why I do not know. I think thats why I am bypassing the dhcp server now. I think route2 would help but it is like knowing you need a carbuter with out knowing where it is. I found a page that told what to put but when I opened the file it gave there was a lot of info in it and adding it at top or bottam did not have any efect. It was something like Wlan2 ----> internet
eth1 ----> vpn eth1 ----> wlan2. I know thats not exactly right but it was something like that.
I have messed with ubuntu enough it is not to stable now. When I reload is there anything you can think of that might help.
 
  


Reply



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
DHCP on CentOS 4.7 - /var/lib/dhcp/dhcpd.leases: Permission denied Latitude Linux - Networking 1 06-05-2009 02:08 AM
Force DHCP To Refuse Clients A DHCP Lease Depending On Client MAC Address blackfish Linux - Server 3 08-17-2007 12:54 AM
Dhcp failed with error (Pump Told us : no dhcp reply recived.) alok.rhct Linux - Networking 3 03-24-2007 07:28 AM
Understanding DHCP Host Name Woodsman Slackware 9 09-26-2006 09:24 PM
XP Pro Build 2600/sp1 v.1105 DHCP Client to Redhat 8.0 DHCP Server - Problems atomant Linux - Networking 5 06-28-2003 11:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:51 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration