Re: Make a DHCP server using Fedora - Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- On Mon, 11/17/08, Bill Davidsen <davidsen@xxxxxxx> wrote:

> From: Bill Davidsen <davidsen@xxxxxxx>
> Subject: Re: Make a DHCP server using Fedora - Help
> To: fedora-list@xxxxxxxxxx
> Date: Monday, November 17, 2008, 12:03 PM
> Antonio Olivares wrote:
> > --- On Sun, 11/16/08, Marko Vojinovic
> <vvmarko@xxxxxxxx> wrote:
> > 
> >> ###########################
> >> default-lease-time 21600; #600
> >> max-lease-time 43200;     #7200
> >> ddns-update-style none;
> >> authoritative;
> 
> 	...snip...
> 
> >> Save, do a "service dhcpd restart" (it
> should say
> >> OK), then
> >> "tail -f /var/log/messages" and watch
> what is
> >> going on. Restart the clients (one by one if you
> wish to examine /var/log/messages after
> >> each client, otherwise you may restart them all
> simultaneously :-)...).
> >> 
> >> [[ N.B. I suppose you have configured the clients
> to use
> >> dhcp and not have anything statically assigned...
> ]]
> >> 
> >> What should be going on is that the clients in the
> >> classroom ask for IP configuration (dhcp request),
> then dhcpd replies with the
> >> data above (dhcp offer) and then each client
> accepts this offer. If all goes
> >> well, up to this point each client should have a
> 192.168.0.* IP assigned
> >> dynamically, and be able to ping any other client
> with such address, as well as
> >> the server, 192.168.0.1. If this doesn't
> happen, tell us what does
> >> happen.
> 
> 	...snip...
> 
> > 
> > I did as you suggested and I still cannot connect the
> machines to the new server :(
> > 
> Before even trying to connect, after you reload the dhcpd,
> do "netstat -ta" and look to see if the server is
> listening (state LISTEN) on the dhcp port.
> Also "ifconfig eth1" and "netstat -rn"
> so we can be sure you did what people intended you to do.
> 
> > /etc/dhcpd.conf 
> > default-lease-time 21600; #600
> > max-lease-time 43200;     #7200
> > ddns-update-style none;
> > authoritative;
> > 
> > subnet 10.154.19.0 netmask 255.255.255.0 {
> > } # this means don't do anything with the big
> network
> > 
> > subnet 192.168.0.0 netmask 255.255.255.0 {
> > option routers 192.168.0.1;  # your server is the
> router for classroom
> > option subnet-mask 255.255.255.0;  # the mask given to
> classroom
> > option domain-name-servers 10.154.16.130, 10.128.0.4;
> # dns servers
> > range 192.168.0.2 192.168.0.254;  # the pool of
> addresses for classroom
> > }
> > 
> > 
> > [root@localhost ~]# service dhcpd restart
> > Starting dhcpd:                                       
>     [FAILED]
> > [root@localhost ~]# service dhcpd stop
> > [root@localhost ~]# service dhcpd stop
> > [root@localhost ~]# service dhcpd restart
> > Starting dhcpd:                                       
>     [  OK  ]
> > [root@localhost ~]#
> > It starts up but no leases show up, I am trying to
> ping computer from windows 2000 machine and from another
> machine running rawhide
> > 
> > tail -f /var/log/messages  show:
> > 
> > Nov 16 18:51:13 localhost ntpd[2004]: kernel time sync
> status change 4001       Nov 16 18:54:24 localhost dhcpd:
> DHCPREQUEST for 10.154.19.129 from 00:06:5b:4f:d7:d2 via
> eth0: unknown lease 10.154.19.129.                          
>          Nov 16 18:56:32 localhost dhcpd: Internet Systems
> Consortium DHCP Server 4.0.0  Nov 16 18:56:32 localhost
> dhcpd: Copyright 2004-2007 Internet Systems Consortium.     
>                                                             
>             Nov 16 18:56:32 localhost dhcpd: All rights
> reserved.                           Nov 16 18:56:32
> localhost dhcpd: For info, please visit
> http://www.isc.org/sw/dhcp/                                 
>                                            Nov 16 18:56:32
> localhost dhcpd: Not searching LDAP since ldap-server,
> ldap-port and ldap-base-dn were not specified in the config
> file                         Nov 16 18:56:32 localhost
> dhcpd: Wrote 0 leases to leases file.                 Nov 16
> 18:56:32 localhost dhcpd: Listening on
> LPF/eth0/00:0e:a6:42:59:af/10.154.19.0/24                   
>                                                      Nov 16
> 18:56:32 localhost dhcpd: Sending on  
> LPF/eth0/00:0e:a6:42:59:af/10.154.19.0/24                   
>                                                      Nov 16
> 18:56:32 localhost dhcpd: Sending on  
> Socket/fallback/fallback-net      Nov 16 18:56:40 localhost
> dhcpd: Internet Systems Consortium DHCP Server 4.0.0  Nov 16
> 18:56:40 localhost dhcpd: Copyright 2004-2007 Internet
> Systems Consortium.                                         
>                                      Nov 16 18:56:40
> localhost dhcpd: All rights reserved.                       
>    Nov 16 18:56:40 localhost dhcpd: For info, please visit
> http://www.isc.org/sw/dhcp/                                 
>                                            Nov 16 18:56:40
> localhost dhcpd: Not searching LDAP since ldap-server,
> ldap-port and ldap-base-dn were not specified in the config
> file                         Nov 16 18:56:40 localhost
> dhcpd: Wrote 0 leases to leases file.                 Nov 16
> 18:56:40 localhost dhcpd: Listening on
> LPF/eth0/00:0e:a6:42:59:af/10.154.19.0/24                   
>                                                      Nov 16
> 18:56:40 localhost dhcpd: Sending on  
> LPF/eth0/00:0e:a6:42:59:af/10.154.19.0/24                   
>                                                      Nov 16
> 18:56:40 localhost dhcpd: Sending on  
> Socket/fallback/fallback-net
> > Nov 16 19:06:27 localhost dhcpd: DHCPINFORM from
> 10.154.19.33 via eth0
> > Nov 16 19:06:27 localhost dhcpd: DHCPACK to
> 10.154.19.33 (00:0f:1f:86:fc:70) via eth0
> > Nov 16 19:06:30 localhost dhcpd: DHCPINFORM from
> 10.154.19.33 via eth0
> > Nov 16 19:06:30 localhost dhcpd: DHCPACK to
> 10.154.19.33 (00:0f:1f:86:fc:70) via eth0
> > Nov 16 19:12:24 localhost dhcpd: DHCPINFORM from
> 10.154.19.94 via eth0
> > Nov 16 19:12:24 localhost dhcpd: DHCPACK to
> 10.154.19.94 (00:40:f4:ea:ee:d3) via eth0
> > Nov 16 19:12:27 localhost dhcpd: DHCPINFORM from
> 10.154.19.94 via eth0
> > Nov 16 19:12:27 localhost dhcpd: DHCPACK to
> 10.154.19.94 (00:40:f4:ea:ee:d3) via eth0
> > Nov 16 19:12:57 localhost dhcpd: DHCPINFORM from
> 10.154.19.227 via eth0
> > Nov 16 19:12:57 localhost dhcpd: DHCPACK to
> 10.154.19.227 (00:19:b9:2a:19:37) via eth0
> > Nov 16 19:13:01 localhost dhcpd: DHCPINFORM from
> 10.154.19.227 via eth0
> > Nov 16 19:13:01 localhost dhcpd: DHCPACK to
> 10.154.19.227 (00:19:b9:2a:19:37) via eth0
> > 
> > 
> > Thank you all for helping me.  I appreciate all your
> help and advice.
> > 
> > Regards,
> > 
> > 
> > Antonio 
> > 
> >       
> 
> 
> -- Bill Davidsen <davidsen@xxxxxxx>
>   "We have more to fear from the bungling of the
> incompetent than from
> the machinations of the wicked."  - from Slashdot
> 
> -- fedora-list mailing list

Thank you Bill for your suggestions.  I turned off the service, and I manually created /etc/sysconfig/network-scripts/ifcfg-eth1 since it did not exist only eth0 existed and I did not put in anything special only

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
# Ethernet controller: 3Com Corporation 3c905 100BaseTX [Boomerang]
DEVICE=eth1
HWADDR=00:60:97:C5:2A:C3

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# nVidia Corporation nForce2 Ethernet Controller
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:0E:A6:42:59:AF
IPV6_AUTOCONF=yes
ONBOOT=yes
[root@localhost ~]#

dhcpd was off  and this is what I got with the two commands : 

[root@localhost ~]# netstat -ta
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State                                                                               
tcp        0      0 *:sunrpc                    *:*                         LISTEN                                                                              
tcp        0      0 *:ndmp                      *:*                         LISTEN                                                                              
tcp        0      0 localhost.localdomain:ipp   *:*                         LISTEN                                                                              
tcp        0      0 localhost.localdomain:smtp  *:*                         LISTEN                                                                              
tcp        0      0 *:37631                     *:*                         LISTEN                                                                              
tcp        0      0 10.154.19.210:52188         204.2.215.66:http           ESTABLISHED                                                                         
tcp        0      0 10.154.19.210:46831         rover.ebay.com:http         ESTABLISHED                                                                         
tcp        0      0 10.154.19.210:37620         reversed.measat.com:http    ESTABLISHED                                                                         
tcp        0      0 10.154.19.210:40284         reversed.measat.com:https   ESTABLISHED                                                                         
tcp        0      0 10.154.19.210:40287         reversed.measat.com:https   ESTABLISHED                                                                         
tcp        0      0 10.154.19.210:40285         reversed.measat.com:https   ESTABLISHED                                                                         
tcp        0      0 10.154.19.210:40286         reversed.measat.com:https   ESTABLISHED                                                                         
tcp        0      0 10.154.19.210:38418         204.2.215.58:http           ESTABLISHED                                                                         
tcp        0      0 10.154.19.210:50824         204.2.215.19:http           ESTABLISHED                                                                         
tcp        1      0 10.154.19.210:51117         207.123.44.123:http         CLOSE_WAIT                                                                          
tcp        1      0 10.154.19.210:51120         207.123.44.123:http         CLOSE_WAIT                                                                          
tcp        0      0 10.154.19.210:48750         204.2.215.32:http           ESTABLISHED                                                                         
tcp        0      0 10.154.19.210:40283         reversed.measat.com:https   ESTABLISHED                                                                         
tcp        0      0 10.154.19.210:40288         reversed.measat.com:https   ESTABLISHED                                                                         
tcp        0      0 10.154.19.210:52163         204.2.215.66:http           ESTABLISHED                                                                         
tcp        0      0 10.154.19.210:51942         a69.26.188.90.deploy.a:http ESTABLISHED
tcp        0      0 *:sunrpc                    *:*                         LISTEN
[1]+  Done                    gedit /etc/sysconfig/network-scripts/ifcfg-eth1
[root@localhost ~]# ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 00:60:97:C5:2A:C3
          BROADCAST 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.0 b)  TX bytes:0 (0.0 b)
          Interrupt:18 Base address:0xdf00

