LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-10-2015, 11:16 AM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 687

Rep: Reputation: Disabled
Can't ping local device, and can't change it's static IP


I have a Raspberry Pi, and wrote an iso to it which included the entire operating system. It is running Debian, and as far as I could tell, it doesn't have iptables, and I don't know if it has another firewall. When directly interfacing to the device with a keyboard/monitor, I could ping other devices on my network.

ping 192.168.1.200 >

Code:
PING 192.168.1.200 (192.168.1.200) 56(84) bytes of data.
64 bytes from 192.168.1.200: icmp_req=1 ttl=63 time=289 ms
64 bytes from 192.168.1.200: icmp_req=2 ttl=63 time=1.34 ms
64 bytes from 192.168.1.200: icmp_req=3 ttl=63 time=3.99 ms
64 bytes from 192.168.1.200: icmp_req=4 ttl=63 time=1.36 ms

--- 192.168.1.200 ping statistics ---
4 packets transmitted, 4 received, 0 packet loss, time 3003ms
rtt min/avg/max/mdev = 1.344/74.011/289.344/124.327 ms
But from other devices, I can't ping it. Below are the original settings of the device. Since I can't connect, I can't ssh into it, so I just locally ran the commands and directed them into a file.

service networking restart >>

Code:
Running /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces ... (warning).
Reconfiguring network interfaces...Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/b8:27:eb:77:55:11
Sending on   LPF/eth0/b8:27:eb:77:55:11
Sending on   Socket/fallback
DHCPRELEASE on eth0 to 172.27.35.1 port 67
Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/b8:27:eb:77:55:11
Sending on   LPF/eth0/b8:27:eb:77:55:11
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPOFFER from 172.27.35.1
DHCPACK from 172.27.35.1
bound to 172.27.35.150 -- renewal in 16799 seconds.
done.
ifconfig >>

Code:
eth0      Link encap:Ethernet  HWaddr b8:27:eb:77:55:11  
          inet addr:172.27.35.150  Bcast:172.27.35.255  Mask:255.255.255.0
          inet6 addr: fe80::ba27:ebff:fe77:5511/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:387 errors:0 dropped:0 overruns:0 frame:0
          TX packets:589 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:28133 (27.4 KiB)  TX bytes:51018 (49.8 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:84 errors:0 dropped:0 overruns:0 frame:0
          TX packets:84 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:8792 (8.5 KiB)  TX bytes:8792 (8.5 KiB)

/etc/network/interfaces

Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

# iface eth0 inet static
#     address   192.168.1.100
#     netmask   255.255.255.0
#     network   192.168.1.0
#     broadcast 192.168.1.255
#     gateway   192.168.1.1
/etc/resolv.conf

Code:
nameserver 172.27.35.1
/etc/hostname

/etc/hosts

Code:
127.0.0.1    localhost
127.0.1.1    cbmsstudio
# 192.168.1.100   cbmsstudio

Next, I tried to change the static ip to 192.168.1.100, but now eth0 doesn't exist. The first time I restarted the network after making the changes, it responded with the following (might be slightly off as I had to take a picture of it and then OCR the picture)
Code:
root@cbrisstudio:-O /etc/init.d/networking restart > aaa 2>&1
[ 2736.091463] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 2736.109125] IPu6: ADDRCOMF(METDEV_UP): eth0: link is not ready root
root@cbmsstudio: ~# [2737.542868] IPu6: ADDRCOMF(METDEU_CHAMGE): eth0: link becomes ready 
[2737.560216] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, Ipa Ox41E1

/etc/network/interfaces

Code:
auto lo
iface lo inet loopback

#auto eth0
#iface eth0 inet dhcp

iface eth0 inet static
     address   192.168.1.100
     netmask   255.255.255.0
     network   192.168.1.0
     broadcast 192.168.1.255
     gateway   192.168.1.1
/etc/resolv.conf

Code:
#nameserver 172.27.35.1
nameserver 8.8.8.8
nameserver 8.8.4.4
/etc/hosts

Code:
127.0.0.1    localhost
#127.0.1.1    cbmsstudio
192.168.1.100   cbmsstudio
ipconfig >

Code:
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
When I set /etc/network/interfaces back to using "auto eth0" and "iface eth0 inet dhcp", it automatically goes back to it's original 172.27.35.150 IP. Where might this be set if not in /etc/network/interfaces?

