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-27-2017, 02:01 AM   #16
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: Devuan+lxde
Posts: 639

Rep: Reputation: 189Reputation: 189

I want to clarify some things that may be confusing for OP from my quick read through: Generally, network interface cards (NICs) that start with an "e" are for ethernet (or wired) connections, whereas devices starting with "w" are for wireless connections. From your attachment in post #5, you are editing a wired connection.

If you have said so already, forgive me, I missed it, but you havent said whether you are connecting wired or wirelessly. I think you mentioned this is a laptop so I'm going to assume it's wireless in which case the connection you edited in post #5 was not the proper one.

But the rest of the posts make it look like you're on the right track.

Post #13 confirms. You should then be able to define the gateway with something like
Code:
ip route add default via 192.168.1.1
(assuming that's your gateway, it may be different) then try connecting!

Just make sure you have a DNS defined in your /etc/resolv.conf
Something like
Code:
nameserver 8.8.8.8

Last edited by TheEzekielProject; 12-27-2017 at 02:03 AM.
 
Old 12-27-2017, 12:26 PM   #17
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 151

Original Poster
Rep: Reputation: 12
Hello,
There are four network enabled devices on this LAN. One is a Trendnet 8 port switch, not a router, just a switch. The other three devices are connected to it. It can be ignored for this discussion.
There are two embedded system devices, call them cdev, 192.168.1.43 and edev, 192.168.1.20. These are the target devices that we must configure.
The third is a laptop running Ubuntu, 192.168.1.10. Its IP address is arbitrary.
There is no dynanmic addressing and no need for a name server as each of the two devices communicate with the IPV4 addresses only. To my knowledge that is.
There is no gateway computer and/or gateway address for the same reasons.
This system did work for a few days. From that laptop I could ping the edev and ssh log it to it. I could ping the cdev but not long in and that reason is known.
Now, from the laptop I can ping nothing.
When wireshark is started on the laptop it shows that cdev, 192.168.43 sends some standard query messages. That indicates that the network is physically functional.
Things have changed some since yesterday.
Code:
ping 127.0.0.1
produces a series of replies as expected.
Code:
ping 192.168.1.10 
connect: Network in unreachable
Edit to clarify: Yes, this is a hard wired LAN. No connections to the outside world.
Edit: command
Code:
route -n
Destination  Gateway Genmask ...
There is nothing but the header. I am looking up that command and maybe determine what should be added. Again, there are only three devices, wired network, maybe add a couple more devices in the future, but no router and no internet connection.

Edit again:
With this litty bitty network, and no router installed, is a routing table required? Or wanted? None of the nodes are identified via their computer name, always their IP address.

Last edited by bkelly; 12-27-2017 at 02:06 PM.
 
Old 12-27-2017, 01:50 PM   #18
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 151

Original Poster
Rep: Reputation: 12
After I wrote a new post my system caught up and displayed my last post. Do not yet see the method to delete a post.

Last edited by bkelly; 12-27-2017 at 01:52 PM.
 
Old 12-27-2017, 04:37 PM   #19
jefro
Moderator
 
Registered: Mar 2008
Posts: 18,557

Rep: Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778
Don't ping localhost. Usually a wasted task. Ping to localhost is a different deal than what you think. Ping to nic is also usually a bad test.

You didn't correctly add an ipv4 is my guess. Use full ip and subnet and gateway in command unless you want to use a gui. https://superuser.com/questions/6676...rnal-addresses

Disable ipv6 while you are at it or start using it instead.

Last edited by jefro; 12-27-2017 at 04:39 PM.
 
Old 12-27-2017, 06:17 PM   #20
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 151

Original Poster
Rep: Reputation: 12
I finally found a site that answers the more important questions and now have a system that appears to fundamentally work. Additional comments are solicited.
edited file /etc/network/interfaces to contain
Code:
# first line says to automatically start loopback ability on system start.
auto lo

# do not know what this does yet
iface lo inet loopback

# start the NIC (Network Interface Card).  On this computer its name is enp0s25
auto enp0s25

# set the ip address of this computer to be static, never change
iface enp0s25 inet static

# Set this address of this computer to this value
address 192.168.1.10

# Declare that only the last octect is expected to change.
# netmask does not work the way a programmer expects a mask to work.
netmask 255.255.255.0

# This address is reserved for broadcast packets
broadcast 192.168.1.255
With this setup the laptop can ping itself and one of the two other devices. It cannot ping the third so for now I presume that third device is not working right.

Last edited by bkelly; 12-27-2017 at 06:48 PM.
 
Old 12-28-2017, 11:49 AM   #21
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 151

Original Poster
Rep: Reputation: 12
I posted at least two responses that are not visible.
The problem is partially solved, maybe completely.
Edited file /etc/network/interfaces. It now contains the below contents with comments describing how I understand the purpose of each line.
Code:
#  Automatic start for loopback operations
auto lo

# Next line unknown
iface lo inet loopback

# Auto start the NIC.  Linux names the hardware NIC on this computer enp025s
auto enp0s25

# Configure the NIC to have a static IP address
iface enp0s25 inet static

# Set that static IP address
address 192.168.1.10

# Tell Linux that this network only uses the last octect for IP addresses
netmask 255.255.255.0

# Unsure. Tell Linux that all devices IPs begin with 192.168.1
network 192.168.1.0

# Reserve this address for broadcast operations
broadcast 192.168.1.255
This works in that the laptop can be pinged as can one of the two other devices.
Comments and corrections are solicited and welcome.

Last edited by bkelly; 12-28-2017 at 11:51 AM.
 
Old 12-28-2017, 02:13 PM   #22
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 151

Original Poster
Rep: Reputation: 12
Responding mostly to The Exekiel Project:
Basic Question
Are nameserver and gateway always required for a private network with no outside connections? If not required, are they benificial?
Details
Example, we have a set of 3 to 20 embedded systems with IPV4 addresses in the range of 192.168.1.1 through .254. All devices use the IPV4 address of the device they communicate with. None use the name. There are no routers and one or two switches. None are wireless.
A laptop is connected to the LAN switch to configure and program the connected devices. During “normal” operations the laptop is not connected.
Here is our minimal file for /net/interfaces
Code:
auto lo
iface lo inet loopback
auto enp0s25
iface enp0s25 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
Is anything else needed in that configuration file?
Are gateway or nameserver needed?
When I search of various topics such a gateway and name server I have been unable to find a discussion that explicitly mentions private LANs. Might this merit a separate thread?
 
Old 12-28-2017, 04:13 PM   #23
jefro
Moderator
 
Registered: Mar 2008
Posts: 18,557

Rep: Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778Reputation: 2778
Gateways are usually not needed for a dedicated isolated lan. The need would be if an ip addresses is outside of the subnet mask used. The gateway is the way an ip to move outside of the subnet.

Nameserver may or may not be needed on a lan. Typical home lans should not need them. Isolated lans will not need them usually.

I've never seen adding them as being a harm.

Last edited by jefro; 12-28-2017 at 09:00 PM.
 
1 members found this post helpful.
Old 12-28-2017, 06:12 PM   #24
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 151

Original Poster
Rep: Reputation: 12
If folks would work as hard as they complain, the world would be a wonderful place.
Nice tag line. Agreed.

Since I would have to make up an address for the gateway or DNS, I will leave them out for this network.
Thank you for the reply.
 
  


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

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

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