Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
No network after fresh install [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
motaito
Tux's lil' helper
Tux's lil' helper


Joined: 28 May 2014
Posts: 102

PostPosted: Mon Jun 02, 2014 6:43 pm    Post subject: No network after fresh install [SOLVED] Reply with quote

Hi guys,

I installed gentoo in a virtual box and it worked quite well. So, I decided to install it on a notebook (MSI GT60). While booting the output shows some errors at the end, but it passes by too quickly to read. Afterwards I have no network connection. So, I have the following two questions:

1. How can I read the boot log after the system started up?

2. How do I get the network to run?

Here is some more info for the network question:

#ping www.google.com
ping: unknown host www.google.com

#ping 8.8.8.8
connect: Network is unreachable

#ifconfig eth0
eth0: error fetching interface information: Device not found

#ifconfig -a
lo: flags73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 0 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

I have emerged dhcpcd but it does not start automatically even though I added it to the default runlevel. If I start it the result is the same. I had no problem with the network while installing. Since I am new to gentoo I used genkernel all, if that makes any difference.

I have the following configuration in the files:
file: /etc/conf.d/hostname
hostname="GentooBox"

file: /etc/hosts
127.0.0.1 GentooBox localhost

file: /etc/conf.d/net
config_eth0="dhcp"

I also run:
cd /etc/init.d
ln -s net.lo net.eth0
rc-update add net.eth0 default

Does anyone have a hint for me what to do?

Thanks in advance for any input.


Last edited by motaito on Tue Jun 03, 2014 5:04 pm; edited 1 time in total
Back to top
View user's profile Send private message
Pearlseattle
Apprentice
Apprentice


Joined: 04 Oct 2007
Posts: 162
Location: Switzerland

PostPosted: Mon Jun 02, 2014 7:15 pm    Post subject: Reply with quote

Hi

Seeing the messages shown during boot is extremely important.

Quote:
1. How can I read the boot log after the system started up?

That they disappear just before the login prompt is shown is due to a stupid change in the "agetty" SW (or was an update to inittab getting rid of that option? Don't remember anymore...) that happened some years ago.
To change that behaviour edit the file "/etc/inittab" and add the option "--noclear" to all terminal lines
You probably have now something like this...
Code:

# TERMINALS
c1:12345:respawn:/sbin/agetty 38400 tty1 linux
c2:2345:respawn:/sbin/agetty 38400 tty2 linux
c3:2345:respawn:/sbin/agetty 38400 tty3 linux
c4:2345:respawn:/sbin/agetty 38400 tty4 linux
c5:2345:respawn:/sbin/agetty 38400 tty5 linux
c6:2345:respawn:/sbin/agetty 38400 tty6 linux

...which will look like this after the change:
Code:

# TERMINALS
c1:12345:respawn:/sbin/agetty --noclear 38400 tty1 linux
c2:2345:respawn:/sbin/agetty --noclear 38400 tty2 linux
c3:2345:respawn:/sbin/agetty --noclear 38400 tty3 linux
c4:2345:respawn:/sbin/agetty --noclear 38400 tty4 linux
c5:2345:respawn:/sbin/agetty --noclear 38400 tty5 linux
c6:2345:respawn:/sbin/agetty --noclear 38400 tty6 linux

This will avoid that the system clears what you see on screen just before that you get the login prompt.


Quote:
2. How do I get the network to run?

If when running the command "ifconfig -a" you don't see your network card / NIC then you're lacking the driver/module to make it work (as long as you don't see it you can stop with other attempts involving pings, dhcp, etc...) => this in turn is dependent on how you compiled your kernel and what kind of NIC you have.

1)
Run "lspci -k" (part of the package "pciutils").
This will print the list of hardware that you have (and any kernel module that is used to talk to the specific hardware components).

2)
Checking the output of "lspci -k" search for your network card => you should see a model => check that you compiled the kernel module for that particular network card. You might have to do some research as often single kernel modules are able to handle multiple models.

If you think that you already compiled the correct module, have a look at the output of the command "dmesg" and search for lines that are related to the module (e.g. with "dmesg | grep -i mymod")


Please post here as much as you can of "lspci" and "dmesg" and the errors you see during bootup.
Am I right thinking that the NIC that you're trying to make work is not a wireless one?

Cheers

p.s.: recently the NICs are not called anymore e.g. "eth0" but have some weird names which are supposed to make life easier - if you don't like it and want to stick to the old names then add to the kernel the option "net.ifnames=0" to get back the normal names "eth0", "wlan0", etc... .
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1770

PostPosted: Mon Jun 02, 2014 8:08 pm    Post subject: Reply with quote

start with `ifconfig -a`, if it finds any interfaces try bring them up and configure them. If not you most likely don't have moduels you need installed, and you have to actually do what Pearlseattle says about looking for your network device
Also, shift+page up/shift+page down allow you to scroll in text mode. Console's buffer isn't very big, but should be enough to see boot again.
Back to top
View user's profile Send private message
motaito
Tux's lil' helper
Tux's lil' helper


Joined: 28 May 2014
Posts: 102

PostPosted: Mon Jun 02, 2014 8:31 pm    Post subject: Reply with quote

Hi

Thanks for your input. In the gentoo handbook they mention that genkernel all will configure the kernel nearly as the installation CD. That's why I am surprised that the network works while installing but not afterwards. During install eth0 works just fine. (net-setup eth0 worked also)

You write to add "net.ifnames=0" to the kernel options. I am a bit of a linux/gentoo noob. So, how would I do that? Is there a config file? I have only been using "make menuconfig" to adjust anything kernel related. Also, I think the problem is rather a missing module. Not sure though.

I don't have lspci available. I will try to install from the liveCD. I let you know if I was successful. I may have to replay again tomorrow evening though. Got work tomorrow...

I did not use dmesg as I have no clue what module I am looking for.

As for the boot message. It worked but did not give new information from what I can tell.

ERROR: interface eth0 does not exist
Ensure that you have loaded the correct kernel module for your hardware
ERROR: net.eth0 failed to start
ERROR: cannot start netmount as net.eth0 would not start

Also, I am trying to make a wired connection. I don't worry about wireless for now.

edit:
@szatox
You answerd just before I posted my reply :)
Thanks for the tip about scrolling up and down. I was just wondering about that :D
As for the output of "ifconfig -a" see my original post.
Back to top
View user's profile Send private message
motaito
Tux's lil' helper
Tux's lil' helper


