From owner-freebsd-questions@FreeBSD.ORG Thu Jun 4 18:48:22 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C2BF106564A for ; Thu, 4 Jun 2009 18:48:22 +0000 (UTC) (envelope-from fbsdq@peterk.org) Received: from poshta.pknet.net (poshta.pknet.net [216.241.167.213]) by mx1.freebsd.org (Postfix) with SMTP id 470938FC19 for ; Thu, 4 Jun 2009 18:48:22 +0000 (UTC) (envelope-from fbsdq@peterk.org) Received: (qmail 11312 invoked from network); 4 Jun 2009 18:48:21 -0000 Received: from poshta.pknet.net (HELO pop.pknet.net) (216.241.167.213) by poshta.pknet.net with SMTP; 4 Jun 2009 18:48:21 -0000 Received: from 216.241.167.212 (SquirrelMail authenticated user fbsdq@peterk.org) by webmail.pknet.net with HTTP; Thu, 4 Jun 2009 12:48:21 -0600 (MDT) Message-ID: <093ebf7d0b078a923d5690a42ef982e7.squirrel@webmail.pknet.net> Date: Thu, 4 Jun 2009 12:48:21 -0600 (MDT) From: "Peter" To: freebsd-questions@freebsd.org User-Agent: SquirrelMail/1.4.17 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: /etc/hosts - how does that file work?? - was weird nfs issues. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 18:48:22 -0000 iH, This all started with NFS not mounting at boot....so, testing in VMs: This is a fresh/generic install of 7.2-REL no firewall em1=10.21.20.0/24 network - DHCP for ssh access client# uname -a FreeBSD client.test 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May 1 08:49:13 UTC 2009 root@walker.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 client# cat /etc/rc.conf gateway_enable="YES" hostname="client.test" ifconfig_em0="inet 172.20.6.2 netmask 255.255.255.0" ifconfig_em0_alias0="inet 116.23.45.2 netmask 255.255.255.0" ifconfig_em1="DHCP" nfs_client_enable="YES" nfs_server_enable="NO" rpcbind_enable="NO" sshd_enable="YES" client# ifconfig em0|grep inet inet 172.20.6.2 netmask 0xffffff00 broadcast 172.20.6.255 inet 116.23.45.2 netmask 0xffffff00 broadcast 116.23.45.255 client# cat /etc/hosts ::1 localhost localhost.test 127.0.0.1 localhost localhost.test 172.20.6.2 client.test client 116.23.45.2 client.test client 172.20.6.1 server.test server 116.23.45.3 server.test server client# ping -c1 server PING server.test (172.20.6.1): 56 data bytes 64 bytes from 172.20.6.1: icmp_seq=0 ttl=64 time=5.811 ms --- server.test ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 5.811/5.811/5.811/0.000 ms client# ssh -vvv server OpenSSH_5.1p1 FreeBSD-20080901, OpenSSL 0.9.8e 23 Feb 2007 debug1: Reading configuration data /etc/ssh/ssh_config debug2: ssh_connect: needpriv 0 debug1: Connecting to server.test [116.23.45.3] port 22. ^C client# ssh to 'server' always goes to 116.23.45.3 IP there is nothing on '116.23.45.3' IP '116.23.45.3/24' is a made up network for testing BUT... client# ifconfig em0|grep inet inet 172.20.6.2 netmask 0xffffff00 broadcast 172.20.6.255 inet 116.23.45.2 netmask 0xffffff00 broadcast 116.23.45.255 client# cat /etc/hosts ::1 localhost localhost.test 127.0.0.1 localhost localhost.test 172.20.6.2 client.test client 116.23.45.2 client.test client 172.20.6.1 server.test server 116.23.45.4 server.test server client# ping -c1 server PING server.test (172.20.6.1): 56 data bytes 64 bytes from 172.20.6.1: icmp_seq=0 ttl=64 time=0.285 ms --- server.test ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.285/0.285/0.285/0.000 ms client# ssh -vvv server OpenSSH_5.1p1 FreeBSD-20080901, OpenSSL 0.9.8e 23 Feb 2007 debug1: Reading configuration data /etc/ssh/ssh_config debug2: ssh_connect: needpriv 0 debug1: Connecting to server.test [172.20.6.1] port 22. debug1: Connection established. ... ...... Why if the secondary entry is higher than '116.23.45.3' it always goes to 172/24 network? Why is ping using one IP, and ssh/mount_nfs/showmount using another IP from /etc/hosts? ]confused[