[root@localhost ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.154.19.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
0.0.0.0         10.154.19.1     0.0.0.0         UG        0 0          0 eth0
[root@localhost ~]#

I will try to restart server and see how that goes:

[root@localhost ~]# service dhcpd status
dhcpd dead but pid file exists
[root@localhost ~]# service dhcpd stop
[root@localhost ~]# service dhcpd start
Starting dhcpd:                                            [  OK  ]


[root@localhost ~]# tail -f /var/log/messages
Nov 17 16:15:01 localhost dhcpd: Wrote 0 leases to leases file.
Nov 17 16:15:01 localhost dhcpd: Listening on LPF/eth0/00:0e:a6:42:59:af/10.154.19.0/24                                                                         
Nov 17 16:15:01 localhost dhcpd: Sending on   LPF/eth0/00:0e:a6:42:59:af/10.154.19.0/24                                                                         
Nov 17 16:15:01 localhost dhcpd: Sending on   Socket/fallback/fallback-net
Nov 17 16:15:01 localhost dhcpd: Can't create PID file /var/run/dhcpd.pid: Permission denied.
Nov 17 16:15:01 localhost kernel: type=1400 audit(1226960101.593:6): avc:  denied  { read } for  pid=10965 comm="dhcpd" name="dhcpd.pid" dev=dm-0 ino=3244614 scontext=unconfined_u:system_r:dhcpd_t:s0 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=file
Nov 17 16:15:01 localhost kernel: type=1400 audit(1226960101.593:7): avc:  denied  { write } for  pid=10965 comm="dhcpd" name="dhcpd.pid" dev=dm-0 ino=3244614 scontext=unconfined_u:system_r:dhcpd_t:s0 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=file
Nov 17 16:15:18 localhost dhcpd: DHCPDISCOVER from 00:06:5b:c6:ce:06 via eth0: network 10.154.19.0/24: no free leases
Nov 17 16:15:21 localhost dhcpd: DHCPDISCOVER from 00:06:5b:c6:ce:06 via eth0: network 10.154.19.0/24: no free leases
Nov 17 16:15:28 localhost dhcpd: DHCPDISCOVER from 00:06:5b:c6:ce:06 via eth0: network 10.154.19.0/24: no free leases
Nov 17 16:15:44 localhost dhcpd: DHCPDISCOVER from 00:06:5b:c6:ce:06 via eth0: network 10.154.19.0/24: no free leases

[olivares@localhost ~]$ cat /etc/sysconfig/dhcpd
DHCPDARGS=

[olivares@localhost ~]$ su -
Password:
[root@localhost ~]# restorecon -v /var/run /var/run/dhcpd.pid
restorecon reset /var/run/dhcpd.pid context unconfined_u:object_r:var_run_t:s0->system_u:object_r:dhcpd_var_run_t:s0

tail -f /var/log/messages

Nov 17 16:15:44 localhost dhcpd: DHCPDISCOVER from 00:06:5b:c6:ce:06 via eth0: network 10.154.19.0/24: no free leases
Nov 17 16:17:57 localhost dhcpd: DHCPINFORM from 10.154.19.79 via eth0
Nov 17 16:17:57 localhost dhcpd: DHCPACK to 10.154.19.79 (00:06:5b:4f:d7:dc) via eth0
Nov 17 16:18:00 localhost dhcpd: DHCPINFORM from 10.154.19.79 via eth0
Nov 17 16:18:00 localhost dhcpd: DHCPACK to 10.154.19.79 (00:06:5b:4f:d7:dc) via eth0
Nov 17 16:18:15 localhost kernel: type=1400 audit(1226960295.233:8): avc:  denied  { read write } for  pid=11094 comm="restorecon" path="socket:[12486]" dev=sockfs ino=12486 scontext=unconfined_u:unconfined_r:setfiles_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=unix_stream_socket


Thanks,

Antonio 


      

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux