Can't ping local device, and can't change it's static IP
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
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.
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
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.
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:
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...
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.
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).
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
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.