Activar DHCP & DNS


(Ricardo Cortes) #1

Hola,
Me podrían ayuda dar brindándome información de como activar el DHCP server, he estado intentando y me esta presentado bastante problemas.


(Ben Bullard) #2

Necesitaremos una mejor descripción del problema. ¿Que estás tratando de hacer? ¿Cómo estás tratando de hacerlo? También danos cierta información de hardware como esta Konsole abierta y publica (como código </>) toda la producción de:

$ inxi -F

Para la mayoría de las personas en Internet OpenMandriva funciona de la caja. Obviamente, si tienes wifi, debes decirle a NetworkManager la contraseña wifi.

Translated from this English writing: We’ll need a better description of the problem. What are you trying to do? How are you trying to do it? Also give us some hardware info like this open Konsole and post (as code </>) entire output of:

$ inxi -F

For most people in OpenMandriva Internet works out of the box. Obviously if you have wifi you have to tell NetworkManager the wifi password.


(Ben Bullard) #3

Además, ¿qué versión de OpenMandriva instaló y qué escritorio está tratando de usar?
¿Esta instancia está en hardware o en VirtualBox?

Also what version of OpenMandriva did you install and what desktop are you trying to use?
Is this instance on hardware or in VirtualBox?


(Ricardo Cortes) #4

Hola,
estoy utilizando la versión de Openmandriva Lx 3.03, la instancia esta en una VirtualBox.

La activación de Server DHCP la estoy haciendo a través de una Konsola.

y me esta presentado el siguiente error:
Agrego una captura del error.


(Ben Bullard) #5

Pero, ¿por qué tienes que hacer eso? Para qué sirve? No está instalado en Lx 3 de manera predeterminada de lo que estoy enterado.

$ systemctl status dhcpd
Unit dhcpd.service could not be found.

Si está intentando conectarse a Internet, no es así.

But why do you need to do that? What is it for? It is not installed on Lx 3 by default that I am aware of.

$ systemctl status dhcpd
Unit dhcpd.service could not be found.

If you are trying to connect to the Internet that isn’t how.


(Ben Bullard) #6

De todos modos, el mensaje de error que publicó parece que dhcpd.service no se iniciará porque no está configurado, por lo tanto, no puede iniciarse.

FWIW: en OpenMandriva, el servicio de red Lx 3 está controlado de forma predeterminada por NetworkManager

$ systemctl status NetworkManager.service
● NetworkManager.service - Network Manager
   Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/NetworkManager.service.d
           └─NetworkManager-ovs.conf
   Active: active (running) since Wed 2018-04-11 12:20:37 CDT; 8h ago
     Docs: man:NetworkManager(8)
 Main PID: 4067 (NetworkManager)
    Tasks: 3 (limit: 4915)
   Memory: 10.8M
   CGroup: /system.slice/NetworkManager.service
           └─4067 /usr/sbin/NetworkManager --no-daemon

Apr 11 18:35:32 ben79-pc NetworkManager[4067]: <info>  [1523489732.3999] dhcp4 (enp3s0):   expires in 7200 seconds
Apr 11 18:35:32 ben79-pc NetworkManager[4067]: <info>  [1523489732.4000] dhcp4 (enp3s0):   nameserver '192.168.0.1'
Apr 11 18:35:32 ben79-pc NetworkManager[4067]: <info>  [1523489732.4000] dhcp4 (enp3s0):   gateway 192.168.0.1
Apr 11 18:35:32 ben79-pc NetworkManager[4067]: <info>  [1523489732.4001] dhcp4 (enp3s0): state changed bound -> bound
Apr 11 20:20:30 ben79-pc NetworkManager[4067]: <info>  [1523496030.4029] dhcp4 (enp3s0):   address 192.168.0.102
Apr 11 20:20:30 ben79-pc NetworkManager[4067]: <info>  [1523496030.4030] dhcp4 (enp3s0):   plen 24
Apr 11 20:20:30 ben79-pc NetworkManager[4067]: <info>  [1523496030.4030] dhcp4 (enp3s0):   expires in 7200 seconds
Apr 11 20:20:30 ben79-pc NetworkManager[4067]: <info>  [1523496030.4030] dhcp4 (enp3s0):   nameserver '192.168.0.1'
Apr 11 20:20:30 ben79-pc NetworkManager[4067]: <info>  [1523496030.4030] dhcp4 (enp3s0):   gateway 192.168.0.1
Apr 11 20:20:30 ben79-pc NetworkManager[4067]: <info>  [1523496030.4032] dhcp4 (enp3s0): state changed bound -> bound