Why am I not be able to ping it using it's original 172.27.35.150? Why is eth0 available?

Thanks

Last edited by NotionCommotion; 12-10-2015 at 11:54 AM.
 
Old 12-10-2015, 11:48 AM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,699
Blog Entries: 23

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Smile ignoring pings?

One idea..(I read the post "diagonally" so sorry if I glossed over one or two details...) is that it ignores pings...or more precisely: does NOT respont to pings...
Try this (as root) on the device

Code:
sysctl -w net.ipv4.icmp_echo_ignore_all=0
net.ipv4.icmp_echo_ignore_all = 0
...this should restore the desire to reply to a ping
Melissa
 
Old 12-10-2015, 12:01 PM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 687

Original Poster
Rep: Reputation: Disabled
Thanks Melissa,

Tried both, but the second results in an error (command not found).


If you see the ifconfig, there is no eth0, so I don't think it has anything to do with not pinging.

Ah, let me go back to the original ip and try that command... EDIT. Nope, restored to the original 172.27.35.150 IP, and can't ping it. Where is that IP address defined on debian? I thought it was always on /etc/network/interfaces or /etc/hosts

Last edited by NotionCommotion; 12-10-2015 at 12:05 PM.
 
Old 12-10-2015, 12:15 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,456

Rep: Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052
That IP is not defined anywhere on the RPi, it's coming from your DHCP server at 172.27.35.1.

Try getting rid of the network and broadcast lines in your static config, you only need address, netmask, and gateway. Then use "ifdown eth0" and "ifup eth0". You can also put the DNS servers in the interfaces file. This is the interfaces file on one of my RPis running Raspbian:

Code:
$ cat /etc/network/interfaces
auto lo

iface lo inet loopback
iface eth0 inet static
  address 192.168.1.10
  netmask 255.255.255.0
  gateway 192.168.1.1
  dns-nameservers 208.67.222.222 208.67.220.220

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Last edited by suicidaleggroll; 12-10-2015 at 12:18 PM.
 
1 members found this post helpful.
Old 12-10-2015, 12:22 PM   #5
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,699
Blog Entries: 23

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
oookay, what I try after a new set up it ping the machine tru the loopback (127.0.0.1) ansd see if the IP stack is okay...
So, after actually READING the post :P here's what worries me...
per ifconfig on the device...
Quote:
inet addr:172.27.35.150 Bcast:172.27.35.255 Mask:255.255.255.0
Let's see where we stand, you are in a class C network, I assume, where all the IP addresses start with 192.168.1.x, where the x is one between 2 and 255, where 192.168.1.1 is assumed to be the modem/router...
I doubt device 1 (192.168.1.5) could ping device 2 (127.16.1.1)...
let's "sincronise" this first...
Melissa

Last edited by ButterflyMelissa; 12-10-2015 at 12:30 PM.
 
Old 12-10-2015, 12:34 PM   #6
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 687

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
That IP is not defined anywhere on the RPi, it's coming from your DHCP server at 172.27.35.1.

Try getting rid of the network and broadcast lines in your static config, you only need address, netmask, and gateway. Then use "ifdown eth0" and "ifup eth0". You can also put the DNS servers in the interfaces file. This is the interfaces file on one of my RPis running Raspbian:
Ah, it is coming from DHCP. Guess that makes sense.

Tried your /etc/network/interfaces setup, and like my previous one, eth0 just doesn't exist anymore. I get this "hardware isn't capable of remote wakeup" error when restarting the network (see my edited original post).
 
Old 12-10-2015, 12:36 PM   #7
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 687

Original Poster
Rep: Reputation: Disabled
I can ping through it loopback.

Yes, you've identified my network type properly.

I was concerned that device 1 (192.168.1.5) couldn't ping device 2 (127.16.1.1), so tried to change the IP, but that is failing.
 
Old 12-10-2015, 12:39 PM   #8
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,699
Blog Entries: 23

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
I can ping through it loopback.
Check one : network stack is alive, good...
Quote:
Yes, you've identified my network type properly.
Hehe
Quote:
I was concerned that device 1 (192.168.1.5) couldn't ping device 2 (127.16.1.1), so tried to change the IP, but that is failing.
Correct, these two cannot ping each other, that's why networks have...bridges
What IP did you give device 2? I'd go for 192.168.1.6, just to try things...
Melissa
 
