View previous topic :: View next topic |
Author |
Message |
dmorab Apprentice
Joined: 29 Aug 2003 Posts: 210
|
Posted: Mon Aug 14, 2006 12:31 pm Post subject: [Risolto] problema con router, /etc/hosts, /etc/resolv.conf |
|
|
Dopo qualche aggiornamento del sistema, qualche emerging e unmerging, mi sono trovato con un problema di rete:
ho un router Dlink con indirizzo 192.168.17.1, la mia gentoo-box ah indirizzo di rete 192.168.17.3, ed attualmente un ibook con indirizzo 192.168.17.2. Non uso dhcp ma indirizzi statici, questa è la configurazione di /etc/conf.d/net:
Code: |
# For a static configuration, use something like this
# (They all do exactly the same thing btw)
#config_eth0=( "192.168.0.2/24" )
#config_eth0=( "192.168.17.3 netmask 255.255.255.0" )
# We can also specify a broadcast
#config_eth0=( "192.168.0.2/24 brd 192.168.0.255" )
config_eth0=( "192.168.17.3 netmask 255.255.255.0 broadcast 192.168.17.255" )
..........................
# Here's how todo routing if you need it
routes_eth0=(
"default via 192.168.17.1" # IPv4 default route
# "10.0.0.0/8 via 192.168.0.1" # IPv4 subnet route
# "::/0" # IPv6 unicast
)
|
questo il mio /etc/hosts
Code: |
# /etc/hosts: This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server. Just add the names, addresses
# and any aliases to this file...
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/hosts,v 1.7 2002/11/18 19:39:22 azarah Exp $
#
127.0.0.1 gentoo localhost
192.168.17.3 gentoo
192.168.17.2 macosx
|
questo il mio /etc/resolv.conf
Code: |
nameserver 212.216.112.112
nameserver 212.216.172.62
|
Il problema è che non è possibile risolvere i nomi macchina contenuti nel /etc/hosts:
dalla macchina gentoo
Code: |
$ ping 192.168.17.1
PING 192.168.17.1 (192.168.17.1) 56(84) bytes of data.
64 bytes from 192.168.17.1: icmp_seq=1 ttl=255 time=4.01 ms
64 bytes from 192.168.17.1: icmp_seq=2 ttl=255 time=0.693 ms
64 bytes from 192.168.17.1: icmp_seq=3 ttl=255 time=0.670 ms
64 bytes from 192.168.17.1: icmp_seq=4 ttl=255 time=0.712 ms
64 bytes from 192.168.17.1: icmp_seq=5 ttl=255 time=0.676 ms
|
funziona tutto anche ping 192.168.17.3, ping 192.168.17.2 o ping www.google.com
ma
Code: |
# ping gentoo
ping: unknown host gentoo
# ping macosx
ping: unknown host macosx
|
tanto che non si avvia neanche proftpd
Code: |
# /etc/init.d/proftpd start
* Starting proftpd ...
- getaddrinfo 'gentoo' error: Name or service not known
- warning: unable to determine IP address of 'gentoo'
|
il solo modo per risolvere i nomi macchina è
o non inserire niente nel /etc/resolv.conf, e così non mi risolve i siti esterni alla rete, oppure disabilitare il router, peggio che mai.
Probabilmente sarà la classica sciocchezza ma ci sto sbattendo la testa senza vederla!
Last edited by dmorab on Wed Aug 16, 2006 5:43 am; edited 2 times in total |
|
Back to top |
|
|
Deus Ex Guru
Joined: 16 Nov 2005 Posts: 489 Location: Patavium
|
Posted: Mon Aug 14, 2006 2:29 pm Post subject: |
|
|
Ma /etc/hosts non andava così
Code: | 127.0.0.1 localhost
|
o al massimo
Code: | 127.0.0.1 fully-qualified-hostname aliases localhost |
? _________________ Deus Ex
--
L’inflazione che caccia nelle mani dell’individuo, in un gesto solo, miliardi di marchi, lasciandolo più miserabile di prima, dimostra punto per punto che il denaro è un’allucinazione collettiva. |
|
Back to top |
|
|
dmorab Apprentice
Joined: 29 Aug 2003 Posts: 210
|
Posted: Mon Aug 14, 2006 2:47 pm Post subject: |
|
|
Deus Ex wrote: | Ma /etc/hosts non andava così?
127.0.0.1 localhost
|
già provato e non sortisce effetto.
Ma poi, con /etc/hosts così realizzato come farebbe a risolvere i nomui macchina presenti nella LAN? |
|
Back to top |
|
|
Deus Ex Guru
Joined: 16 Nov 2005 Posts: 489 Location: Patavium
|
Posted: Mon Aug 14, 2006 3:19 pm Post subject: |
|
|
In effetti mi riferivo al semplice localhost.
E' chiaro che poi per risolvere gli altri host devi inserire anche quelli _________________ Deus Ex
--
L’inflazione che caccia nelle mani dell’individuo, in un gesto solo, miliardi di marchi, lasciandolo più miserabile di prima, dimostra punto per punto che il denaro è un’allucinazione collettiva. |
|
Back to top |
|
|
dmorab Apprentice
Joined: 29 Aug 2003 Posts: 210
|
Posted: Mon Aug 14, 2006 3:49 pm Post subject: |
|
|
Non credo che possa essere la causa dei problemi ma mi sono accorto che lo script /etc/init.d/domainname non esiste più nella mia gentoo-box. Non voglio definire il domainname ma la sparizione dello script non mi sembra normale. Come si fa a ripristinarlo? |
|
Back to top |
|
|
bandreabis Advocate
Joined: 18 Feb 2005 Posts: 2495 Location: イタリアのロディで
|
Posted: Mon Aug 14, 2006 4:26 pm Post subject: |
|
|
Non credo serva più con il nuovo baselayout.
Userei Code: | 127.0.0.1 localhost
192.168.17.3 gentoo gentoo
192.168.17.2 macosx macosx |
_________________ Il numero di post non fa di me un esperto! Anzi! |
|
Back to top |
|
|
dmorab Apprentice
Joined: 29 Aug 2003 Posts: 210
|
Posted: Mon Aug 14, 2006 5:31 pm Post subject: |
|
|
bandreabis wrote: | Non credo serva più con il nuovo baselayout. |
è vero, già verificato
Quote: | Userei Code: | 127.0.0.1 localhost
192.168.17.3 gentoo gentoo
192.168.17.2 macosx macosx |
|
questo, invece, purtroppo non funziona |
|
Back to top |
|
|
bandreabis Advocate
Joined: 18 Feb 2005 Posts: 2495 Location: イタリアのロディで
|
Posted: Mon Aug 14, 2006 5:34 pm Post subject: |
|
|
Io a dire il vero ho:
Code: | 127.0.0.1 localhost
192.168.17.3 gentoo.WORKGROUP gentoo
192.168.17.2 macosx.WORKGROUP macosx |
_________________ Il numero di post non fa di me un esperto! Anzi! |
|
Back to top |
|
|
dmorab Apprentice
Joined: 29 Aug 2003 Posts: 210
|
Posted: Mon Aug 14, 2006 6:34 pm Post subject: |
|
|
bandreabis wrote: | Io a dire il vero ho:
Code: | 127.0.0.1 localhost
192.168.17.3 gentoo.WORKGROUP gentoo
192.168.17.2 macosx.WORKGROUP macosx |
|
Io non ho impostato il domainname, anche perchè qual è l'utilità? |
|
Back to top |
|
|
bandreabis Advocate
Joined: 18 Feb 2005 Posts: 2495 Location: イタリアのロディで
|
Posted: Mon Aug 14, 2006 7:54 pm Post subject: |
|
|
Credo che serva per far vedere i Pc all'interno del DNSDOMAIN. _________________ Il numero di post non fa di me un esperto! Anzi! |
|
Back to top |
|
|
wilma_dammi_la_clava n00b
Joined: 07 Jul 2006 Posts: 64
|
Posted: Tue Aug 15, 2006 8:45 am Post subject: |
|
|
127.0.0.1 localhost
192.168.0.250 server
192.168.0.252 doom
192.168.0.253 server1
192.168.0.1 reception01
192.168.0.2 reception02
192.168.0.3 reception03
192.168.0.4 elisa
# IPV6 versions of localhost and co
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
[/quote]
il mio hosts è così e i nomi vengono risolti ... _________________ errare è umano ....ma per fare veramente casino ci vuole la password di ROOT!!!!!!!! |
|
Back to top |
|
|
randomaze Bodhisattva
Joined: 21 Oct 2003 Posts: 9985
|
Posted: Tue Aug 15, 2006 9:18 am Post subject: Re: Rete: problema con router, /etc/hosts, /etc/resolv.conf |
|
|
dmorab wrote: | questo il mio /etc/resolv.conf
Code: | nameserver 212.216.112.112
nameserver 212.216.172.62 |
|
Prova ad aggiungere in quel file la linea:
P.S. Hai notato che il tuo post iniziale é molto piú leggibile grazie all'aggiunta di un poco di BBCode? _________________ Ciao da me! |
|
Back to top |
|
|
^Stefano^ Guru
Joined: 20 Nov 2005 Posts: 394 Location: Ferrara
|
Posted: Tue Aug 15, 2006 10:27 am Post subject: |
|
|
se può essere d'aiuto posto i miei file:
Code: | /etc/conf.d/hostname
# /etc/conf.d/hostname
# Set to the hostname of this machine
HOSTNAME="blueyes" |
Code: | /etc/resolv.conf
nameserver 85.37.17.52
nameserver 85.38.28.92
domain localdomain |
Code: | /etc/hosts
127.0.0.1 localhost
192.168.0.2 blueyes.localdomain blueyes
192.168.0.3 redeyes.localdomain redeyes
::1 localhost |
Code: | /etc/conf.d/net
config_eth0=( "192.168.0.2 netmask 255.255.255.0 brd 192.168.0.255" )
routes_eth0=( "default gw 192.168.0.1" ) |
tutto funziona a dovere:
Code: | stefano@blueyes ~ $ ping redeyes
PING redeyes.localdomain (192.168.0.3) 56(84) bytes of data.
64 bytes from redeyes.localdomain (192.168.0.3): icmp_seq=1 ttl=64 time=1.30 ms
64 bytes from redeyes.localdomain (192.168.0.3): icmp_seq=2 ttl=64 time=0.110 ms |
_________________ 8-09 V-Day con una raccolta firme. Vi aspettiamo
Raccolta Firme
Progetto tRicicloPC con Linux |
|
Back to top |
|
|
devilheart l33t
Joined: 17 Mar 2005 Posts: 848 Location: Villach, Austria
|
Posted: Tue Aug 15, 2006 2:12 pm Post subject: |
|
|
cosa hai in /etc/nsswitch.conf |
|
Back to top |
|
|
dmorab Apprentice
Joined: 29 Aug 2003 Posts: 210
|
Posted: Wed Aug 16, 2006 5:15 am Post subject: |
|
|
devilheart wrote: | cosa hai in /etc/nsswitch.conf |
Code: | cat /etc/nsswitch.conf
# /etc/nsswitch.conf:
# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/nsswitch.conf,v 1.1 2005/05/17 00:52:41 vapier Exp $
passwd: compat
shadow: compat
group: compat
# passwd: db files nis
# shadow: db files nis
# group: db files nis
hosts:
networks: files dns
services: db files
protocols: db files
rpc: db files
ethers: db files
netmasks: files
netgroup: files
bootparams: files
automount: files
aliases: files |
Porcaccia miseria!
modifico la linea relativa ad hosts in questo modo
e tutto è magicamente a posto!
Mi rimane il quesito su chi avesse modificato il file /etc/nsswitch.conf
Potrebbe essere stato l'installazione di avahi? |
|
Back to top |
|
|
|