Así que sin saber por qué necesitarías dhcpd (especialmente en VBox) no hay mucho que pueda hacer para ayudar. Estoy bastante seguro de que tiene que estar configurado para funcionar.

Anyway, the error message you posted looks like dhcpd.service won’t start because it isn’t configured hence it can’t start.

FWIW: In OpenMandriva Lx 3 network service is controlled by default by NetworkManager

$ systemctl status NetworkManager.service
● NetworkManager.service - Network Manager
   Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/NetworkManager.service.d
           └─NetworkManager-ovs.conf
   Active: active (running) since Wed 2018-04-11 12:20:37 CDT; 8h ago
     Docs: man:NetworkManager(8)
 Main PID: 4067 (NetworkManager)
    Tasks: 3 (limit: 4915)
   Memory: 10.8M
   CGroup: /system.slice/NetworkManager.service
           └─4067 /usr/sbin/NetworkManager --no-daemon

Apr 11 18:35:32 ben79-pc NetworkManager[4067]: <info>  [1523489732.3999] dhcp4 (enp3s0):   expires in 7200 seconds
Apr 11 18:35:32 ben79-pc NetworkManager[4067]: <info>  [1523489732.4000] dhcp4 (enp3s0):   nameserver '192.168.0.1'
Apr 11 18:35:32 ben79-pc NetworkManager[4067]: <info>  [1523489732.4000] dhcp4 (enp3s0):   gateway 192.168.0.1
Apr 11 18:35:32 ben79-pc NetworkManager[4067]: <info>  [1523489732.4001] dhcp4 (enp3s0): state changed bound -> bound
Apr 11 20:20:30 ben79-pc NetworkManager[4067]: <info>  [1523496030.4029] dhcp4 (enp3s0):   address 192.168.0.102
Apr 11 20:20:30 ben79-pc NetworkManager[4067]: <info>  [1523496030.4030] dhcp4 (enp3s0):   plen 24
Apr 11 20:20:30 ben79-pc NetworkManager[4067]: <info>  [1523496030.4030] dhcp4 (enp3s0):   expires in 7200 seconds
Apr 11 20:20:30 ben79-pc NetworkManager[4067]: <info>  [1523496030.4030] dhcp4 (enp3s0):   nameserver '192.168.0.1'
Apr 11 20:20:30 ben79-pc NetworkManager[4067]: <info>  [1523496030.4030] dhcp4 (enp3s0):   gateway 192.168.0.1
Apr 11 20:20:30 ben79-pc NetworkManager[4067]: <info>  [1523496030.4032] dhcp4 (enp3s0): state changed bound -> bound

So without know why you would need dhcpd (especially in VBox) there is not much I can do to help. I am pretty sure it has to be configured to work.


(Ricardo Cortes) #7

Lo que necesito es activar el DHCP server y el DNS,

los códigos que estaba utilizando son:

lo estoy utilizando para instalarlo

  1. urpmi dhcp-server

pero lo que necesito es activarlo, pero no se cual es el proceso a seguir.


(Ben Bullard) #8

¿Qué comando usó para obtener la salida en la captura de pantalla? ¿Qué comandos has probado?

What command did you use to get the output in the screen-shot? What commands have you tried?


(Ben Bullard) #9

No hay problema para comenzar aquí:

# systemctl start dhcpd.service

