Author Topic: Request Help Moving DHCP from Router to eBox  (Read 14577 times)

SamK

  • Zen Samurai
  • ****
  • Posts: 283
  • Karma: +3/-0
    • View Profile
Request Help Moving DHCP from Router to eBox
« on: April 28, 2009, 09:28:53 am »
Having trouble getting a working configuration for DHCP in eBox and am hoping to to get some advice.  The LAN workstation does not recieve an ip address from the eBox Machine.

Router
ip address=192.168.2.1
DHCP Status=Disabled


eBox Machine
Single NIC installed=eth0
Module Status
  • DHCP=Enabled
  • DNS=Disabled
Dashboard
  • DHCP=Running
Networking-->Interfaces
  • eth0=Static
  • 192.168.2.3
  • 255.255.255.0

DHCP
  • Custom Gateway=192.168.2.1
  • Domain=Blank
  • Custom Nameserver=192.168.2.1
  • IP Address=192.168.2.3
  • Subnet=192.168.2.0/24
  • Available Range=192.168.2.1-192.168.2.254
All changes saved without errors


From the eBox Machine
ifconfig=192.168.2.3
ping 192.168.2.1=Successful
nslookup www.bbc.co.uk=Successful


From the LAN Workstation (Dynamic IP DHCP)
ifconfig=ip address not allocated


From the LAN Workstation (Static IP Locally Set)
ifconfig=192.168.2.108
ping 192.168.2.1=Successful
ping 192.168.2.3=Successful
nslookup www.bbc.co.uk=Successful


I've gone 'snow-blind' on this and simply cannot see the answer.

javi

  • Zen Hero
  • *****
  • Posts: 1042
  • Karma: +0/-0
    • View Profile
Re: Request Help Moving DHCP from Router to eBox
« Reply #1 on: April 28, 2009, 09:37:34 am »
Please post the contents of /etc/dhcp3/dhcpd.conf

SamK

  • Zen Samurai
  • ****
  • Posts: 283
  • Karma: +3/-0
    • View Profile
Re: Request Help Moving DHCP from Router to eBox
« Reply #2 on: April 28, 2009, 09:59:19 am »
Please post the contents of /etc/dhcp3/dhcpd.conf

As Requested:
Code: [Select]
# extra options
# RFC3442 routes
option rfc3442-classless-static-routes code 121 = array of integer 8;
# MS routes
option ms-classless-static-routes code 249 = array of integer 8;

ddns-update-style none;

option domain-name-servers 192.168.2.1;


default-lease-time 1800;
max-lease-time 7200;

shared-network eth0 {

subnet 192.168.2.0 netmask 255.255.255.0 {
               
                option routers 192.168.2.1;
          option domain-name-servers 192.168.2.1;
                default-lease-time 1800;
                max-lease-time 7200;


        }



}

sixstone

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1417
  • Karma: +26/-0
    • View Profile
    • Sixstone's blog
Re: Request Help Moving DHCP from Router to eBox
« Reply #3 on: April 28, 2009, 10:45:03 am »
Hi SamK,

You just forgot to add a range or a fixed IP address mapping to your DHCP configuration. If you don't do so, the DHCP will not serve any lease.

Best,
My secret is my silence...

SamK

  • Zen Samurai
  • ****
  • Posts: 283
  • Karma: +3/-0
    • View Profile
Re: Request Help Moving DHCP from Router to eBox
« Reply #4 on: April 28, 2009, 12:14:46 pm »
You just forgot to add a range or a fixed IP address mapping to your DHCP configuration. If you don't do so, the DHCP will not serve any lease.
Hi sixstone,

I assumed that web-gui-->DHCP Available Range=192.168.2.1 - 192.168.2.254 indicated that these addresses were ready to lease out.

Having defined a range the client now obtains an address.

I wish to define two ranges and would welcome some advice on how this is best done in eBox.

Range 1
Fixed address allocated against MAC address
192.168.2.2 - 192.168.2.49
Reserved whether or not a name and MAC address is known to eBox and only issued when a name and MAC address is declared within eBox.
Is it possible to reserve a range without entering each name and address?

Range 2
Dynamic address
192.168.2.50 - 198.168.2.250
Unreserved and allocated upon request.

sixstone

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1417
  • Karma: +26/-0
    • View Profile
    • Sixstone's blog
Re: Request Help Moving DHCP from Router to eBox
« Reply #5 on: April 28, 2009, 12:31:57 pm »
It is not necessary to set Range 1. You will need to set up the fixed addresses mapping in the table in order to let the dhcp clients in those machines get the same IP address always.

Best,
My secret is my silence...

Saturn2888

  • Zen Hero
  • *****
  • Posts: 707
  • Karma: +1/-0
    • View Profile
Re: Request Help Moving DHCP from Router to eBox
« Reply #6 on: April 28, 2009, 12:42:08 pm »
To help explain, what sixstone means is that when you are statically assigning addresses in the DHCP server, you don't want to have those also dynamically assigned. Since eBox is your DHCP server, it'll know that 192.168.2.2 = some machine you statically assigned an address to so it won't assign it anything else. Which means you don't have to setup a range of IPs which includes 192.168.2.2 because it'll be in your fixed-address list.

SamK

  • Zen Samurai
  • ****
  • Posts: 283
  • Karma: +3/-0
    • View Profile
Re: Request Help Moving DHCP from Router to eBox
« Reply #7 on: April 28, 2009, 01:17:41 pm »
Hi Saturn2888
Thanks for your input
To help explain, what sixstone means is that when you are statically assigning addresses in the DHCP server, you don't want to have those also dynamically assigned.
Fully agreed.

...Which means you don't have to setup a range of IPs which includes 192.168.2.2 because it'll be in your fixed-address list.
What I wish to achieve is to reserve a block of successive fixed ip addresses.  Initially the list of reserved addresses will exceed the number of leases required.  From this block I can then maually allocate a name and MAC address within eBox to a device I wish to add to the network as and when the need arises. 

...You will need to set up the fixed addresses mapping in the table...
I have attempted to do this but all fields require populating before they can be saved.  Providing dummy information of Address=192.168.2.x  Name=Unallocated and MAC=xx:xx:xx:xx:xx:xx is not allowed as the MAC address is seen by eBox as invalid.

Saturn2888

  • Zen Hero
  • *****
  • Posts: 707
  • Karma: +1/-0
    • View Profile
Re: Request Help Moving DHCP from Router to eBox
« Reply #8 on: April 28, 2009, 01:23:06 pm »
My recommendation is just let it assign IPs in the 192.169.2.50+ range and then go to your dashboard and start picking out MAC addresses that show up there. Or you can do ifconfig -a or ipconfig /all on the machines which works too for finding MAC addresses. I just did it slowly over time. Anytime I get a new wireless card or wired one, I just hook it up, pull the IP, put it in the table, and it'll statically assign the IP when the lease is gone in 3600 seconds or so.
« Last Edit: April 28, 2009, 01:26:28 pm by Saturn2888 »

SamK

  • Zen Samurai
  • ****
  • Posts: 283
  • Karma: +3/-0
    • View Profile
Re: Request Help Moving DHCP from Router to eBox
« Reply #9 on: April 28, 2009, 03:18:23 pm »
As an experiment the following ranges have beed added within the available range created by eBox:
Web-GUI-->DHCP
Add Range
  • Name=Reserved
  • From=192.168.2.4
  • To=192.168.2.99

Add Range
  • Name=Unreserved
  • From=192.168.2.100
  • To=192.168.2.250

On LAN Workstation
  • ip address allocated via DHCP=192.168.2.100

QUESTIONS
01 How does eBox decide which of the ranges to allocate a lease from?
02 What is the purpose of eBox being able to create multiple ranges within a larger available range?

Saturn2888

  • Zen Hero
  • *****
  • Posts: 707
  • Karma: +1/-0
    • View Profile
Re: Request Help Moving DHCP from Router to eBox
« Reply #10 on: April 28, 2009, 03:31:05 pm »
In my network, I have statically assigned (by the DHCP module) 1.1.0.0/16 network addresses. The guest IP subnet is 2.2.2.0/24. When someone connects, if their MAC address isn't already in the 1.1.0.0/16 DHCP table, then it assigns a 2.2.2.0/24 address. From my knowledge, it doesn't assign these sequentially, it does them randomly within the subnet. And also from my experience, it assigns a high-numbered address like 2.2.2.234 or 2.2.2.247 for example.

If a friend connects in, and I trust his computer, his MAC address will show up on the dashboard, I copy/paste that into the 1.1.0.0/16 network (fixed), and then I save changes. After that I can disconnect the ethernet cable or the wireless connection and reconnect it to the friend's PC/laptop, and they're in.

Sam Graf

  • Guest
Re: Request Help Moving DHCP from Router to eBox
« Reply #11 on: April 28, 2009, 03:58:41 pm »

QUESTIONS
01 How does eBox decide which of the ranges to allocate a lease from?
02 What is the purpose of eBox being able to create multiple ranges within a larger available range?

I think there's some confusion here. When eBox's DHCP module is first enabled, the entire address range is "unallocated." You could assign static IPs from the entire range. The purpose of DHCP is to allow at least some client devices to have a dynamic addresses allocated as needed. So out of the entire range of available addresses a DHCP range or dynamically available range of addresses is set aside. Any address outside the DHCP/dynamic range may still be assigned statically.

So with that, the questions, but in reverse order:

02 I'm not sure what the purpose is, unless it's meant as a flexibility feature (perhaps a single eBox can allocate addresses from different subnets?). Having two or more DHCP ranges seems to me to be unnecessary in most cases. A single block of addresses big enough to accommodate the number of possible devices works well.

01 Again, I don't know how this might work, because I'm not sure what purpose the capability serves. But for the task of replacing a single router, you need to assign only one DHCP/dynamic address range. All addresses outside that range are by definition unallocated and can be assigned statically as needed.

EDIT: A case where you might want to have some addresses available for static assignment: A wireless access point. Assigning the access point a static address means you always know where to find it. Another might be a network device you want to give special treatment, like an Xbox. So while it's possible to put an entire subnet into a DHCP range, if it's not necessary to do so, it's better to have some unallocated (from the DHCP server's point of view) addresses available for these types of purposes.
« Last Edit: April 28, 2009, 04:09:56 pm by Sam Graf »

SamK

  • Zen Samurai
  • ****
  • Posts: 283
  • Karma: +3/-0
    • View Profile
Re: Request Help Moving DHCP from Router to eBox
« Reply #12 on: April 28, 2009, 04:53:12 pm »
Hi Sam Graf,

...you need to assign only one DHCP/dynamic address range. All addresses outside that range are by definition unallocated and can be assigned statically as needed.
I understand and fully agree with this point.  It is likely to be the method I adopt.

In general I attempt to remember as little as necessary, hence the naming of the ranges in the experiment previously mentioned.  The address allocated to the LAN workstation was from the 2nd group (addresses 100 upwards).  I am attempting to establish if this was a coincidence, or by design on the part of eBox. 

Does having 2 ranges within a single larger range allow eBox to only dynamically allocate addresses from this second group, effectively ignoring the 1st range?  If this is the case (either by accident or design), creating the two groups assists in my desire to remember as little as needed and provides an aid to quickly identifying the nature of the address.  It might be that a member of the eBox staff is able to provide the confirmation of its behviour.

Ultimately it is not strictly needed but is something I have used in the past and find very useful. 

Many thanks for your input.
« Last Edit: April 28, 2009, 05:03:04 pm by SamK »

Saturn2888

  • Zen Hero
  • *****
  • Posts: 707
  • Karma: +1/-0
    • View Profile
Re: Request Help Moving DHCP from Router to eBox
« Reply #13 on: April 28, 2009, 04:57:46 pm »
SamK, the reason you can assign multiple address blocks is because you can DHCP 10.10.5.1- to .15 and then have static addresses from .16 to .20, then have dynamic addresses from .21 on up. See?

And I think sixstone is sleeping so you'll have to wait on your answer for how DHCP works.
« Last Edit: April 28, 2009, 05:00:20 pm by Saturn2888 »

sixstone

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1417
  • Karma: +26/-0
    • View Profile
    • Sixstone's blog
Re: Request Help Moving DHCP from Router to eBox
« Reply #14 on: April 28, 2009, 05:26:30 pm »
Hi
In general I attempt to remember as little as necessary, hence the naming of the ranges in the experiment previously mentioned.  The address allocated to the LAN workstation was from the 2nd group (addresses 100 upwards).  I am attempting to establish if this was a coincidence, or by design on the part of eBox. 

ISC DHCP daemon has no specification about which range to take if there are more than one. So this behaviour may be a coincidence or not.

SamK, the reason you can assign multiple address blocks is because you can DHCP 10.10.5.1- to .15 and then have static addresses from .16 to .20, then have dynamic addresses from .21 on up. See?

And I think sixstone is sleeping so you'll have to wait on your answer for how DHCP works.

SamK, Saturn2888 got the point to add more than one range. Only applicable if you want more flexibility about your ranges.

And Saturn2888, I was offline which does not mean I was sleeping like a log :D

Best,
My secret is my silence...