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 |
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 |
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. |
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 |
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; } |
NB: Your routing table has nothing to do with this! It's fixes itsef to your configuration (at least for dhcpd)..
|
All times are GMT -5. The time now is 03:52 AM. |