LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-21-2015, 05:20 AM   #1
mike.adams
LQ Newbie
 
Registered: May 2014
Location: East Anglia, UK
Distribution: Debian 7.8 Linux Kernel 3.18.11
Posts: 9

Rep: Reputation: Disabled
I can browse internet, but no access to names or addresses on lan. Rpi


I have a raspberry pi running Wheezy.

Eth0 has static ip 192.168.1.30 properly set up in /etc/network/interfaces:

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.30
netmask 255.255.255.0
gateway 192.168.1.1

my /etc/hosts has entries for other machines on lan, and all this was working fine... until I decided to something about the following:

My rpi eth0 was being assigned another address by dhcp.
I stopped this by purging dhcpcd5, backing up the interfaces file, and then restoring it afterwards.

That's when the trouble started.
I can ping public domains and access them with a browser, but I cannot ping my lan addresses or names from the command line, nor can I access my local webserver by name or address.
I can access the rpi by ssh, and I can ssh from rpi, but by ip only, not name.

Does anyone know what's going on here? I'd be most grateful for any assistance.
 
Old 07-21-2015, 02:18 PM   #2
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Post the output from the following:

Code:
ifconfig
route -n
 
Old 07-21-2015, 02:47 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,027

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
nslookup or dig or ping a host name from the hosts file. Are the other hosts being assigned ip addresses?

In a normal setup name resolution has an order. I forget where that setting is but I guess it could be changed.
 
Old 07-21-2015, 07:23 PM   #4
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Quote:
Originally Posted by jefro View Post
In a normal setup name resolution has an order. I forget where that setting is but I guess it could be changed.
/etc/host.conf
 
1 members found this post helpful.
Old 07-22-2015, 03:55 AM   #5
mike.adams
LQ Newbie
 
Registered: May 2014
Location: East Anglia, UK
Distribution: Debian 7.8 Linux Kernel 3.18.11
Posts: 9

Original Poster
Rep: Reputation: Disabled
Well, not so lazydog, thanks for your assistance. Here are the outputs


ifconfig:
pi@testpi ~ $ ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:c9:85:81
inet addr:192.168.1.30 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:322 errors:0 dropped:1 overruns:0 frame:0
TX packets:83 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:25431 (24.8 KiB) TX bytes:10505 (10.2 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:56 errors:0 dropped:0 overruns:0 frame:0
TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5600 (5.4 KiB) TX bytes:5600 (5.4 KiB)

and route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

and Jefro, the other hosts (mac, bb, bbe) all have static ip addresses and are assigned these names in /etc/hosts thus:
pi@testpi ~ $ cat /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

127.0.1.1 testpi
192.168.1.40 bb
192.168.1.41 bbe
192.168.1.3 mac

but looking at this now, it occurs to me that the references to ip6 may be the problem

will now reboot, after commenting out all references to ip6, and post back in a moment
 
Old 07-22-2015, 03:59 AM   #6
mike.adams
LQ Newbie
 
Registered: May 2014
Location: East Anglia, UK
Distribution: Debian 7.8 Linux Kernel 3.18.11
Posts: 9

Original Poster
Rep: Reputation: Disabled
Commenting out the ip6 references made no apparent difference.
 
Old 07-22-2015, 04:08 AM   #7
mike.adams
LQ Newbie
 
Registered: May 2014
Location: East Anglia, UK
Distribution: Debian 7.8 Linux Kernel 3.18.11
Posts: 9

Original Poster
Rep: Reputation: Disabled
$ cat /etc/host.conf
multi on
 
Old 07-22-2015, 04:50 AM   #8
mike.adams
LQ Newbie
 
Registered: May 2014
Location: East Anglia, UK
Distribution: Debian 7.8 Linux Kernel 3.18.11
Posts: 9

Original Poster
Rep: Reputation: Disabled
output from nslookup

pi@testpi ~ $ nslookup bb
Server: 192.168.1.1
Address: 192.168.1.1#53

Non-authoritative answer:
*** Can't find bb: No answer

pi@testpi ~ $ nslookup bbe
Server: 192.168.1.1
Address: 192.168.1.1#53

** server can't find bbe: NXDOMAIN

pi@testpi ~ $ nslookup mac
Server: 192.168.1.1
Address: 192.168.1.1#53

** server can't find mac: NXDOMAIN

pinging names on my lan shows proper resolution, but no reply - just waits:

pi@testpi ~ $ ping bb
PING bb (192.168.1.40) 56(84) bytes of data.

and waits, and waits....
 
Old 07-22-2015, 07:29 AM   #9
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Quote:
Originally Posted by mike.adams View Post
$ cat /etc/host.conf
multi on
And the output from:

Code:
cat /etc/nsswitch.conf
 
Old 07-22-2015, 02:30 PM   #10
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,027

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
I've never seen that response. "192.168.1.1#53" But it tells me that hosts file was ignored. (I'm guessing)

