0

I am using Ubuntu 16.04 and I can't connect to internet via ethernet.I am able to connect through wireless network.I also use a dual boot with Windows 10 and I can connect through both methods on Windowsm using a pppoe connection to accomplish it via ethernet.

$ ifconfig
enp4s0f1  Link encap:Ethernet  HWaddr d0:17:c2:07:ef:39  
          inet6 addr: fe80::e67d:6fbb:5a45:c0f2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:475 errors:0 dropped:0 overruns:0 frame:0
          TX packets:874 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:58686 (58.6 KB)  TX bytes:158070 (158.0 KB)

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:841 errors:0 dropped:0 overruns:0 frame:0
          TX packets:841 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:91232 (91.2 KB)  TX bytes:91232 (91.2 KB)

wlp3s0    Link encap:Ethernet  HWaddr 74:c6:3b:11:3e:f7  
          inet addr:192.168.185.101  Bcast:192.168.185.255  Mask:255.255.255.0
          inet6 addr: fe80::8d65:aaae:789a:fab8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:422545 errors:0 dropped:0 overruns:0 frame:0
          TX packets:170091 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:627525820 (627.5 MB)  TX bytes:17005893 (17.0 MB)

Here is the content of my /etc/network/interfaces file:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

The results of running iwconfig :

`enp4s0f1  no wireless extensions.

lo        no wireless extensions.

wlp3s0    IEEE 802.11bgn  ESSID:"...."  
          Mode:Managed  Frequency:2.462 GHz  Access Point: 82:B9:A5:DB:36:8F   
          Bit Rate=65 Mb/s   Tx-Power=16 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=63/70  Signal level=-47 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:3  Invalid misc:342   Missed beacon:0.

The result of lspci -nnk | grep -iEA3 "(network|wireless|ethernet)"

03:00.0 Network controller [0280]: Qualcomm Atheros QCA9565 / AR9565 Wireless Network Adapter [168c:0036] (rev 01)
    Subsystem: AzureWave QCA9565 / AR9565 Wireless Network Adapter [1a3b:2130]
    Kernel driver in use: ath9k
    Kernel modules: ath9k
04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device [10ec:5287] (rev 01)
--
04:00.1 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 12)
    Subsystem: ASUSTeK Computer Inc. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [1043:200f]
    Kernel driver in use: r8169
    Kernel modules: r8169

The result of cat /etc/dhcp/dhclient.conf

# Configuration file for /sbin/dhclient.
#
# This is a sample configuration file for dhclient. See dhclient.conf's
#   man page for more information about the syntax of this file
#   and a more comprehensive list of the parameters understood by
#   dhclient.
#
# Normally, if the DHCP server provides reasonable information and does
#   not leave anything out (like the domain name, for example), then
#   few changes must be made to this file, if any.
#

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
    domain-name, domain-name-servers, domain-search, host-name,
    dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
    netbios-name-servers, netbios-scope, interface-mtu,
    rfc3442-classless-static-routes, ntp-servers;

#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
#send dhcp-lease-time 3600;
#supersede domain-name "fugue.com home.vix.com";
#prepend domain-name-servers 127.0.0.1;
#require subnet-mask, domain-name-servers;
timeout 300;
#retry 60;
#reboot 10;
#select-timeout 5;
#initial-interval 2;
#script "/sbin/dhclient-script";
#media "-link0 -link1 -link2", "link0 link1";
#reject 192.33.137.209;

#alias {
#  interface "eth0";
#  fixed-address 192.5.5.213;
#  option subnet-mask 255.255.255.255;
#}

#lease {
#  interface "eth0";
#  fixed-address 192.33.137.200;
#  medium "link0 link1";
#  option host-name "andare.swiftmedia.com";
#  option subnet-mask 255.255.255.0;
#  option broadcast-address 192.33.137.255;
#  option routers 192.33.137.250;
#  option domain-name-servers 127.0.0.1;
#  renew 2 2000/1/12 00:00:01;
#  rebind 2 2000/1/12 00:00:01;
#  expire 2 2000/1/12 00:00:01;
#}

I have tried various methods I found on the internet in oreder to fix this such as adding auto enp4s0f1 iface enp4s0f1,ignoring IPv6 , sudo service network-manager restart. I recently reinstalled Ubuntu. I have tested multiple ethernet cables from different routers and none work. As said it works just fine on windows.

Edit: Here are the results for sudo dhclient -v -r and sudo dhclient -v

~$ sudo dhclient -v -r enp4s0f1
Killed old client process
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https:*no space for this link :D*

Listening on LPF/enp4s0f1/d0:17:c2:07:ef:39
Sending on   LPF/enp4s0f1/d0:17:c2:07:ef:39
Sending on   Socket/fallback


~$ sudo dhclient -v enp4s0f1
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/enp4s0f1/d0:17:c2:07:ef:39
Sending on   LPF/enp4s0f1/d0:17:c2:07:ef:39
Sending on   Socket/fallback
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 3 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 7 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 16 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 19 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 21 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 16 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 21 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 7 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 9 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 11 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 11 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 11 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 16 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 10 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 15 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 14 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 14 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 21 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 20 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 19 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 8 (xid=0x9dffd378)
DHCPDISCOVER on enp4s0f1 to 255.255.255.255 port 67 interval 12 (xid=0x9dffd378)
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

Images regarding my internet state (from the network manager) :https://i.stack.imgur.com/1A6sO.jpg

I am a Linux newbie and I am unable to solve this. Please include detailed answers if it is possible. Thank you!

2 Answers2

0

The r8169 driver that your ethernet port is using is buggy. You need to use the r8168-dkms driver.

To install it, start Synaptic from the Unity dash. Click the RELOAD icon, then the SEARCH icon, enter r8168-dkms, in the results pane, mark this item for install, click the APPLY icon. If it wants/needs to also install dkms, approve it.

You may also wish to look at How to connect to internet using wired PPPOE connection? for more info.

Let us know how you do. Cheers, Al

heynnema
  • 70,711
  • Thank you for your answer. Unfortunatelly it still does not connect via ethernet. It says it is connecting, but it never finishes the operation. Is there any other data I can provide? – Roman Gabriel Oct 06 '16 at 08:19
  • 1
    How is your ethernet cable wired? To a switch? Directly to a dsl/cable modem? Which? Did you look at the link that I left for you? Can you include screenshots of your configuration for Wired Connection in your question? Cheers, Al – heynnema Oct 06 '16 at 15:12
  • Hello, Al. My cable is connected to a switch. Yes, I did look at the link you sent me, thank you.I will include the images right away. – Roman Gabriel Oct 06 '16 at 19:13
  • Had one like this just a few days ago. For testing purposes, bypass the switch, and connect your ethernet port DIRECTLY to your dsl/cable modem, and see if it connects now. (You may have to power cycle the modem, and reboot your computer). Cheers, Al – heynnema Oct 06 '16 at 20:07
  • I will try as soon as I can. I share a living space with some people and I need to wait for them to leave to do so. Will give you the result. Thanks for answering. – Roman Gabriel Oct 06 '16 at 20:15
  • And, you have the r8168-dkms driver installed now, yes? Cheers, Al – heynnema Oct 06 '16 at 20:16
  • Yes, I did as you instructed. – Roman Gabriel Oct 06 '16 at 21:29
  • Change your IPv6 setting to Automatic (DHCP) or Ignore. Let me know the results of testing when directly connected to your modem. Cheers, Al – heynnema Oct 07 '16 at 06:53
  • It still does not work. I think it is the same situation. Also my room mate also can't connect to ethernet on ubuntu. Could the switch be defectuous? We are both using asus laptops, diferent models. – Roman Gabriel Oct 07 '16 at 18:06
  • Did you wire your computer directly to the dsl/cable modem as I suggested a few comments back? Make sure you power cycle the modem, and reboot your computer. Report back. Cheers, Al – heynnema Oct 07 '16 at 22:14
  • @RomanGabriel I'm still waiting to hear if ethernet works when connected directly to your dsl/cable modem. Please remember to vote/accept my answer if it was helpful. Cheers, Al – heynnema Oct 09 '16 at 20:03
  • Sorry for not replying for such a long time, I left with a college project for a week. I wrote a response to you back but I do not know how I did not post it. Anyway, it did not work. I since gave up and moved to a virtual machine. Thank for all the help though. – Roman Gabriel Oct 17 '16 at 16:14
0

enp4s0f1 (wired interface) doesn't have an IP4 address while wlp3s0 (wireless interface) does. Perhaps this is the source of your difficulty.

Note that this answer is not version/driver specific. Tested under 14.04 with the atl1c driver and 16.04 with the r8169 driver

First insure that network manager is set to receive an IP4 address: Open Network Connections Choose your Ethernet connection and click edit. Change it as necessary so that it looks like this on the IPV4 settings tab: The Method is the important part (the checkbox won't hurt either)

IPV4

Click Save, then Close - Then issue the following commands in the terminal

sudo dhclient -v -r enp4s0f1
sudo dhclient -v enp4s0f1

As an alternate approach you can change the method to Manual and use a static IP address in the form 192.168.185.x (where x is an address on your network not given out by your routers dhcp pool)

Sources:

http://www.cyberciti.biz/faq/howto-linux-renew-dhcp-client-ip-address/

Testing

Elder Geek
  • 36,023
  • 25
  • 98
  • 183
  • Hi.It seems to have worked, wired network appears connected. http://imgur.com/H5v9q5I . I will edit my question to include the result of the two instructions. Is it safe now to try to connect to pppoe with pppoeconf? – Roman Gabriel Oct 06 '16 at 19:05
  • I was too hasty to respond. The network stops working after I restart but running the commands again bring it back on. Also after running those commands I get this networks :http://imgur.com/mZnK8gj . Still I would like to try to connect to pppoe with pppoeconf, would that be ok? – Roman Gabriel Oct 06 '16 at 19:57
  • I always say "Everything is safe if you backup first." – Elder Geek Oct 06 '16 at 20:12
  • Upon reviewing your image, it's clear that you didn't get a valid address via DHCP. Is your wireless connecting to your network or someone elses? – Elder Geek Oct 06 '16 at 20:20
  • My wireless connects without problem. I do not own a wireless router.I use a switch. ** But please keep in mind that those pictures were taken before running the commands your recommended me**. – Roman Gabriel Oct 06 '16 at 20:25
  • No I mean this one. http://imgur.com/mZnK8gj from after running the commands – Elder Geek Oct 06 '16 at 20:35
  • If you don't have a wireless router how are you connecting via wireless? Whos AP is Access Point: 82:B9:A5:DB:36:8F? – Elder Geek Oct 06 '16 at 20:41
  • Sometimes I make a hot spot on my phone for wireless connection. Also my room mate sometimes makes a hot spot for me from his laptop through Connectify. Anyway I think I will back up and try to connect to pppoe. – Roman Gabriel Oct 06 '16 at 20:57
  • So after I run the dhclient commands, a new wired network is created. I connected to pppoe, but still it does not let me acces the internet.http://imgur.com/a/wN76E .Should I add additional informations? – Roman Gabriel Oct 07 '16 at 11:02