# systemctl status dhcpd.service
● dhcpd.service - DHCPv4 Server Daemon
   Loaded: loaded (/lib/systemd/system/dhcpd.service; disabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-04-11 21:11:48 CDT; 11s ago
     Docs: man:dhcpd(8)
           man:dhcpd.conf(5)
 Main PID: 3627 (dhcpd)
   Status: "Dispatching packets..."                                                                                                                                        
    Tasks: 1 (limit: 4655)                                                                                                                                                 
   Memory: 2.6M                                                                                                                                                            
   CGroup: /system.slice/dhcpd.service                                                                                                                                     
           └─3627 /usr/sbin/dhcpd -f -cf /etc/dhcpd.conf --no-pid -lf /var/lib/dhcpd/dhcpd.leases -q                                                                       
                                                                                                                                                                           
Apr 11 21:11:48 ben79-pc systemd[1]: Starting DHCPv4 Server Daemon...                                                                                                      
Apr 11 21:11:48 ben79-pc dhcpd[3627]: WARNING: Host declarations are global.  They are not limited to the scope you declared them in.                                      
Apr 11 21:11:48 ben79-pc dhcpd[3627]: ldap_gssapi_principal is not set,GSSAPI Authentication for LDAP will not be used                                                     
Apr 11 21:11:48 ben79-pc dhcpd[3627]: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file                               
Apr 11 21:11:48 ben79-pc dhcpd[3627]: Source compiled to use binary-leases                                                                                                 
Apr 11 21:11:48 ben79-pc dhcpd[3627]: Wrote 0 deleted host decls to leases file.                                                                                           
Apr 11 21:11:48 ben79-pc dhcpd[3627]: Wrote 0 new dynamic host decls to leases file.                                                                                       
Apr 11 21:11:48 ben79-pc dhcpd[3627]: Wrote 0 leases to leases file.                                                                                                       
Apr 11 21:11:48 ben79-pc dhcpd[3627]: Server starting service.                                                                                                             
Apr 11 21:11:48 ben79-pc systemd[1]: Started DHCPv4 Server Daemon.

(Ben Bullard) #10

Consejo útil: podría ahorrarse mucho tiempo con una búsqueda en Internet sobre problemas como ese.

Helpful hint: You could save yourself a lot of time with an Internet search on problems like that.

https://wiki.archlinux.org/index.php/Dhcpd

https://wiki.archlinux.org/index.php/Systemd#Using_units

Editar: los encontré buscando: "Linux dhcpd"
Edit: found those by searching “Linux dhcpd”


(Ricardo Cortes) #11

Lo que quiero hacer es lo que se detalla en el video:


(Ben Bullard) #12

Si el video no está en inglés, me perderé.
If the Video is not in English I’ll be lost.


(Ricardo Cortes) #13

el video esta en ingles


(Ben Bullard) #14

Señor, ten piedad de cuántos años tiene ese video? Es un viejo video de Mandriva. El sistema operativo es Mandriva versión 2010. Es 2018. Por lo tanto, ese video no va a ser compatible con OM Lx 3 realmente no tiene sentido intentarlo. A menos que me falta algo, parece que está haciendo un montón de cosas manualmente que ahora se hace automáticamente (y dinámicamente). ¡No me extraña que hayas tenido problemas!

No significa que no puedas hacer lo que sea que estás tratando de hacer, pero tendrás que hablar con un desarrollador para que te ayude a superarlo.

Lord have mercy how old is that video? It’s an old Mandriva video. The operating system is Mandriva version 2010. It’s 2018. So that Video is not going to be compatible with OM Lx 3 really no point in trying. Unless I’m missing something it looks like he is doing a bunch of stuff manually that now a days is done automatically (and dynamically). No wonder you’ve been having problems!

Doesn’t mean you can’t do whatever it is you are trying to do but you’ll need to talk to a developer to walk you through it.


(Ben Bullard) #15

Los desarrolladores se pueden encontrar en #openmandriva-cooker en Freenode IRC.

Developers can be found at #openmandriva-cooker at Freenode IRC.

Editar: En #openmandriva-cooker tal vez deberías pedir ‘itchka’ aka @Colin.
Edit: On #openmandriva-cooker maybe you should ask for ‘itchka’ aka @Colin.


#16

Lo siento, no hablo español.
Probablemente, el problema proviene del archivo de configuración predeterminado (/etc/dhcpd.conf).
Mi sesión :
[instalación]

$ su -
# urpmi dhcp-server
http://abf-downloads.openmandriva.org/3.0/repository/x86_64/media/main/updates/dhcp-server-4.3.5-3-omv2015.0.x86_64.rpm
installation de dhcp-server-4.3.5-3-omv2015.0.x86_64.rpm depuis /var/cache/urpmi/rpms
Préparation… ###############################################################################################################################################################################
1/1: dhcp-server ###############################################################################################################################################################################

[falla el inicio del servicio]

# systemctl status dhcpd
● dhcpd.service - DHCPv4 Server Daemon
Loaded: loaded (/lib/systemd/system/dhcpd.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:dhcpd(8)
man:dhcpd.conf(5)
[root@jcl-asus ~]# systemctl start dhcpd
Job for dhcpd.service failed because the control process exited with error code.
See “systemctl status dhcpd.service” and “journalctl -xe” for details.

# systemctl status dhcpd
● dhcpd.service - DHCPv4 Server Daemon
Loaded: loaded (/lib/systemd/system/dhcpd.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2018-04-12 11:13:58 CEST; 8s ago
Docs: man:dhcpd(8)
man:dhcpd.conf(5)
Process: 10903 ExecStart=/usr/sbin/dhcpd -f -cf $CONFIGFILE --no-pid -lf $LEASEFILE $OPTIONS $INTERFACES (code=exited, status=1/FAILURE)
Main PID: 10903 (code=exited, status=1/FAILURE)

avril 12 11:13:58 jcl-asus dhcpd[10903]: If you think you have received this message due to a bug rather
avril 12 11:13:58 jcl-asus dhcpd[10903]: than a configuration issue please read the section on submitting
avril 12 11:13:58 jcl-asus dhcpd[10903]: bugs on either our web page at www.isc.org or in the README file
avril 12 11:13:58 jcl-asus dhcpd[10903]: before submitting a bug. These pages explain the proper
avril 12 11:13:58 jcl-asus dhcpd[10903]: process and the information we find helpful for debugging…
avril 12 11:13:58 jcl-asus dhcpd[10903]:
avril 12 11:13:58 jcl-asus dhcpd[10903]: exiting.
avril 12 11:13:58 jcl-asus systemd[1]: dhcpd.service: Main process exited, code=exited, status=1/FAILURE
avril 12 11:13:58 jcl-asus systemd[1]: dhcpd.service: Failed with result ‘exit-code’.
avril 12 11:13:58 jcl-asus systemd[1]: Failed to start DHCPv4 Server Daemon.

[prueba de archivo de configuración]

# dhcpd -t
Internet Systems Consortium DHCP Server 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
WARNING: Host declarations are global. They are not limited to the scope you declared them in.
ldap_gssapi_principal is not set,GSSAPI Authentication for LDAP will not be used
Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Config file: /etc/dhcpd.conf
Database file: /var/lib/dhcpd/dhcpd.leases
PID file: /run/dhcpd/dhcpd.pid
Source compiled to use binary-leases

[arranque manual en modo debug]

# dhcpd -d
Internet Systems Consortium DHCP Server 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
WARNING: Host declarations are global. They are not limited to the scope you declared them in.
ldap_gssapi_principal is not set,GSSAPI Authentication for LDAP will not be used
Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Config file: /etc/dhcpd.conf
Database file: /var/lib/dhcpd/dhcpd.leases
PID file: /run/dhcpd/dhcpd.pid
Source compiled to use binary-leases
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 0 leases to leases file.

No subnet declaration for wlp2s0 (192.168.1.61).
** Ignoring requests on wlp2s0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface wlp2s0 is attached. **

Not configured to listen on any interfaces!

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug. These pages explain the proper
process and the information we find helpful for debugging…

Así que modifiqué el archivo de configuración para que coincidiera con la configuración de mi red :
# cat /etc/dhcpd.conf
> ddns-update-style none;
> subnet 192.168.1.0 netmask 255.255.255.0 {
> # default gateway
> option routers 192.168.1.1;
> option subnet-mask 255.255.255.0;
>
> option domain-name “mydomain.localdomain”;
>
> # Seting up an ip address is better here
> option domain-name-servers ns.mydomain.localdomain;
> option nis-domain “mydomain.localdomain”;
>
> range dynamic-bootp 192.168.1.128 192.168.1.200;
> default-lease-time 21600;
> max-lease-time 43200;
>
> # we want the nameserver to appear at a fixed address
> host ns {
> next-server fixed.mydomain.localdomain;
> hardware ethernet 12:34:56:78:AB:CD;
> fixed-address 192.168.1.61;
> }
> }

He resaltado los parámetros que deben ser cambiados al mínimo y adaptados a la situación real.
Por supuesto, un servidor dhcp en un entorno real necesita ser configurado más completamente.