Old 12-10-2015, 12:40 PM   #9
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,456

Rep: Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052
Quote:
Originally Posted by NotionCommotion View Post
Ah, it is coming from DHCP. Guess that makes sense.

Tried your /etc/network/interfaces setup, and like my previous one, eth0 just doesn't exist anymore. I get this "hardware isn't capable of remote wakeup" error when restarting the network (see my edited original post).
It exists, it's just not configured, and by default ifconfig doesn't display unconfigured devices. Use "ifconfig -a" to show it.

That remote wakeup message is not an error, it's just a harmless notification that you get every time eth0 is brought up.

I see you're redirecting all output of "/etc/init.d/networking restart" to a file, why is that? What are the contents of this file? If the network is not coming back up correctly, step one is to look at the output of this command to see why.

Last edited by suicidaleggroll; 12-10-2015 at 12:42 PM.
 
Old 12-10-2015, 12:46 PM   #10
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,627

Rep: Reputation: 471Reputation: 471Reputation: 471Reputation: 471Reputation: 471
You cannot ping because the interface is bound to a network but the gateway in the route table does not belong to that network. They don't belong to the same network. This commonly occurs when the router is not configured to bridge. You may try launch browser and access your router 192.168.1.1 and from there configure it On as bridge. Or you may try if fixing the interface into the internet gateway may work:

Code:
# route add default gw 172.27.35.1 eth0
(if that is not the gateway ip you may call the provider what is the gateway ip.

Try to ping the gateway and any of your DNS. If it works, then good.

Hope that helps. Goodluck.

m.m.

Last edited by malekmustaq; 12-10-2015 at 12:48 PM.
 
Old 12-10-2015, 12:47 PM   #11
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 687

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
I see you're redirecting all output of "/etc/init.d/networking restart" to a file, why is that? What are the contents of this file? If the network is not coming back up correctly, step one is to look at the output of this command to see why.
Because the only way I can post anything at LinuxQuestions is redirect it to a file on a USB, and move it to my PC.
 
Old 12-10-2015, 12:47 PM   #12
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 687

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by thor_2.0 View Post
what ip did you give device 2? I'd go for 192.168.1.6, just to try things...
192.168.1.222
 
Old 12-10-2015, 12:48 PM   #13
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,456

Rep: Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052
Quote:
Originally Posted by NotionCommotion View Post
Because the only way I can post anything at LinuxQuestions is redirect it to a file on a USB, and move it to my PC.
Ok, well what's in the file?

Also, did you try "ifdown eth0" "ifup eth0" as I suggested earlier?

Last edited by suicidaleggroll; 12-10-2015 at 12:50 PM.
 
Old 12-10-2015, 12:57 PM   #14
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,699
Blog Entries: 23

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
192.168.1.222
Hmm..okay, on to the netmasks...they have to be the same, as well as the broascast...let's check this...
A good example

Quote:
inet 192.168.1.222 netmask 255.255.255.0 broadcast 192.168.1.255
All neatly INSIDE the network shell...

Melissa
Edit - what is the IP address of your router/modem?
 
Old 12-10-2015, 12:58 PM   #15
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 687

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
Ok, well what's in the file?

Also, did you try "ifdown eth0" "ifup eth0" as I suggested earlier?
Oh, sorry,

Code:
Running /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces ... (warning).
Reconfiguring network interfaces...done.
I tried "ifdown eth0", but not sure if I tried "ifup eth0". I should have done so! Now ifconfig shows eth0. Still can't ping from another computer, and now it can't ping out as well.
 
  


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
[SOLVED] Centos cannot ping hosts on the same subnet after change to static ip chenbo Linux - Networking 13 07-27-2011 12:40 AM
CentOS 3.5 Enterprise Server -- I need to change my Local Static IP address. kexpert Red Hat 12 11-08-2009 05:33 AM
FC4 won't ping 127.0.0.1 or the internet, but will ping local computers jalsk Linux - Networking 4 11-22-2005 05:59 PM
Cannot ping local system when pinging system is set for static IP SkipHuffman Linux - Networking 4 08-22-2005 11:56 AM


All times are GMT -5. The time now is 01:23 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration