LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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-26-2017, 01:22 PM   #1
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Rep: Reputation: 13
network is unreachable


Ubuntu Linux, private network with three devices: laptop, cdev, and edev. All three connected to a switch that shows all active.
Ping returns message:
Connect: Network is unreachable
Wireshark shows that device cdev is sending messages
I edited /etc/host such that I left the first few lines unchanged as shown here

Code:
127.0.0.1  local host
127.0.1.1 esdev

// I added the three lines below but not this comment

192.168.1.10  laptop
192.168.1.20  edev
192.168.1.43  cdev
// and left the remainder of the file unchanged

The laptop really did now want me to change hosts so I copied it to another directory, saved the original, edited a copy, then copied it back to directory /etc with sudo cp command. Then I rebooted and the results are unchanged. I used the "more" command to see that /etc/hosts realy did get changed.
What do I need to do different?

Last edited by bkelly; 12-26-2017 at 03:49 PM. Reason: formatting
 
Old 12-26-2017, 01:38 PM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
What is the output of
Code:
$ ifconfig
 
Old 12-26-2017, 02:52 PM   #3
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Original Poster
Rep: Reputation: 13
ifconfig returns the below, in part
Code:
enp0s25 Link encap:Ethernet  HWaddr <six pair hex digits>
        intet 6 addr: <more address> Scope:Link
        UP BROADCAST RUNNING MULTICASE MTU;1500 Metric:1
        RX packets:0 errors:0 dropped:0 overruns:0 frame: 0
        TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000
        RX bytes:0 (0.0 B) TX bytes 4563 (4.5 KB)
        Interrupt:20 Memory: ca100000-ca120000
There is a second paragraph of similiar data that instead of enp0s25 it has lo, and a third with wlp61s0.
Do you need any of those two sets of statistics?

edit

I followed some instructions that said to right click “nm” which I take to mean “network manager” which I take to mean the little antenna looking icon in the upper right. That open a dialog with title: Editing ETH. Select the tab: IPv4 Settings.
Clicking on Add allows the editing of an IP address. Enter 192.168.1.10
Tab gets me to what looks like network mask where I recall from somewhere I should enter 255.255.255.0. Which does not entirely make sense because the last octect is the only one that changes.
There is no gateway on this network, just the three devices connected to a network switch box.
Pressing Tag again gets me back to the IP address that was just entered. Save button is not enabled.
Do not know how to get Save enabled.

Last edited by bkelly; 12-26-2017 at 03:38 PM. Reason: formatting
 
Old 12-26-2017, 02:59 PM   #4
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by bkelly View Post
ifconfig returns the below, in part

enp0s25 Link encap:Ethernet HWaddr <six pair hex digits>
intet 6 addr: <more address> Scope:Link
UP BROADCAST RUNNING MULTICASE MTU;1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame: 0
TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes 4563 (4.5 KB)
Interrupt:20 Memory: ca100000-ca120000

There is a second paragraph of similiar data that instead of enp0s25 it has lo, and a third with wlp61s0.
Do you need any of those two sets of statistics?
First, please look at the first link in my signature and use CODE tags.

Here's my output from my machine:

