Please note the new address for this forum : forum.excito.org. The old address redirects here but I don't know for how long. Thanks !
New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !
DHCP Server and Static IP Addresses
DHCP Server and Static IP Addresses
I would like to set my Bubba2 up to issue static IP address for DHCP clients but the web-based setup doesn't seem to have a mechanism to add the static leases and I can't seem to find the appropriate config file to edit.
Can someone point me in the right direction?
Also, once DHCP is setup will the leases realized from the DNS server?
Thanks,
Rob
Can someone point me in the right direction?
Also, once DHCP is setup will the leases realized from the DNS server?
Thanks,
Rob
Re: DHCP Server and Static IP Addresses
Well.... If you are using static IP, why use DHCP and if its a DHCP, why bother with static IP's 
However, in general if you have an IP on a machine, it will usually try to regain that IP again at the next lease, or you can set leases to never expire. Simplest solution is to give the machine that you need static an IP outside the DHCP lease range and then add it to your hosts file.

However, in general if you have an IP on a machine, it will usually try to regain that IP again at the next lease, or you can set leases to never expire. Simplest solution is to give the machine that you need static an IP outside the DHCP lease range and then add it to your hosts file.
Re: DHCP Server and Static IP Addresses
Asparak,
Good question... but my goal is to have certain machines with static IP addresses and certain ones with dynamic IP addresses, but in all cases each will get the gateway and dns information from the dhcp server. This way I dont have to go around to all my static IP machines and set that when the information changes - not that it changes all that often - but by adding the Bubba2 into the mix, this may cause a change to my configuration.
I have been doing it this way for some time using a normal Ubuntu server system and I am comfortable with it, But now that I am tring to go green and trying fit into a smaller footprint, I am trying to replace my main server with the Bubba2 and trying to get the same level of service from it.
Thanks,
Rob
Good question... but my goal is to have certain machines with static IP addresses and certain ones with dynamic IP addresses, but in all cases each will get the gateway and dns information from the dhcp server. This way I dont have to go around to all my static IP machines and set that when the information changes - not that it changes all that often - but by adding the Bubba2 into the mix, this may cause a change to my configuration.
I have been doing it this way for some time using a normal Ubuntu server system and I am comfortable with it, But now that I am tring to go green and trying fit into a smaller footprint, I am trying to replace my main server with the Bubba2 and trying to get the same level of service from it.
Thanks,
Rob
Re: DHCP Server and Static IP Addresses
In that case you would need to add something like this in dhcpd.conf
host computer {
hardware ethernet 00:00:00:00:00:00;
fixed-address 192.168.x.x;
}
If you google dhcp.conf there are plenty of examples of adding static allocations which should solve your solution
host computer {
hardware ethernet 00:00:00:00:00:00;
fixed-address 192.168.x.x;
}
If you google dhcp.conf there are plenty of examples of adding static allocations which should solve your solution
Re: DHCP Server and Static IP Addresses SOLVED
I figured it out.
Bubba2 uses dnsmasq instead of dhcp3-server. This is why I couldn't find the configuration files I was looking for. Now that I know this, configuring dnsmasq is easy. However it must be done as root via SSH and will require the dnsmasq server to be restarted.
Editting the dnsmasq file (/etc/dnsmasq.conf), I added entries to the end of the file that look like
One gotcha is that by default dnsmasq assumes the server it runs on is the gateway. Since I am not using my Bubba2 as my gateway, I needed to specify my real gateway using
Note the "3" is required as I assume option #3 is the gateway.
There are more advanced configuration options availble, but you will need to seek out the dnsmasq docs for them. You should be able to find them somewhere at http://www.thekelleys.org.uk/dnsmasq/doc.html
One more thing.... I backed up my /etc/dnsmasq.conf file just in case the web-based configuriation facility overwrites it, however I tested changing the lease range (via the web-based facility) and my changes were still intact.
Thanks...
Rob
Bubba2 uses dnsmasq instead of dhcp3-server. This is why I couldn't find the configuration files I was looking for. Now that I know this, configuring dnsmasq is easy. However it must be done as root via SSH and will require the dnsmasq server to be restarted.
Editting the dnsmasq file (/etc/dnsmasq.conf), I added entries to the end of the file that look like
Code: Select all
dhcp-host=AB:CD:EF:11:22:33,192.168.1.10,24h
Code: Select all
dhcp-option=3,x.y.z.w
There are more advanced configuration options availble, but you will need to seek out the dnsmasq docs for them. You should be able to find them somewhere at http://www.thekelleys.org.uk/dnsmasq/doc.html
One more thing.... I backed up my /etc/dnsmasq.conf file just in case the web-based configuriation facility overwrites it, however I tested changing the lease range (via the web-based facility) and my changes were still intact.
Thanks...
Rob
Re: DHCP Server and Static IP Addresses
Yep - you are correct. Complete brain failure there as I was working on a Unix box at the time and forgot about DNSMasq
Re: DHCP Server and Static IP Addresses
hi,
i am trying to do exactly the same thing but without the previous experience that the op has in achieving this goal.
here is a link to a thread at the ubnutu forums which gives a pretty good expliantion of where i am at. i apologize if it is a bit long. http://ubuntuforums.org/showthread.php?t=1427821
i think the missing piece is updating the /etc/hosts file on bubba. i am not sure how to do that. other than vi /etc/hosts. what should i add?
please advise.
i am trying to do exactly the same thing but without the previous experience that the op has in achieving this goal.
here is a link to a thread at the ubnutu forums which gives a pretty good expliantion of where i am at. i apologize if it is a bit long. http://ubuntuforums.org/showthread.php?t=1427821
i think the missing piece is updating the /etc/hosts file on bubba. i am not sure how to do that. other than vi /etc/hosts. what should i add?
please advise.
~alonzo...
Re: DHCP Server and Static IP Addresses
Hi Zander...
It seems like you are trying to do pretty much the opposite of what I am doing. I am using the Bubba2 as my DHCP and DNS server and wanted it to configure requesting machines with an IP address of my choice rather than a random one. From the thread you linked to, it seems like you are simply trying to assign a static IP to the Bubba2, itself. Can't you do that from the web-based confguration app? For example from
http://bubba/admin/network/lan
Rob
It seems like you are trying to do pretty much the opposite of what I am doing. I am using the Bubba2 as my DHCP and DNS server and wanted it to configure requesting machines with an IP address of my choice rather than a random one. From the thread you linked to, it seems like you are simply trying to assign a static IP to the Bubba2, itself. Can't you do that from the web-based confguration app? For example from
http://bubba/admin/network/lan
Rob
Re: DHCP Server and Static IP Addresses
hi rob,
the bubba2 has a external static ip address already and it is working fine. i had to get this from my isp so i could use it as a lamp server.
my bubba is configured as a server/router/firewall (scenario 4). the bubba router hands out dhcp addresses in the lease range of 192.168.10.50 to 192.168.10.100.
at present bubba's firewall is configured with private port 80 forward to 1234 and 1235. for simplicity i will only talk about public port 1234. public port 1234 gives tcp accesss to a new ubuntu server behind my firewall that dhcp has handed the address 192.168.10.53. this works fine and one can access the new server with the link http://alonzofretwell.com:1234
however my goal is to assign the new server at http://alonzofretwell.com:1234 a static ip address of 192.168.10.2 which is outside the lease range of dhcp. i want to do this to ensure the port forward always works for the new server behind the bubba firewall because the port forward must have the private ip of the target server behind the bubba firewall which could change it were left up to dhcp.
subsequently i believe that i can do this by adding to /etc/network/interfaces on the new server behind the bubba firewall and commenting out...
which is there now.
this will be the first step to reach my goal.
i believe the second step is to make chages to the bubba /etc/hosts file to let bubba know that 192.168.10.2 is the static address of a new host on the subnet. i know how to do the first part but not the second where i add the new static address to the host file.
there is no way to do this in the bubba admin gui interface.
i need to go through this thread more carefully because i think it will tell me how to edit the bubba /etc/host file (if that is where the hosts file is on bubba).
at present the bubba /etc/hosts has this in it...
i think i just need change it to look like this...
i just need to add...
to bubba /etc/hosts
i think i need to restart something if i change /etc/hosts so that the file gets read again. is that true?
thank you for any help you can offer.
the bubba2 has a external static ip address already and it is working fine. i had to get this from my isp so i could use it as a lamp server.
my bubba is configured as a server/router/firewall (scenario 4). the bubba router hands out dhcp addresses in the lease range of 192.168.10.50 to 192.168.10.100.
at present bubba's firewall is configured with private port 80 forward to 1234 and 1235. for simplicity i will only talk about public port 1234. public port 1234 gives tcp accesss to a new ubuntu server behind my firewall that dhcp has handed the address 192.168.10.53. this works fine and one can access the new server with the link http://alonzofretwell.com:1234
however my goal is to assign the new server at http://alonzofretwell.com:1234 a static ip address of 192.168.10.2 which is outside the lease range of dhcp. i want to do this to ensure the port forward always works for the new server behind the bubba firewall because the port forward must have the private ip of the target server behind the bubba firewall which could change it were left up to dhcp.
subsequently i believe that i can do this by adding
Code: Select all
auto eth0
iface eth0 inet static
address 192.168.10.2
gateway 192.168.10.1
netmask 255.255.255.0
Code: Select all
auto eth0
iface eth0 inet dhcp
this will be the first step to reach my goal.
i believe the second step is to make chages to the bubba /etc/hosts file to let bubba know that 192.168.10.2 is the static address of a new host on the subnet. i know how to do the first part but not the second where i add the new static address to the host file.
there is no way to do this in the bubba admin gui interface.
i need to go through this thread more carefully because i think it will tell me how to edit the bubba /etc/host file (if that is where the hosts file is on bubba).
at present the bubba /etc/hosts has this in it...
Code: Select all
127.0.0.1 bubba.localdomain bubba
127.0.0.1 localhost.localdomain localhost
192.168.10.1 bubba.localdomain bubba
Code: Select all
127.0.0.1 bubba.localdomain bubba
127.0.0.1 localhost.localdomain localhost
192.168.10.1 bubba.localdomain bubba
192.168.10.2 oznola.localdomain oznola
Code: Select all
192.168.10.2 oznola.localdomain oznola
i think i need to restart something if i change /etc/hosts so that the file gets read again. is that true?
thank you for any help you can offer.

