# Kernel installed, can't connect to WiFi

## StupidBunny

About a week ago, I posted this thread seeking help installing Gentoo (thanks to those who helped, by the way!) and now I'm back with more noob problems.  In particular, I have reached this point.  The kernel has been successfully built, and I've booted into it, but at this point I am stuck.  I've rebooted twice, and each time have started DHCP, which has assigned the "wlp2s0" interface an IPv6 address, but no IPv4 address.

Using both ping and ping6 returns nothing: I variously get "connect: Invalid argument", when I ping6 the IPv6 address I'm given; "connect: Cannot assign requested address", when I ping6 -I wlp2s0 that address, or the IPv6 address which ifconfig gives me for the computer I'm typing this on; "unknown host" when I ping or ping6 google.com, gentoo.org or any other website.  If I ping -I wlp2s0 the IPv4 address for the laptop I'm typing this on, it pings the specified number of times from 127.0.0.1 (address for "lo"), returning "Destination Host Unreachable."

Entering "ip addr show lo" returns 127.0.0.1/8 for the inet address, and ::1/128 for the inet6.  I'm stumped as to why I can't connect, and hope somebody here has a guess as to what the problem is.

Thanks everybody.  I'm already learning a lot doing this.  :Smile: 

----------

## Abraxas

A couple of issues that I have noticed.  You did not mention any attempt to actually CONNECT to an AP.  DHCP will get you nothing if you are not associated with an AP.  Additionally 127.0.0.1 is the loopback address of the computer.  You will always have this address as long as networking is enabled and does not signify that your network connection is working.  Please post the complete output of ifconfig.  Also you will need something like wpa_supplicant to associate with an AP with encryption enabled.  If no encryption is enabled I think you can just use the "iw" command to associate.  To be honest I have been using NetworkManager for years now to eliminate this hassle.

----------

## NeddySeagoon

StupidBunny,

There are no real noob problems.  They are just the problems that you happen to encounter first.

You don't say how you configured your kernel, nor what wifi interface you have.  We won't guess at solutions.  Even if it works it won't help your understanding of the problem solving process.  Lets start at the beginning.

If your WiFi is on the PCI bus it will appear it the output of lspci, so post the output of lspci, or at least, the wifi line.

If your WiFi is a USB device, it will appear in the output of lsusb.

If its in neither, its disabled in the BIOS or faulty.

That you have a device called wlp2s0 is encouraging.  It suggests that you have the correct kernel option selected for your WiFi.

Some WiFi cards need firmware. We need to determine if your card is one of these and if so, is the firmware being loaded.

Once we know your hardware, (lspci?) we will also know the firmware requirement.

Look in 

```
dmesg | less
```

it may tell you about firmware loading/failing to load.  That's useful information too.

Once you can boot and get your interface to appear in 

```
ifconfig -a
```

 and no firmware errors in dmesg, your WiFi interface will work.

After that, it using the user space tools to associate and authenticate so that dhcpcd or whatever can get an IP address.

----------

## StupidBunny

Thanks for the quick replies.

I imagine the relevant line of output from lspci is

```

02:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24)

```

And some possibly-relevant lines of output from dmesg:

```

...

[   6.524942] Intel(R) Wireless WiFi driver for Linux

...

[   6.562279] iwlwifi 0000:02:00.0: can't disable ASPM; OS doesn't have ASPM control

...

[   6.601001] iwlwifi 0000:02:00.0: loaded firmware version 18.168.6.1 op_mode iwldvm

...

[   6.620316] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEBUG enabled

[   6.620340] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEBUGFS enabled

[   6.620359] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEVICE_TRACING disabled

[   6.620380] iwlwifi 0000:02:00.0: Detected Intel(R) Centrino(R) Advanced-N 6235 AGN, REV=0xB0

[   6.620541] iwlwifi 0000:02:00.0: L1 Enabled - LTR Disabled

...

[ 131.776551] iwlwifi 0000:02:00.0 wlp2s0: renamed from wlan0

[ 133.495401] iwlwifi 0000:02:00.0: L1 Enabled - LTR Disabled

[ 133.502095] iwlwifi 0000:02:00.0: Radio type=0x2-0x1-0x0

[ 133.799116] iwlwifi 0000:02:00.0: L1 Enabled - LTR Disabled

[ 133.805914] iwlwifi 0000:02:00.0: Radio type=0x2-0x1-0x0

[ 550.197190] dhcpcd[1956]: segfault at 7ffc00000000 ip 00007fdc2011497a sp 00007ffcfd02a648 error 4 in libc-2.21.so[7fdc20084000+191000]

```

But it looks like the problem was with wpa_supplicant, or really the lack thereof.  I entered

```

wpa_supplicant -Dn180211,wext -iwlp2s0 -c/etc/wpa_supplicant/wpa_supplicant.conf

```

...and now I have IPv4 address, and a working network connection!

EDIT:  ...but now I can't SSH into it from my other computer, because I've forgotten the password I made in chroot prior to rebooting.  (It's not the root password, it seems.)  Oops.

EDIT:  Upon further research, it seems like the password I made in chroot is (or should be) the root password that I've used to successfully log in to the target machine.  I'm trying to figure out now why else the password may not be working.  When I try to ssh into the target machine, I attempt the root password 3 times, then am told:

```
Permission denied (publickey,keyboard-interactive).
```

----------

## NeddySeagoon

StupidBunny,

By default, sshd no longer allows password root logins.

If you want to ssh as root you need to edit the sshd_config file or use keys.

ssh will go through the login motions, even with the right password but always refuse the connection.

Don't forget to restart sshd if you edit sshd_config.

----------