Code:
wlp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.43.204  netmask 255.255.255.0  broadcast 192.168.43.255
        inet6 fe80::c6e9:84ff:fe2b:2797  prefixlen 64  scopeid 0x20<link>
        ether c4:e9:84:2b:27:97  txqueuelen 1000  (Ethernet)
        RX packets 12693  bytes 6374063 (6.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12241  bytes 1907158 (1.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
The inet part means IPv4 and the inet6 part means IPv6, if that's what your referring to. The lo part means the "local loopback" device.

So if you want to test your ethernet card, type the following into a terminal:

Code:
ping 127.0.0.1
That should always work, even without having the Internet connected.

Last edited by jsbjsb001; 12-26-2017 at 03:05 PM. Reason: more info
 
Old 12-26-2017, 03:48 PM   #5
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Original Poster
Rep: Reputation: 13
I edited my previous post and added the CODES
The ping to the loopback address does work. Ping to 192.168.1.10, the desired local address, returns Network unreachable.
I am unable to extract something to try different from your reply. That is probably because of not understanding something
The laptop cannot be connected to this network so I took a pic with my cell phone, emailed to my work address, and attempted to attach it here. Looking at this post does not reveal that attachment. Maybe it will be visible after Submit Reply.
Edit:
The attachment is visible. Am not able to do anything to get the Save button to be enabled.

Note that in my first post I wrote that wireshark shows that the device referred to as cdev, ip 192.168.1.43, posts messages. That indicates that the network proper is functioning, the switch is functioning, and at least one other device is functioning. It proves that the NIC on this laptop is functional.
But, something in the configuration is not right.
Attached Thumbnails
Click image for larger version

Name:	editing network config.jpg
Views:	1166
Size:	34.6 KB
ID:	26612  

Last edited by bkelly; 12-26-2017 at 03:59 PM. Reason: more info
 
Old 12-26-2017, 04:09 PM   #6
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Thanks for using CODE tags, it makes it a lot easier to read.

From your post #3, it looks like your ethernet is not getting an IPv4 address at boot time. You also have your connection set as "Manual" from your screenshot.

Any reason for the "Manual" connection setting?
 
Old 12-26-2017, 04:23 PM   #7
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Original Poster
Rep: Reputation: 13
Why "manual"? Because there are three devices on the network. Two have fixed IP addresses, 192,168.1.20 and .43. The third is the laptop that must also have a fixed address. That would be 192.168.1.10. there is no DNS server and no gateway computer.
What should be different?
 
Old 12-26-2017, 04:23 PM   #8
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by bkelly View Post
I edited my previous post and added the CODES
The ping to the loopback address does work. Ping to 192.168.1.10, the desired local address, returns Network unreachable.
I'm not an Ubuntu guru so I may not be able to get you detailed info on what's going on, but whenever I see "Network unavailable" I wonder whether a default route has been defined or whether the network has been fully configured.

What do you see when you issue:
Code:
netstat -r
or
Code:
ip route
When I issue the latter, I see:
Code:
$ ip route
default via 192.168.13.1 dev enp3s0 
192.168.13.0/24 dev enp3s0  proto kernel  scope link  src 192.168.13.7
My workstation has address "192.168.13.7" and "192.168.13.1" is the (uh) "clean" interface on my firewall/router system. I'm going to go out on a limb and posit that you do not see a line like "default via ... ".

What does your system return?
 
Old 12-26-2017, 04:36 PM   #9
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Original Poster
Rep: Reputation: 13
enter netstat -r to get
Code:
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
and nothing more. There are more spaces in the second line that looks like making it look column friendly, but no characters below that line, just the next command line prompt.

enter: ip route

to get,..., nothing. Well not quite, it does provide another copy of the command prompt line.
That looks like a good clue but I don't know where to go with it.
 
Old 12-26-2017, 04:51 PM   #10
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Try giving it an IPv4 address and see if you still get the same error:

Code:
ifconfig enp0s25 192.168.1.10
 
Old 12-26-2017, 05:37 PM   #11
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Original Poster
Rep: Reputation: 13
Enter the command ifconfig and the returned the same as I posted earlier,
three groups of responses that are mostly status items. It does not describe, to the novice,
what is wrong or what might be changed.
Use this command
Code:
ifconfig enp0s25
and it gives the same response, but a single block with the lead in "enp0s25"
use this command as suggested
Code:
ifconfig enp0s25 192.168.1.10
and it responds with
Code:
SIOCSIFADDR: Operation not permitted
SIOCIFFLAGS: Operation not permitted
Found a page that said to do this
Code:
sudo apt install ethtool
Did that then ran this command with the shown response
Code:
sudo ethtool enp0s25
Settings for enp0s25:
   Supported port [ TP ]
   Supported link modes:  10baseT/Half 10baseTFull
….
It continue on to list more information such as 100 Mbit and 1000 Mbit interfaces and a list of attributes. To my ability, it is telling me that all is good and describes port enp0s25. I am unable to discover something wrong that bears changing.

Looking up the various ifconfig and ip and route commands provides a huge amount of information. However, as a novice, I am not able to determine what should be and how to change my system to match the should be condition.

Last edited by bkelly; 12-26-2017 at 05:54 PM. Reason: more information
 
Old 12-26-2017, 06:00 PM   #12
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Did you run the ifconfig command as root?

Try this:

Code:
sudo ifconfig enp0s25 192.168.1.10
PS: Sorry I should have said that before, lack of sleep will do that to ya.

Last edited by jsbjsb001; 12-26-2017 at 06:03 PM. Reason: forgot cmd
 
Old 12-26-2017, 06:11 PM   #13
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Original Poster
Rep: Reputation: 13
Yes, tried that as root
Code:
sudo ifconfig epn0s25 192168.1.10
And it just presented the next prompt. No information, no error.
That is almost all for today. I will try again tomorrow, after asking about mounting a USB drive.
 
Old 12-26-2017, 06:14 PM   #14
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by bkelly View Post
Yes, tried that as root
Code:
sudo ifconfig epn0s25 192168.1.10
And it just presented the next prompt. No information, no error.
That is almost all for today. I will try again tomorrow, after asking about mounting a USB drive.
It should be the following, rather than the above:

Code:
sudo ifconfig epn0s25 192.168.1.10
If it give no error, do you still have the same problem?

As your reply is a little unclear to me.
 
Old 12-27-2017, 12:39 AM   #15
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by bkelly View Post
enter netstat -r to get
Code:
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
and nothing more. There are more spaces in the second line that looks like making it look column friendly, but no characters below that line, just the next command line prompt.

enter: ip route

to get,..., nothing. Well not quite, it does provide another copy of the command prompt line.
That looks like a good clue but I don't know where to go with it.
You have no routes configured. Is this a standalone network? Do you have a router from your ISP?

If it's standalone, something still needs to act as the router for your network. (You did say thre was no "gateway computer" in your original post---I missed that and I think that's the source of your problem.) Perhaps one of the systems is acting as a server of some sort? That might be a good choice.

List the three devices you have on your network and their IP addresses. You're using a 192.168.x.x address space, right? Might be a good idea to issue the "ip route" (or "netstat -r") command on all three systems (laptop?, cdev?, and edev?) as well as the "ifconfig -a" or "ip addr list" command on each and post the output for all systems.

Later...
 
  


Reply



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
Network is Unreachable/Unknown host/Destination Host Unreachable [Debian] denv Linux - Networking 4 03-27-2014 02:58 PM
Network Unreachable for Destination Network other than Interface Jack10 Linux - Networking 3 08-17-2010 07:50 AM
Network is unreachable ahtesham0123 Linux - Software 4 04-25-2010 08:45 AM
network unreachable zigzagooo Linux - Networking 6 05-24-2009 10:17 AM
Network Is Unreachable!!!!!!!!!!!!!!!!!!!!! koodoo Linux - Newbie 4 02-19-2005 09:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:47 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