~alonzo...
Re: DHCP Server and Static IP Addresses
Hi Zander...
Ok.. so you are trying to do exactly the same thing as me. I am sorry I misunderstood the first time.
I would take the approach that I am using such that the Bubba2 server hands the ubuntu server (port 1234) its IP address of 192.168.10.2 as well as its DNS and routing information.
In any case, it seems like you have most of what you need done.
As for your final step of adding the host to the hosts file to get the DNS to work, you are correct. DNSMask relies on the hosts entries as well as its DHCP entries for DNS queries.
Once you edit the hosts file, you will need to restart the dnsmasq server. To do this, either reboot your bubba or enter this on the command line as root:
/etc/init.d/dnsmasq restart
Then your changes will be realized by the server and you will be good to go.
I hope this helps.
Rob
Ok.. so you are trying to do exactly the same thing as me. I am sorry I misunderstood the first time.
I would take the approach that I am using such that the Bubba2 server hands the ubuntu server (port 1234) its IP address of 192.168.10.2 as well as its DNS and routing information.
In any case, it seems like you have most of what you need done.
As for your final step of adding the host to the hosts file to get the DNS to work, you are correct. DNSMask relies on the hosts entries as well as its DHCP entries for DNS queries.
Once you edit the hosts file, you will need to restart the dnsmasq server. To do this, either reboot your bubba or enter this on the command line as root:
/etc/init.d/dnsmasq restart
Then your changes will be realized by the server and you will be good to go.
I hope this helps.
Rob
Re: DHCP Server and Static IP Addresses
hi,
so i just add the one line "192.168.10.2 oznola.localdomain oznola" to /etc/hosts then?
and then restart the dnsmasq.
thank you for your help.
so i just add the one line "192.168.10.2 oznola.localdomain oznola" to /etc/hosts then?
and then restart the dnsmasq.
thank you for your help.

~alonzo...
Re: DHCP Server and Static IP Addresses
that is correct... but I think you said that you had 2 servers, so you will want to add the other as well. 
Rob

Rob
Re: DHCP Server and Static IP Addresses
hi,
well i have done all that.
i updated the rule for my port forward so that port 1234 points to 192.168.10.2.
i cannot ping the new server. but i can see it with lookup.
after rebooting bubba and the new server dhcp is still giveing oznola (the new server) a lease on its old dhcp address. i think this has something to do with the problem.
also in the post you marked solved. you say that you had to edit /etc/dnsmasq.conf i have not edited that file. should i edit that one too? also my bubba is being used as the gateway
i hate to keep pestering you but i have never made changes to /etc/dnsmasq.conf before and i am not sure what to do in there.
i am going to read the link you gave on dnsmasq.
well i have done all that.
i updated the rule for my port forward so that port 1234 points to 192.168.10.2.
i cannot ping the new server. but i can see it with lookup.
after rebooting bubba and the new server dhcp is still giveing oznola (the new server) a lease on its old dhcp address. i think this has something to do with the problem.
also in the post you marked solved. you say that you had to edit /etc/dnsmasq.conf i have not edited that file. should i edit that one too? also my bubba is being used as the gateway
i hate to keep pestering you but i have never made changes to /etc/dnsmasq.conf before and i am not sure what to do in there.
i am going to read the link you gave on dnsmasq.
~alonzo...
Re: DHCP Server and Static IP Addresses
When you boot your server, the one that is supposed to be (192.168.10.2), what does it say when you query for its IP address. From the console or an xterm, run
You should get something like:
The 2nd line of the eth0 entry will have the IP address of your machine. If you keep getting the old address (not 192.168.10.2) then maybe your server is still asking for an IP from the DHCP server.
As for edtting dnsmasq.conf, you only need to do this if you want your server to obtain its "static" ip from the dnsmasq DHCP server. If so, follow the edits that I posted in my SOLVED response. If your server is still pulling from DHCP, then all should work out without you having to change anything on the 192.168.10.2 server- though I would un-edit the networking files so things are pure again.
Finally, if your issue is only that the dnsmasq DNS is not resolving the dns name to 192.168.10.2 and vice-versa, tail the syslog (/etc/syslog) as you restart dnsmaqs to see if it is having an issue when it starts... maybe there is an error in your hosts file.
I hope this helps...
Rob
Code: Select all
ifconfig
Code: Select all
eth0 Link encap:Ethernet HWaddr AA:BB:CC:DD:EE:FF
inet addr:xyz.xyz.xyz.xyz Bcast:yyy.yyy.yyy.yyy Mask:zzz.zzz.zzz.zzz
inet6 addr: AAAA::BBB:CCC:DDD:EEE/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:737624 errors:0 dropped:0 overruns:0 frame:0
TX packets:927895 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:125436617 (125.4 MB) TX bytes:674784673 (674.7 MB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:513767 errors:0 dropped:0 overruns:0 frame:0
TX packets:513767 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:182834764 (182.8 MB) TX bytes:182834764 (182.8 MB)
As for edtting dnsmasq.conf, you only need to do this if you want your server to obtain its "static" ip from the dnsmasq DHCP server. If so, follow the edits that I posted in my SOLVED response. If your server is still pulling from DHCP, then all should work out without you having to change anything on the 192.168.10.2 server- though I would un-edit the networking files so things are pure again.
Finally, if your issue is only that the dnsmasq DNS is not resolving the dns name to 192.168.10.2 and vice-versa, tail the syslog (/etc/syslog) as you restart dnsmaqs to see if it is having an issue when it starts... maybe there is an error in your hosts file.
I hope this helps...
Rob
Re: DHCP Server and Static IP Addresses
hi,
i seem to have resolved my problem. network manager was interfearing with my changes in /etc/network/interfaces. so i returned the file to its default state and setup the static ip address through the network manager gui.
thank you for all your help.
i seem to have resolved my problem. network manager was interfearing with my changes in /etc/network/interfaces. so i returned the file to its default state and setup the static ip address through the network manager gui.

thank you for all your help.

~alonzo...