First time setting up an internet connection in a linux distro

Issues related to configuring your network
Lux
Posts: 16
Joined: 2017/02/15 17:22:06

First time setting up an internet connection in a linux distro

Post by Lux » 2017/02/16 01:40:57

I just recently got into linux and this may seem like an obvious problem to some of you. So I tried to get the internet working in CentOS and there was one network listed as "Windows Network" I clicked on it and it gave me the message "failed to retrieve share list there is no such file or directory". I wasn't aware that any list was required to access the network. How do I solve this problem?

User avatar
jlehtone
Posts: 4531
Joined: 2007/12/11 08:17:33
Location: Finland

Re: First time setting up an internet connection in a linux distro

Post by jlehtone » 2017/02/16 08:44:02

"internet connection" does not sound right. A device can be connected to (local) network, wired or wireless, and in that network there can already be an another device that is connected to second (local to it) network, and some device(s) on that network is also a member(s) of yet another network(s). The large collection of somehow linked "local" networks is "internet".

There are thus two steps:
1. Establish a connection to local network
2. (optional) Find a route that leads to "outside"

On most networks, particularly at consumer grade homes, there tends to be a tiny box called "router", "modem", "WiFi", etc that provides a "DHCP" service to connected devices. The DHCP by default gives IP address and route outside. It does not matter whether you have a phone, Windows, Linux, Apple, RPi, etc. All should be "plug and play".

Should.
The CentOS 7 has NetworkManager, which is quite P&P -- unless you omitted to install it.
Some network interface "cards" might require an additional driver.
Wireless (hopefully) requires password.

You did not tell much about your setup.
Open a terminal and run these commands:

Code: Select all

nmcli d s
nmcli c s
ip ad
ip ro
ip neigh
Their output (might) tell us important details.

Obviously, before running any new command it is good to read its manual. For example:

Code: Select all

man man
man nmcli
man ip
(Most manuals are online too.)

You clicked something somewhere. That I cannot help with. IMHO GUIs are similar to blasters and dark side of the Force: clumsy and quick, seemingly powerful, but limited. Not as versatile as the command line.

"Windows Network". Windows machines (at least used to) broadcast to local network repeatedly: "Hi all!, I'm me and have these things to share." The thing you clicked probably allows listening to those broadcasts. This is service discovery: to see if there are neighbours. However, you cannot discover anything before your device has a network connection. (Connection to internet is not required.)

The list will be empty, if there are no Windows machines on the local subnet that offer something.

Lux
Posts: 16
Joined: 2017/02/15 17:22:06

Re: First time setting up an internet connection in a linux distro

Post by Lux » 2017/02/16 17:52:08

Ok I did as you said I discovered a connection called virbr0 it was a bridge connection and it was connected. The internet however was not working. I attempted to activate the connection again to see if I could get it to working using the "up" connection command. It returned "Active connection could not be attached to the device" I ran "nmcli d s" again and the connection was disconnected. The other command lead to me seeing all my previous attempts to set up a connection in the GUI. I had three attempted ethernet connections I promptly deleted because they were not connected and were just piling up. What do you suggest I do next? How do I get a diagnosis on what is wrong so I can fix it?

User avatar
TrevorH
Site Admin
Posts: 33220
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: First time setting up an internet connection in a linux distro

Post by TrevorH » 2017/02/16 17:57:00

That virvr0 is not a real network connection, it's used for running virtual machines and I'm guessing you currently have none. Your ethernet card will be called something like eth0 or enp0s3 or eno16777216.

Is this a virtual machine you're running in?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Lux
Posts: 16
Joined: 2017/02/15 17:22:06

Re: First time setting up an internet connection in a linux distro

Post by Lux » 2017/02/16 18:15:00

No not running from a virtual machine I have installed as a second operating system if that makes a huge difference. Could it be I lack drivers for my Ethernet card? That would make the solution easy. I think I'll try that next. I have the driver now, hopefully this is the correct one. There was no eth0 or anything like that. There was a loop, it appeared as unmanaged. Where would I put the driver folder?