"multi
Takes on or off as options. This determines if a host in /etc/hosts is allowed to have several IP addresses, which is usually referred to as being ``multi-homed''. This flag has no effect on DNS or NIS queries.
nospoof"

http://www.tldp.org/LDP/nag/node82.html

Last edited by jefro; 07-23-2015 at 02:31 PM.
 
Old 07-23-2015, 03:18 AM   #11
mike.adams
LQ Newbie
 
Registered: May 2014
Location: East Anglia, UK
Distribution: Debian 7.8 Linux Kernel 3.18.11
Posts: 9

Original Poster
Rep: Reputation: Disabled
output from:
cat /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd: compat
group: compat
shadow: compat

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis

I need to find out about these things, and will get back soon(=today)
Thanks for your help
 
Old 07-24-2015, 04:38 AM   #12
mike.adams
LQ Newbie
 
Registered: May 2014
Location: East Anglia, UK
Distribution: Debian 7.8 Linux Kernel 3.18.11
Posts: 9

Original Poster
Rep: Reputation: Disabled
it's a much bigger subject than I thought, but you're right - clearly my hosts file is not being used.

I edited the host.conf, which now looks like this, but has made no apparent difference:

cat /etc/host.conf
order hosts,
multi on

I read that the arguments following 'order' should be followed by a comma. I tried with and without, but no change there.

I noticed that I can ping by name and ip my macbook mac 192.168.1.3, but no other machine on my lan from the pi.

So, mac is being allowed somewhere, but no other hostname or ip, although they are all in /etc/hosts

Anyone have a clue why this should be?
 
Old 07-24-2015, 02:36 PM   #13
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,027

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
Not sure multi on would be bad but pretty sure you want it off or better yet a different option.

Not sure I like this but shouldn't hurt. 127.0.1.1 testpi

Can I assume that all other systems on lan work correctly with hosts file? You may have said that already.

Last edited by jefro; 07-24-2015 at 02:40 PM.
 
Old 07-25-2015, 08:38 AM   #14
mike.adams
LQ Newbie
 
Registered: May 2014
Location: East Anglia, UK
Distribution: Debian 7.8 Linux Kernel 3.18.11
Posts: 9

Original Poster
Rep: Reputation: Disabled
127.0.1.1 testpi is there by default. The only options for multi are on or off.

I believe that the fundamental cause of this is the purging of dhcpcd5, which has had far reaching effects, and I know I could solve it all by doing the decent thing - ie, burning the card again and starting from scratch, but I would like to know what's happening. I will have learned nothing if I burn a card.

I'll try to find occurrences of '192.168.1.3' in text files, as this is the only lan address that is pingable.
 
Old 07-25-2015, 07:50 PM   #15
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,027

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
You may have something on that http://dev.man-online.org/man8/dhcpcd5/




Maybe in that version. Normal file is this.
This determines the order in which the resolving services are tried. Valid options are :

bind for querying the name server
hosts for lookups in /etc/hosts
nis for NIS lookups.

Set the order to hosts then bind and then nis.

Last edited by jefro; 07-25-2015 at 08:07 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
restrict file share access to only certain LAN IP addresses? feizaguirre Linux - Newbie 4 06-05-2015 08:27 PM
restrict Samba access to only certain LAN IP addresses? dgr Red Hat 3 08-07-2007 10:00 AM
Constant LAN addresses for names? (Fedora) GregLee Linux - Networking 3 07-15-2007 11:30 PM
Browse LAN behind gateway from internet billamn Linux - Newbie 3 08-19-2006 03:10 PM
SuSE 9.0 can browse LAN, ping router...cannot get on the internet tmlayton Linux - Networking 5 06-30-2004 02:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration