Visualizzazione dei risultati da 1 a 8 su 8
  1. #1
    Utente di HTML.it L'avatar di alkat
    Registrato dal
    Jan 2004
    Messaggi
    4,189

    [Debian] configurazione dhcp

    Ciao,
    su un'installazione Debian Testing, la connessione alla rete non avviene automaticamente al boot. O meglio, a volte si connette, a volte no; diciamo che su 10 riavvii del sistema, si connette una volta sola.

    Il PC è collegato a un router tramite cavo di rete dall'interfaccia eth0.

    Se avvio a mano il demone dhcp, mi restituisce questo errore:

    codice:
    debianix:/home/ale# /etc/init.d/dhcp start
    Starting DHCP server: dhcpd failed to start - check syslog for diagnostics.
    Nel syslog, comapre questo:

    codice:
    Nov 14 08:36:14 debianix dhcpd: No subnet declaration for eth0 (192.168.0.3).
    Nov 14 08:36:14 debianix dhcpd: Please write a subnet declaration in your dhcpd.conf file for the
    Nov 14 08:36:14 debianix dhcpd: network segment to which interface eth0 is attached.
    Nov 14 08:36:14 debianix dhcpd: exiting.

    Il messagio è chiaro: dovrei inserire una dichiarazione subnet nel file dhcpd.conf. L'inglese quindi lo capisco, ma non so come cavolo va scritta questa dichiarazione. Qualcuno mi dà una mano?

    Il contenuto del file è attualmente questo:

    codice:
    debianix:/home/ale# cat /etc/dhcpd.conf
    #
    # Sample configuration file for ISC dhcpd for Debian
    #
    # $Id: dhcpd.conf,v 1.4.2.2 2002/07/10 03:50:33 peloy Exp $
    #
    
    # option definitions common to all supported networks...
    option domain-name "fugue.com";
    option domain-name-servers toccata.fugue.com;
    
    option subnet-mask 255.255.255.224;
    default-lease-time 600;
    max-lease-time 7200;
    
    #subnet 204.254.239.0 netmask 255.255.255.224 {
    #  range 204.254.239.10 204.254.239.20;
    #  option broadcast-address 204.254.239.31;
    #  option routers prelude.fugue.com;
    #}
    
    # The other subnet that shares this physical network
    #subnet 204.254.239.32 netmask 255.255.255.224 {
    #  range dynamic-bootp 204.254.239.10 204.254.239.20;
    #  option broadcast-address 204.254.239.31;
    #  option routers snarg.fugue.com;
    #}
    
    #subnet 192.5.5.0 netmask 255.255.255.224 {
    #  range 192.5.5.26 192.5.5.30;
    #  option name-servers bb.home.vix.com, gw.home.vix.com;
    #  option domain-name "vix.com";
    #  option routers 192.5.5.1;
    #  option subnet-mask 255.255.255.224;
    #  option broadcast-address 192.5.5.31;
    #  default-lease-time 600;
    #  max-lease-time 7200;
    #}
    
    # Hosts which require special configuration options can be listed in
    # host statements.   If no address is specified, the address will be
    # allocated dynamically (if possible), but the host-specific information
    # will still come from the host declaration.
    
    #host passacaglia {
    #  hardware ethernet 0:0:c0:5d:bd:95;
    #  filename "vmunix.passacaglia";
    #  server-name "toccata.fugue.com";
    #}
    
    # Fixed IP addresses can also be specified for hosts.   These addresses
    # should not also be listed as being available for dynamic assignment.
    # Hosts for which fixed IP addresses have been specified can boot using
    # BOOTP or DHCP.   Hosts for which no fixed address is specified can only
    # be booted with DHCP, unless there is an address range on the subnet
    # to which a BOOTP client is connected which has the dynamic-bootp flag
    # set.
    #host fantasia {
    #  hardware ethernet 08:00:07:26:c0:a5;
    #  fixed-address fantasia.fugue.com;
    #}
    
    # If a DHCP or BOOTP client is mobile and might be connected to a variety
    # of networks, more than one fixed address for that host can be specified.
    # Hosts can have fixed addresses on some networks, but receive dynamically
    # allocated address on other subnets; in order to support this, a host
    # declaration for that client must be given which does not have a fixed
    # address.   If a client should get different parameters depending on
    # what subnet it boots on, host declarations for each such network should
    # be given.   Finally, if a domain name is given for a host's fixed address
    # and that domain name evaluates to more than one address, the address
    # corresponding to the network to which the client is attached, if any,
    # will be assigned.
    #host confusia {
    #  hardware ethernet 02:03:04:05:06:07;
    #  fixed-address confusia-1.fugue.com, confusia-2.fugue.com;
    #  filename "vmunix.confusia";
    #  server-name "toccata.fugue.com";
    #}
    
    #host confusia {
    #  hardware ethernet 02:03:04:05:06:07;
    #  fixed-address confusia-3.fugue.com;
    #  filename "vmunix.confusia";
    #  server-name "snarg.fugue.com";
    #}
    
    #host confusia {
    #  hardware ethernet 02:03:04:05:06:07;
    #  filename "vmunix.confusia";
    #  server-name "bb.home.vix.com";
    #}
    Grazie,
    .a.
    Passa a Windows, Linux, Mac, BSD, Atari, Amiga, Unix o alle schede perforate. Fa come ti pare.
    ***
    "There's probably no God. Now stop worrying and enjoy your life" - Atheist Bus in England

  2. #2
    Utente di HTML.it L'avatar di Darrol
    Registrato dal
    Feb 2004
    Messaggi
    235
    Non ho capito se vuoi fare da server per il dhcp, o da client (se vuoi assegnare indirizzi ip ad altre macchine, o vuoi l'indirizzo ip per la tua macchina impostato automaticamente)

  3. #3
    Utente di HTML.it L'avatar di alkat
    Registrato dal
    Jan 2004
    Messaggi
    4,189
    Originariamente inviato da Darrol
    Non ho capito se vuoi fare da server per il dhcp, o da client (se vuoi assegnare indirizzi ip ad altre macchine, o vuoi l'indirizzo ip per la tua macchina impostato automaticamente)
    Semplicemente vorrei che al mio sistema venisse assegnato automaticamente l'IP dal router.

    Il router fa da dhcp server e assegna al PC fisso su cui ho Ubuntu l'IP 192.168.0.2 e vorrei che al portatile su cui ho Debian (e i problemi descritti sopra) assegnasse il 192.168.0.3.

    Il router è già configurato a dovere e infatti assegna correttamente gli IP desiderati sia al PC con Ubuntu sia al telefono VoIP. Fino a qualche giorno fa sul portatile avevo Ubuntu e poi Fedora e anche lì non ho mai avuto problemi con la connessione alla rete. Prima ancora avevo Debian e anche allora tutto funzionava perfettamente. È con quest'ultima installazione di Debian Etch che le cose non vanno come dovrebbero (a dire il vero, non sono mai riuscito a connettermi nemmeno con Mandriva 2007, ma imputavo il problema a Mandriva).
    Passa a Windows, Linux, Mac, BSD, Atari, Amiga, Unix o alle schede perforate. Fa come ti pare.
    ***
    "There's probably no God. Now stop worrying and enjoy your life" - Atheist Bus in England

  4. #4
    Utente di HTML.it L'avatar di Darrol
    Registrato dal
    Feb 2004
    Messaggi
    235
    Ok,

    stavi usando il comando per usare il tuo pc come server dhcp.

    Per farti assegnare un indirizzo ip prova con dhclient

  5. #5
    Utente di HTML.it L'avatar di alkat
    Registrato dal
    Jan 2004
    Messaggi
    4,189
    Originariamente inviato da Darrol
    Ok,

    stavi usando il comando per usare il tuo pc come server dhcp.

    Per farti assegnare un indirizzo ip prova con dhclient
    Sì, questo lo sapevo: ora sono online con Debian e ho lanciato la connessione con il comando dhclient

    codice:
    debianix:/home/ale# dhclient
    Internet Systems Consortium DHCP Client V3.0.4
    Copyright 2004-2006 Internet Systems Consortium.
    All rights reserved.
    For info, please visit http://www.isc.org/sw/dhcp/
    
    Listening on LPF/eth1/
    Sending on   LPF/eth1/
    Listening on LPF/eth0/00:0b:cd:34:a1:db
    Sending on   LPF/eth0/00:0b:cd:34:a1:db
    Sending on   Socket/fallback
    DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 7
    DHCPREQUEST on eth0 to 255.255.255.255 port 67
    DHCPACK from 192.168.0.1
    bound to 192.168.0.3 -- renewal in 42873 seconds.
    Il fatto è che io vorrei che la connessione venisse stabilita al boot per non dover lanciare ogni volta il comando dhclient.

    .a.
    Passa a Windows, Linux, Mac, BSD, Atari, Amiga, Unix o alle schede perforate. Fa come ti pare.
    ***
    "There's probably no God. Now stop worrying and enjoy your life" - Atheist Bus in England

  6. #6
    Utente di HTML.it L'avatar di Darrol
    Registrato dal
    Feb 2004
    Messaggi
    235
    10.6.2 Configurare un'interfaccia con DHCP

    per configurare un'interfaccia con DHCP, modificate /etc/network/interfaces in maniera che comprenda una serie di righe come questa:

    iface eth0 inet dhcp

    Affinchè funzioni doverete avere installato uno dei client DHCP menzionati in Configurare le interfacce di rete con DHCP, Sezione 10.5.
    Fonte

  7. #7
    Utente di HTML.it L'avatar di alkat
    Registrato dal
    Jan 2004
    Messaggi
    4,189
    Mi sembra sia già configurato correttamente:

    codice:
    # cat /etc/network/interfaces
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    allow-hotplug eth0
    iface eth0 inet dhcp

    Vabbe', ora devo uscire. Forse domani ci riprovo.

    Grazie Darrol.
    .a.
    Passa a Windows, Linux, Mac, BSD, Atari, Amiga, Unix o alle schede perforate. Fa come ti pare.
    ***
    "There's probably no God. Now stop worrying and enjoy your life" - Atheist Bus in England

  8. #8
    Sempre a proposito di DHCP client, dove lavoro io i pc usano il DHCP per avere un indirizzo IP dopo la fase di boot. Accade pero' che ad esempio i PC del primo piano ricevano un IP della subnet x, quelli del secondo piano ricevono IP della subnet y, ecc.
    Come fa il DHCP server a sapere da quale piano proviene la richiesta? Presumo che tale lavoro venga fatto anche dallo switch Cisco, che riesce a gestire la VLan. Ho sentito poi parlare di dhcp relay, e' una cosa fattibile anche con Linux e come funziona esattamente?
    Grazie.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.