Lux
Posts: 16
Joined: 2017/02/15 17:22:06

Re: First time setting up an internet connection in a linux distro

Post by Lux » 2017/02/16 19:24:29

I'm beginning to see a pattern with CentOS. It won't read my flash drive when I boot into CentOS. Is everything incompatible with CentOS? The drivers are there but inaccessible now. If I get the internet working ever the other problems will be much easier to solve because I don't have to restart and go into my boot menu.

dimwit
Posts: 7
Joined: 2017/02/14 15:59:24

Re: First time setting up an internet connection in a linux distro

Post by dimwit » 2017/02/17 12:25:49

I think your NIC, unless it is rather exotic HW, should be detected and managable by the drivers available to the kernel of a standard CentOS installation or live image.
Do you know how to get a root shell?
When you installed CentOS you definetly were asked by the installer to provide a password for "root" who is the system administrator acount on any Unix-like OS, and usually has full power to execute any command on the system.
So once you are in a root shell be extremely cautiouous when issuing commands as root, as with power comes responsibility and you can easily nuke your system with an inadvertenly submitted wrong command.
I assume you are logged in to a GUI (desktop) environment as an unprivileged user,
the one other account, you are usually asked to name and asign a password for, by the installer (if you haven't deliberately skipped that part).
So try to open a terminal in your desktop.
There should be some icon, either on a menu panel or on your desktop, or in a kind of start menu list.
I cannot tell, where to find the button or icon because it depends on the chosen desktop (e.g. KDE, Gnome etc.) end because I hardly use the GUI.
As last resort you can try to press the Ctrl+Alt+F2 (or other function key) simultaneaously,
which should open one of the virtual terminals, a black screen with a login prompt.
There you can enter "root" as login and for password the one that you submitted during install.
You could also login as your ordinary user account, and once you are served a shell prompt, issue the command "su -" which will ask you for root's password.
That is the same procedure if you managed to open a terminal in the GUI.

A root shell is usually indicated by the hashmark character "#" as shell prompt. But this need not be the case.
Issue the command "id" and hit Return (after every command), and it will show you if you are root or not.
You may also enter "whoami" or "echo $USER".

As root issue "ip addr show" (this can be abbreviated to "ip a s", but this is rather abstract for a Linux newbie)

This should show you a list of NICs and addresses bound to them.
At least one entry, starting "lo:" should appear, which indicates the so called loopback device and has the address 127.0.0.1/8 bound to it.

If lo is the only device you get listed then you may be right that your NIC HW isn't supported out of the box by the booted kernel.

Lux
Posts: 16
Joined: 2017/02/15 17:22:06

Re: First time setting up an internet connection in a linux distro

Post by Lux » 2017/02/17 12:58:35

I made a little progress. I have access to the terminal in the GNOME desktop. I'm not sure if this is the "root" you were talking about but it does seem to take similar commands. lo is present as well as a connection called "virbr0" which has a similar IP to the default IP as my router, it seems to be my router. I however cannot access it by entering the default IP of my router into Firefox like I am able to on my Windows OS on the same computer. What are the chances that this is some sort of connection found on virtual machines like Trevor suggested? It seems unlikely they would have a similar IP. Could it be the firewall is blocking the connection for some reason instead?

Lux
Posts: 16
Joined: 2017/02/15 17:22:06

Re: First time setting up an internet connection in a linux distro

Post by Lux » 2017/02/17 13:08:23

"virbr0" may stand for virtual bridge if my theory about the naming scheme is correct. So what the hell? It shares the first six digits with my router. Could that be the problem though : My CentOS thinks it's in a virtual machine and the IPs of the virtual bridge and my router are too similar or something? Only theorizing.

User avatar
TrevorH
Site Admin
Posts: 33220
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: First time setting up an internet connection in a linux distro

Post by TrevorH » 2017/02/17 14:21:55

Run lspci -nn | grep -i net and post the results. It appears your hardware is not being recognised.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply