Um dos grandes problemas que se enfrenta quando se tenta arrancar a daemon dhcp (dhcpd) no fedora 10 é que de facto o serviço nao arranca mesmo com um /etc/dhcpd.conf decente. Por exemplo comigo:
[aluno@localhost ~]$ su
Password:
[root@localhost aluno]# service dhcpd start
Starting dhcpd: [FAILED]
Na realidade a solução é muito simples e passa por atribuir um endereço estatico a interface. Endereço este que terá de pertencer a mesma faixa de endereços usados pelo /etc/dhcpd.conf
Um reconhecimento das interfaces:
[root@localhost aluno]# ifconfig
eth1 Link encap:Ethernet HWaddr 00:19:BB:47:A1:96
inet addr:172.16.1.XX Bcast:172.16.1.255 Mask:255.255.255.0
inet6 addr: fe80::219:bbff:fe47:a196/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:19917 errors:0 dropped:0 overruns:0 frame:0
TX packets:9599 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9979478 (9.5 MiB) TX bytes:794179 (775.5 KiB)
Interrupt:17lo 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:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:800 (800.0 b) TX bytes:800 (800.0 b)
Atribuir o endereço 192.168.0.1 a interface eth1:
[root@localhost aluno]# ifconfig eth1 inet 192.168.0.1
Reconhecer novamente as interfaces:
[root@localhost aluno]# ifconfig
eth1 Link encap:Ethernet HWaddr 00:19:BB:47:A1:96
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::219:bbff:fe47:a196/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:20271 errors:0 dropped:0 overruns:0 frame:0
TX packets:9706 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10036841 (9.5 MiB) TX bytes:810904 (791.8 KiB)
Interrupt:17lo 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:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:800 (800.0 b) TX bytes:800 (800.0 b)
Arrancar o serviço DHCPD:
[root@localhost aluno]# service dhcpd start
Starting dhcpd: [ OK ]
Agora funcionou.
Parar o serviço DHCPD:
[root@localhost aluno]# service dhcpd stop
Shutting down dhcpd: [ OK ]
o Seguinte /etc/dhcpd.conf foi usado:
option domain-name “internal”;
option domain-name-servers 172.16.1.20;
option routers 192.168.0.1;
ddns-update-style none;default-lease-time 600;
max-lease-time 7200;subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.1 192.168.0.25;
}host snnangola
{ hardware ethernet 00:00:00:00:00:00;
fixed-address 192.168.0.2;
option routers 192.168.0.1;}
obs: 172.16.1.20 (servidor dns).