LinuxQuestions.org
Visit Jeremy's Blog.
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-24-2003, 03:00 PM   #1
pabloromero
LQ Newbie
 
Registered: Nov 2003
Location: Cordoba
Distribution: Red Hat 8
Posts: 24

Rep: Reputation: 15
basic DHCP between two PC


Hello again friends

I have 2 PC...

Machine A: 192.168.0.1 fixed address. Red hat 8,
netmask 255.255.255.0

I have another machine with windows ( machine B ), for practice.
( machine B: 192.168.0.2 netmask 255.255.255.0 ). I want use DHCP
server for giving the clients any address. This net with fixeds
IP works ( thanks to all of you ).

I did a dhcpd.conf looks like:

ddns-update-style interim;
default-lease-time 600;
max-lease-time 7200;

option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;

# option domain-name-servers I DONT HAVE ANY
# option domain-name I DONT HAVE ANY

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.3 192.168.0.10;
}

IN /etc/sysconfig/ i have
DHCPDARGS=eth0

The others files .leases exists. Is empty.

QUESTION 1)
When i start the DHCP service, it says

Not subnet for 0.0.0.0
Not configured for listening on any interface!

Why did I do wrong?

QUESTION 2)
IMPORTANT: the machine A has a fixed IP 192.168.0.1...is this
correct if i decide to use a DHCP for clients?

Thanks friends...

Pablo
 
Old 11-24-2003, 03:19 PM   #2
atlesn
Member
 
Registered: Oct 2003
Location: Oslo, Norway
Distribution: RedHat 9.0, Fedora Core 1/2/3, Debian 3.0, Smoothwall
Posts: 110

Rep: Reputation: 15
Sure your eth0 (network card) is up before you start dhcpd?

You should configure RH to start dhcpd automaticly when it starts:

run setup as root
select System services
select dhcpd
press enter twice
run init 6 to restart
 
Old 11-24-2003, 03:27 PM   #3
atlesn
Member
 
Registered: Oct 2003
Location: Oslo, Norway
Distribution: RedHat 9.0, Fedora Core 1/2/3, Debian 3.0, Smoothwall
Posts: 110

Rep: Reputation: 15
Question 2:

You can use ANY ip adress you want, but you have to changethe "subnet" statement in dhcpd.conf... But for home networking, its standard to use 192.168.*.* or 10.*.*.*, since they are not valid on the Internet.
 
Old 11-25-2003, 12:13 AM   #4
pabloromero
LQ Newbie
 
Registered: Nov 2003
Location: Cordoba
Distribution: Red Hat 8
Posts: 24

Original Poster
Rep: Reputation: 15
more about question

My machine A has a fixed IP 192.168.0.1...I mean

Do the DHCP server have to have a fixed ip? or the DHCP server gives an IP to the server itself?

1) If the server , i suppose, have an IP fixed...192.168.0.1 this configutarion is correct?

ddns-update-style ad-hoc;

subnet 192.168.1.0 netmask 255.255.255.0 {

range 192.168.1.10 192.168.1.100;
default-lease-time 86400;
max-lease-time 86400;

option routers 192.168.1.1;
option ip-forwarding off;
option broadcast-address 192.168.1.255;
option subnet-mask 255.255.255.0;
}

Remember: IT's for a Home Lan.

2) my route shows

[root@servidor sysconfig]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo

IF DHCP needs 255.255.255.255 how do i put this in ROUTE table and
that data stay in it?


Gracias amigos! Thank you friends

Pablo
 
Old 11-25-2003, 10:00 AM   #5
atlesn
Member
 
Registered: Oct 2003
Location: Oslo, Norway
Distribution: RedHat 9.0, Fedora Core 1/2/3, Debian 3.0, Smoothwall
Posts: 110

Rep: Reputation: 15
Your server could give itself an IP if you make your network-card searh for an DHCP server. When it times out without finding any DHCP server, it makes an IP itself. It sets netmask of 255.255.0.0, which means that your ip suddenly is 192.168.10.50 or even 192.168.180.210. The timeout is very slow, and if you are a busy person, this is not recommended.

Your subnet statement, your ip and netmask don't get along very well.. When your netmask is 255.255.255.0, the three first parts (192.168.0) must be equal to your servers IP. If your netmask is 255.255.0.0, the two first parts must be equal (192.168).

Netmask is the top leader, saying how many computers that are allowed on your LAN. It decides when to use a geteway, telling if a computer is out on the Internet or one your LAN. If your netmask is 255.255.255.0, your ip is 192.168.0.1 and your computer is trying to find the computer having the IP 192.168.52.10, it automaticly will try to find this computer on the internet through the default gateway (three first parts does not match). If it tries to find the ip 192.168.0.50 however, it does not search through any gateway.

(Maybe not what you asked for, but telling you anyway.).


This configuration should work (include that other stuff to!!):

notice this!!
\/
subnet 192.168.0.0 netmask 255.255.255.0 {

range 192.168.0.10 192.168.0.100;
default-lease-time 86400;
max-lease-time 86400;

option routers 192.168.0.1;
option ip-forwarding off;
option broadcast-address 192.168.0.255;
option subnet-mask 255.255.255.0;
}
 
Old 11-25-2003, 10:02 AM   #6
atlesn
Member
 
Registered: Oct 2003
Location: Oslo, Norway
Distribution: RedHat 9.0, Fedora Core 1/2/3, Debian 3.0, Smoothwall
Posts: 110

Rep: Reputation: 15
NB: Your routing table has nothing to do with this! It's fixes itsef to your configuration (at least for dhcpd)..

Last edited by atlesn; 11-25-2003 at 03:14 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Basic question on hostname under DHCP madangsweh Linux - Networking 6 12-09-2004 04:55 PM
Basic DNS/DHCP question sporkfish Linux - Networking 5 07-14-2004 07:30 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
I'm a BASIC chap, looking for some info on BASIC programming CragStar Programming 2 01-21-2001 09:19 AM
Basic DHCP Question bfloeagle Linux - Networking 3 08-23-2000 07:57 PM

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

All times are GMT -5. The time now is 09:13 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