2

I have been working on this new freshly installed Debian machine for quite some time now trying to get the network going so I have internet. During the installation process for the network configuration I said I'll "configure it later" as it couldn't do it on its own. So here I am.

I have seen and tried this question + answer, but no luck

Let's get to it.

I am unable to ping anything and I can't do "apt-get" and it's frustrating as hell.

My /etc/network/interfaces looks like this:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static

My /etc/resolv.conf contains:

nameserver 192.168.1.1

I am extremely stuck and don't know the next course of action as I cannot find a way to figure this out. Any help is highly appreciated.

Thanks

EDIT

This is my ifconfig -a when I'm plugged in using an ethernet cable.

eth0      Link encap:Ethernet  HWaddr 2c:60:0c:82:76:d7  
          inet addr:192.168.1.73  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::2e60:cff:fe82:76d7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5417 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1539 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:7425280 (7.0 MiB)  TX bytes:152728 (149.1 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:103 errors:0 dropped:0 overruns:0 frame:0
          TX packets:103 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:9013 (8.8 KiB)  TX bytes:9013 (8.8 KiB)
1
  • 1
    Try to activate eth0 ip link set eth0 up and check the result ip link show dev eth0.
    – GAD3R
    Apr 22, 2016 at 12:49

3 Answers 3

2

Your tag indicates that you are trying to setup a wireless connection. This is not as straight-forward as connecting per cable. (You should try that first though - see Oleg's answer).

If you are using a wireless network card it is also likely you are running a notebook. You then should install a desktop (like GNOME, Cinnamon, KDE,...) and use the network-manager. (But you did not provide any details on your setup, so I am just guessing.)

List your network devices. This should look something like this:

% lspci | grep -e "Ethernet\|Network"
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] (rev 34)

You mentioned a Lenovo Thinkpad (which model?) which also should have a Intel wireless adapter. Unfortunately do the Intel wireless adapters not work out of the box in Debian/Jessie. You need the firmware-iwlwifi package from the non-free section.

Check your apt-sources for non-free first:

deb     http://http.debian.net/debian jessie main contrib non-free

(if you have a very new Thinkpad you might also have to activate jessie-backports).

And install firmware-iwlwifi:

apt-get install firmware-iwlwifi

Reboot you notebook and the wireless adapter should be visible in the network-manager in KDE.

But if you really want to go wireless by using the command line, here we go...

List your network devices. Should look like this:

% ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 3c:dd:0e:68:43:d4 brd ff:ff:ff:ff:ff:ff
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000
    link/ether 8d:dd:4b:04:15:84 brd ff:ff:ff:ff:ff:ff

Bring up your wireless adapter:

ip link set wlan0 up

Find your wireless network (SSID):

iwlist wlan0 scanning
iwlist wlan0 scanning | grep ESSID # just shows the available SSIDs

I also assume you have WPA-PSK enabled so you must setup it up. Run

wpa_passphrase myessid secretsecret

and you'll get something like this:

network={
    ssid="myessid"
    #psk="secretsecret"
    psk=a022d0c8f88de93e4b53e5ee1c5d98cd4171a15bd44cde7499faa294ad795211
}

Then edit your /etc/network/interfaces:

auto wlan0
iface wlan0 inet dhcp
        wpa-ssid myessid
        wpa-psk a022d0c8f88de93e4b53e5ee1c5d98cd4171a15bd44cde7499faa294ad795211

Bring up the device with:

ifup wlan0

See:

HTH

2
  • Hello, thanks for the response. However I am running a Lenovo Thinkpad and I'm using KDE (as requested by from a friend). When I type "ip link", I only have the 1. lo and 2. eth0 showing up, I don't have wlan0 being displayed. How can I fix this?
    – ex8
    Apr 22, 2016 at 18:14
  • Which Lenovo Thinkpad do you have? You might need firmware-iwlwifi. I updated my answer.
    – dpat
    Apr 24, 2016 at 11:45
0

Try this setting in /etc/network/interfaces to get all nesseccary network data automatically from you router via DHCP:

iface eth0 inet dhcp

Then restart your interface as a root:

ifdown eth0
ifup eth0
8
  • I first tried this as requested from dpat, when I type "ifdown eth0" I get the message: "ifdown: interface eth0 not configured"
    – ex8
    Apr 22, 2016 at 18:10
  • Well, check that you plugged an Ethernet cable to your PC and try ifconfig eth0 down. Then Ifup eth0. If nothing helps just reboot. And show ifconfig -a output, please. Apr 22, 2016 at 18:23
  • Ok so its plugged in with an Ethernet cable and I tried it again and its working. How can I get it so I can connect to a wireless connection now? Btw thanks for the help!
    – ex8
    Apr 22, 2016 at 18:53
  • Not at all, thanks to all who answered here. Show ifconfig -a to see if there are a wlan interface and follow instructions from dpat to set it up. Apr 22, 2016 at 19:00
  • I have added my output of "ifconfig -a" to the original post (it was too long for the comment box lol). Also I see no wlan interface :(. How do I add one?
    – ex8
    Apr 22, 2016 at 19:07
0

I belive there is many ways to do this here is one thing you could try.

First make sure you have a backup before you start elaborate

mv /etc/network/interfaces /etc/network/interfaces.bak

then to edit the interfaces
nano /etc/network/interfaces

one example could be like this if's set to static:

iface eth0 inet static
    address 192.168.0.100
    netmask 255.255.255.0   
    network 192.168.0.0 
    broadcast 192.168.0.255
    gateway 192.168.0.1

to restart the network interface:

/etc/init.d/networking restart

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .