LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   setting up dhcp3-server 10.04.4 (https://www.linuxquestions.org/questions/ubuntu-63/setting-up-dhcp3-server-10-04-4-a-899460/)

{davros} 08-25-2011 04:56 PM

setting up dhcp3-server 10.04.4
 
trying to set up a dhcp server along with files and web but right now it wont even share a connection...

here is my ifconfig...

eth0 Link encap:Ethernet HWaddr 00:50:45:01:08:ba
inet addr:66.189.112.57 Bcast:255.255.255.255 Mask:255.255.252.0
inet6 addr: fe80::250:45ff:fe01:8ba/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7613 errors:0 dropped:0 overruns:0 frame:0
TX packets:1814 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2500624 (2.5 MB) TX bytes:206021 (206.0 KB)
Interrupt:27

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:190 errors:0 dropped:0 overruns:0 frame:0
TX packets:190 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:24703 (24.7 KB) TX bytes:24703 (24.7 KB)

notice that eth1 is not listed it no longer has an address or subnet assigned to it .. trying to start over again...

i also dont understand what address should be assigned to eth1 honestly.

ok i first used dhcp3-server, with these settings in the dncpd.conf file ...

default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers 192.168.1.1, 192.168.1.2;
option domain-name “yourdomainname.com”;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.200;
}


i used "mine.org" for the domain name cuz i really dont have one i guess.


i set eth1 to

sudo ifconfig eth1 broadcast 192.168.1.255 netmask 255.255.255.0


and i got it to give out ip addresses that did nothing lol.

the route -n had the gateway at 0.0.0.0

acid_kewpie 08-26-2011 02:52 AM

Fix one issue at a time. If eth1 is down then fix that as it is obviously nothing to do with.dhcpd in the slightest. Why do you care about broadcast addresses? There is no need to specify it.

The router address in etc dhcpd.conf needs to be within the subnet declaration for obvious reasons.

{davros} 08-28-2011 05:05 PM

so i dont have to set a broadcast addy for eth1, and this ... option routers 192.168.1.254 needs to be with in the range of ip's ....

{davros} 08-30-2011 03:27 AM

auto eth1
iface eth1 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway "my ip here"

{davros} 08-31-2011 03:55 PM

ok i fixed the eth1 issue now it still gives out ip's that have no connection

acid_kewpie 08-31-2011 04:29 PM

An ip that has no connection?? That makes no sense at all. Something is missing / wrong in the lease data? What is it?

{davros} 08-31-2011 04:46 PM

its gives out ip's that dont connet to the interweb...

heres the newest configuration info..


...route -n


Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.252.0 U 0 0 0 eth1
66.189.112.0 0.0.0.0 255.255.252.0 U 0 0 0 eth0
0.0.0.0 66.189.112.1 0.0.0.0 UG 100 0 0 eth0


..the dhcpd.conf

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.200;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.1, 192.168.1.2;
option domian-name "mine.org";
option routers 192.168.1.254;
option broadcast-address 192.168.1.255;
default-lease-time 600;
max-lease-time 7200;
}


..here is the /etc/network/interfaces


auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 66.189.114.152



..and finally my ifconfig....



eth0 Link encap:Ethernet HWaddr 00:50:45:01:08:ba
net addr:66.189.114.152 Bcast:255.255.255.255 Mask:255.255.252.0
inet6 addr: fe80::250:45ff:fe01:8ba/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7613 errors:0 dropped:0 overruns:0 frame:0
TX packets:1814 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2500624 (2.5 MB) TX bytes:206021 (206.0 KB)
Interrupt:27

eth1 Link encap:Ethernet HWaddr 00:50:45:01:08:bb
inet addr:192.168.1.2 Bcast:192.168.0.255 Mask:255.255.252.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0 MB) TX bytes:0 (0 KB)
Interrupt:27

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:190 errors:0 dropped:0 overruns:0 frame:0
TX packets:190 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:24703 (24.7 KB) TX bytes:24703 (24.7 KB)

acid_kewpie 08-31-2011 05:06 PM

IP addresses don't "connect " to anything. Systems with correctly configured interfaces and routing tables do. Sorry to sound pedantic but it does matter.

You have different subnet masks on that network. Some are 255.255.252.0 others are 255.255.255.0.

You need to actually look at a client configuration in the wild, not just server side files.

{davros} 08-31-2011 05:12 PM

At least your actually telling me where to look. I'm guessing as I go anyways. Ya the ip and mask from the modem is 255.255.252.0 so I'm guessing they all need to match that?

acid_kewpie 09-01-2011 02:42 AM

you don't just "guess", you need to understand. Ultimately they need to be *correct* not just the same. your local subnet is very very likely to need to be a /24, so 255.255.255.0 but you should know this already. You also need to look at a client and see how it's configured after receiving a lease, including looking at it's actual lease file, in somewhere like /var/lib/dhcp/leases, i forget what it's normally called.

{davros} 09-01-2011 01:28 PM

lease from server...

lease {
interface "eth0";
fixed-address 66.189.114.152;
option subnet-mask 255.255.252.0;
option time-offset -14400;
option routers 66.189.112.1;
option dhcp-lease-time 3600;
option dhcp-message-type 5;
option domain-name-servers 66.189.0.100,24.159.64.23,24.247.24.53;
option dhcp-server-identifier 68.114.38.40;
option interface-mtu 576;
option broadcast-address 255.255.255.255;
option host-name "server";
renew 4 2011/09/01 18:24:43;
rebind 4 2011/09/01 18:52:43;
expire 4 2011/09/01 19:00:13;
}


lease info from one "client"


lease {
interface "eth0";
fixed-address 192.168.1.11;
option subnet-mask 255.255.255.0;
option routers 192.168.1.254;
option dhcp-lease-time 600;
option dhcp-message-type 5;
option domain-name-servers 192.168.1.1, 192.168.1.2;
option dhcp-server-identifier 192.168.1.5;
option broadcast-address 192.168.1.255;
option domain-name "mine.org;
renew 4 2011/09/01 18:19:14;
rebind 4 2011/09/01 18:23:12;
expire 4 2011/09/01 18:24:27;
}



i also dont know if this matters but...running traceroute on my ip returns this...

66-189-114-152.dhcp.oxfr.ma.charter.com (66.189.114.152)

it makes me wonder about the .dhcp. and if that would matter or not. and why when i have just the wireless router plugged in to the modem i get a completely different ip in its settings..
24-181-230-86.dhcp.oxfr.ma.charter.com.


if i could understand why's and how's this would be a lot easier. but the online guide and my server book dont troubleshoot this problem .....

acid_kewpie 09-01-2011 02:04 PM

ok, so what is 192.168.1.254?

{davros} 09-01-2011 02:07 PM

an ip for a "router" from what i understand, the router being the server?

acid_kewpie 09-01-2011 02:10 PM

from what you understand? you're giving out an IP address, you clearly need to know what that IP address is don't you? I get the impression it doesn't even exist... What is 192.168.1.1 if the dhcp server is 192.168.1.2? That option needs to be whatever the router IP on that subnet is. That's the default gateway.

{davros} 09-01-2011 02:20 PM

ok then, i am starting to see, slowly. 192.168.1.254 should actually be the eth1 ip address right?


Quote:

"What is 192.168.1.1 if the dhcp server is 192.168.1.2?"
option domain-name-servers 192.168.1.1, 192.168.1.2;

should read

option domain-name-servers 192.168.1.2, 192.168.1. ?

acid_kewpie 09-01-2011 02:24 PM

no, the options should be *correct*. It is really important that you understand what this information is! That's why none of this is working! I can't tell you what addresses they should be, that's for you to know.

{davros} 09-01-2011 02:34 PM

i am trying to "understand" , yes by guessing because i don't have much else to go on here. so far i have gotten farther than i thought i would with what little knowledge of servers i have. no guessing is not really the best way to come to the proper answer. sometimes you get lucky sometimes you don't. so far you have been gracious enough to point out my mistakes and i have been trying to understand why and how to fix them. hopefully continuing on.

acid_kewpie 09-01-2011 02:36 PM

your server appears to be your gateway, so set the router option to that. I've seen no sign of 192.168.1.1 outside of the config so have to assume it doesn't exist, so remove that from the config.

{davros} 09-01-2011 02:50 PM

Quote:

your server appears to be your gateway, so set the router option to that.
not being the ip set by the internet connection. but rather the subnet i set to it 192.168.1.0?

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.200;
option subnet-mask 255.255.255.0;
option domain-name "mine.org";
option routers 192.168.1.0;
option broadcast-address 192.168.1.255;
default-lease-time 600;
max-lease-time 7200;
}


again i am sorry for my lack of understanding this information at this time


and no thats not correect either cuz it didnt work ... :(


All times are GMT -5. The time now is 08:31 PM.