Joined: 28 May 2014
Posts: 102

PostPosted: Mon Jun 02, 2014 9:05 pm    Post subject: Reply with quote

Ok, I managed to install lspci.

Running "lspci -k" gives me this:
Code:
Ethernet controller: Qualcomm Atheros Killer E2200 Gigabit Ethernet Controller (rev13)
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 10c7

Network controller: Intel Corporation Centrino Wireless-N 135 (rev c4)
Subsystem: Intel Corporation Centrino Wireless-N 135 BGN
Kernel modules: iwlwifi


That's all the info about any network I could find. Like I mentioned in my previous post, I don't currently care for wireless. Given the info above, I don't quite get which kernel module I need. Well, I get back to it tomorrow evening.

Thanks for all the input so far.
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 634

PostPosted: Mon Jun 02, 2014 10:02 pm    Post subject: Reply with quote

I googled a little, looks like some people have had mixed results with the atheros alx driver.
Back to top
View user's profile Send private message
Pearlseattle
Apprentice
Apprentice


Joined: 04 Oct 2007
Posts: 162
Location: Switzerland

PostPosted: Mon Jun 02, 2014 10:04 pm    Post subject: Reply with quote

So you have a "Atheros Killer E2200" NIC => doing a search I get this.
So the module seems to be the one called "alx", but they all got kernel patches - not sure how to explain things from here on, and it's going to take some time.

First question:
When you use "genkernel" what do you get by issuing "uname -a" and "ls -lh /usr/src/"?

Thx
p.s.: I hate genkernel
Back to top
View user's profile Send private message
Pearlseattle
Apprentice
Apprentice


Joined: 04 Oct 2007
Posts: 162
Location: Switzerland

PostPosted: Mon Jun 02, 2014 10:16 pm    Post subject: Reply with quote

russK wrote:
I googled a little, looks like some people have had mixed results with the atheros alx driver.

It' incredible - you would think that it's cheaper to buy & use an established chipset but companies keep on putting on the market different proprietary chips - incredible... .
Back to top
View user's profile Send private message
motaito
Tux's lil' helper
Tux's lil' helper


Joined: 28 May 2014
Posts: 102

PostPosted: Tue Jun 03, 2014 7:11 am    Post subject: Reply with quote

Thanks for the help!

I am at work right now but will try as soon as I get back home. I think the card must work since I had no problem during the installation process. Also, I had manjaro installed prior and no problem with the network (wired and wireless). I'm thinking it must be a matter of finding the right module but I might be wrong. I will search for the atheros alx driver first before trying out some patch. I'll send the "uname -a" and "ls -lh /usr/src/" results as soon as I am back home.
Back to top
View user's profile Send private message
motaito
Tux's lil' helper
Tux's lil' helper


Joined: 28 May 2014
Posts: 102

PostPosted: Tue Jun 03, 2014 5:04 pm    Post subject: Reply with quote

You have been asking about "uname -a" and "ls -lh /usr/src/"

#uname -a
Linux moe 3.12.20-gentoo #1 SMP Tue Jun 3 18:12:55 CEST 2014 x86_64 Intel(R) Core(TM) i7-3630QM CPU @ 2.40Ghz GenuineIntel GNU/Linux

#ls -lh /usr/src/
total 4.0k
lrwxrwxrwx 1 root root 20 Jun 2 18:59 linux -> linux-3.12.20-gentoo
drwxr-xr-x 25 root root 4.0k Jun 3 18:21 linux-3.12.20-gentoo


However, I figured it out thanks to your previous help. Here is what I did in case it might help someone else.

Code:
# cd /usr/src/linux
# make menuconfig

--> Here I searched for alx. Took me about 20 minutes until I noticed that there is a search function built in :oops: I enabled the Qualcomm Atheros part (all available modules). Then I tried to build the kernel but got some errors.

I decided to basicall start again and did

Code:
# genkernel all

--> reboot

Code:
# cd /usr/src/linux
# make menuconfig

--> enable alx drivers again (all available modules)

Code:
# make && make modules_install
# make install

--> reboot

Code:
# ls /sys/class/net
enp3s0 lo

--> so the network card is called enp3s0 not eth0

Code:
# nano -w /etc/conf.d/net

--> filled in my settings most importantly config_enp3s0="dhcp"

Code:
# nano -w /etc/conf.d/hostname

--> filled in my settings

Code:
# nano -w /etc/hosts

--> filled in my settings

Code:
# ln -s net.lo net.enp3s0
# rm net.eth0
# rc-update add net.enp3s0 default

--> reboot

And I have a connection! I am all wired up now and have no more errors while booting.

Thanks a lot for the info and the assistance!
Back to top
View user's profile Send private message
Pearlseattle
Apprentice
Apprentice


Joined: 04 Oct 2007
Posts: 162
Location: Switzerland

PostPosted: Wed Jun 04, 2014 9:10 pm    Post subject: Reply with quote

Eeeeeeeeehhhhhhhhhhhh, you bent the system to your will - congratulations!!!!!!!!!
You have just learned quite a lot about Linux :D

Quote:
Took me about 20 minutes until I noticed that there is a search function built in

It took me 2 years to notice that.

Quote:
You write to add "net.ifnames=0" to the kernel options. I am a bit of a linux/gentoo noob. So, how would I do that?

This is very important, and how you do it depends on the bootloader that you use.
Basically: you have to pass that (and potentially more) parameter/s to your kernel.
If you use grub2 you add the parameter/s in "/etc/default/grub" to the line "GRUB_CMDLINE_LINUX_DEFAULT" and then run in theory "grub2-mkconfig -o /boot/grub/grub.cfg" (I am new myself to grub2).
If you use grub1 or older, you just edit the file "/boot/grub/grub.conf" and add it to the line which starts with "kernel" - example:
====================
title=Gentoo Linux 3.10.7-gentoo-r1
root (hd0,0)
kernel /kernel-3.10.7-gentoo-r1 root=/dev/sda3 net.ifnames=0 drm_kms_helper.edid_firmware=edid/edid-syncmaster931bw.bin acpi_enforce_resources=lax pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 acpi_backlight=vendor intel_iommu=on
====================
As you can see I had to add other options to force a specific resolution on my external monitor, make the Intel GPU use less power and other stuff => you'll probably have to do it soon or later.

As you see you might end up using multiple parameters, and you just keep on adding them.

No clue about Lilo as bootloader.

Cheers
Back to top
View user's profile Send private message
motaito
Tux's lil' helper
Tux's lil' helper


Joined: 28 May 2014
Posts: 102

PostPosted: Wed Jun 04, 2014 9:45 pm    Post subject: Reply with quote

The key was finding out about the alx driver. In hindsight it seams obvious but at the time the problem was really confusing :) I don't think I would have come to that conclusion without the input from the previous posts. Because the network connection worked during install.

Thanks for the additional input. I am sure I will need it sooner or later. Right now I'm using GRUB2. Seams to work nice and it's not too complicated to set up as a beginner.
Back to top
View user's profile Send private message
Pearlseattle
Apprentice
Apprentice


Joined: 04 Oct 2007
Posts: 162
Location: Switzerland

PostPosted: Wed Jun 04, 2014 10:17 pm    Post subject: Reply with quote

You're welcome! :D

Quote:
Right now I'm using GRUB2. Seams to work nice and it's not too complicated to set up as a beginner.

I'm just worried of when "grub2-mkconfig" will stop working for whichever reasons (executable corrupted, whichever settings it tries to read won't be as it expects them to be, etc...) or when "grub2-mkconfig" will decide to just write rubbish to my config => then I'll be kind of screwed as the "/boot/grub/grub.cfg" that it writes is quite complex with functions and a lot of other stuff.

During the next months I'll try to shrink down the grub2-"grub.cfg" as much as I can to see if I can then handle it without the "grub2-mkconfig".

My world was happy before the advent of grub2, systemd and secureboot.
Now I feel like having been teleported back to the 90', having no clue about everything :(
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum