3

I have a wired ADSL connection with a modem-cum-router. I generally connect to the internet using PPPoE i.e. the router itself establishes the connection with my ISP as soon as I switch it on. And the router being connected to my PC using ethernet cable provides the internet to it without any further configuration in Ubuntu.

However, yesterday I was facing some issues with the router so I switched it to the DSL (Bridging) mode. This setup requires me to use sudo pppoeconf to let Ubuntu know my ISP username and password so that it can make the connection with ISP. The internet was fine during the session after making the changes.

But, after a reboot, Ubuntu can't access the internet anymore. So, I once again switched my router to PPPoE mode and the internet works fine on my dual-boot Windows 7 but not on Ubuntu. Even after making this change (i.e. reverting to the situation which was working all along) I am not able to access the internet using Ubuntu. However, I can see that I have been allotted the IPv4 address by my ISP.

Following are some of the troubleshooting steps (while in PPPoE mode), that I took:

$ ifconfig
eth0      Link encap:Ethernet  HWaddr 94:de:80:34:47:7b
          inet6 addr: fe80::96de:80ff:fe34:477b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:33 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:78 (78.0 B)  TX bytes:4642 (4.6 KB)
          Interrupt:18

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:107 errors:0 dropped:0 overruns:0 frame:0
          TX packets:107 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:7923 (7.9 KB)  TX bytes:7923 (7.9 KB)

$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

$ ping -c 1 www.google.com
ping: unknown host www.google.com

Then, I tried to once again run sudo pppoeconf, which gave me the following output (I have tried this in both PPPoE as well as Bridging modes):

output of sudo pppoeconf

Seeing that the output of route was nothing, I ran:

$ sudo route add -net 192.168.1.0 netmask 255.255.255.0 dev eth0

$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

But this didn't help much.

$ ping -c 1 www.google.com
ping: unknown host www.google.com

$ ping -c 1 8.8.8.8
connect: Network is unreachable

$ dig @8.8.8.8    
; <<>> DiG 9.9.5-3-Ubuntu <<>> @8.8.8.8
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

The nameservers seem to be fine to me:

$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.4.4

$ cat /etc/resolvconf/resolv.conf.d/head
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.4.4

I tried to access my modem configuration page on 192.168.1.1, but I wasn't able to connect to it. I had to change the modem's gateway using the following to be able to access it (earlier when everything was working fine, I didn't need to make any change to be able to access this page):

sudo ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up

Running the diagnostic tests on my modem on both Ubuntu and Windows gives this output:

Modem's diagnostic tests

Everything is working as it should on my Windows 7 dual-boot system, but not on Ubuntu GNOME 14.04 anymore.

I have tried running Ubuntu using Live USB, and internet works fine on it as well.

Why am I not able to access the internet even though IPv4 address has been allotted by ISP? What do I need to do to be able to access the internet on Ubuntu?

My /etc/networking/interfaces:

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

auto dsl-provider
iface dsl-provider inet ppp
pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf
provider dsl-provider

auto eth0
iface eth0 inet manual

Following is the dmesg output while unplugging and re-plugging the ethernet cable:

$ dmesg | tail -2
[  187.051150] alx 0000:02:00.0 eth0: Link Down
[  214.085755] alx 0000:02:00.0 eth0: NIC Up: 100 Mbps Full

I have edited my /etc/network/interfaces as follows:

$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

#auto dsl-provider
#iface dsl-provider inet ppp
#pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf
#provider dsl-provider

#auto eth0
#iface eth0 inet manual

auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.1

If I run sudo dhclient -d -v -nw eth0 on every reboot, it works sometimes and doesn't at other times. It's very random. Following is the ouput when it works:

$ sudo dhclient -d -v -nw eth0
Internet Systems Consortium DHCP Client 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/94:de:80:34:47:7b
Sending on   LPF/eth0/94:de:80:34:47:7b
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0x51e3cec7)
DHCPREQUEST of 192.168.1.8 on eth0 to 255.255.255.255 port 67 (xid=0x51e3cec7)
DHCPOFFER of 192.168.1.8 from 192.168.1.1
DHCPACK of 192.168.1.8 from 192.168.1.1
bound to 192.168.1.8 -- renewal in 18451 seconds.
^C

Following is when it doesn't work:

$ sudo dhclient -d -v -nw eth0
Internet Systems Consortium DHCP Client 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/94:de:80:34:47:7b
Sending on   LPF/eth0/94:de:80:34:47:7b
Sending on   Socket/fallback
DHCPREQUEST of 192.168.1.8 on eth0 to 255.255.255.255 port 67 (xid=0x67dfb451)
DHCPACK of 192.168.1.8 from 192.168.1.1
bound to 192.168.1.8 -- renewal in 20076 seconds.
^C

$ sudo cat /var/log/daemon.log | grep Network
cat: /var/log/daemon.log: No such file or directory

I cannot even access 192.168.1.1 when this command doesn't work.

  • Anything useful in dmesg when you plug in your cable? Are you configured to use IPv6? Your ifconfig output shows no IPv4. – terdon May 16 '14 at 13:59
  • @terdon The IPv4 address that my ISP allots is not visible in ifconfig eth0 while in PPPoE mode. It is only visible on my modem's configuration page on 192.168.1.1. My ISP only provides the IPv4 address, so I am sure I am not been connected using IPv6. What do I need to check the output of dmesg, unplug and plug the cable while booting and run that command? I would need to constantly switch to installed Ubuntu and Windows 7 since it's a dual-boot. – Aditya May 16 '14 at 14:04
  • Not while booting. Just unplug the cable, plug it back in again and run dmesg | tail -20 or so. That should at least show you if anything is happening. I don't mean the external IP, I mean the internal. Why don't you have an internal IPv4? – terdon May 16 '14 at 14:05
  • 1
    I guess the router stopped offering DHCP leases, can you do sudo hclient -d -v -nw eth0. Also, your router DNS seems dead, can you check. – Braiam May 16 '14 at 14:14
  • Braiam makes a good point. I'm guessing the Windows machine is keeping the previous IP. Try assigning an internal IP manually. Preferably, the same one that Windows gets. – terdon May 16 '14 at 14:19
4

The most likely problem is that your router isn't serving the DHCP leases, or that Network Manager isn't taking them. Using sudo dhclient -d -v -nw eth0 should allow you to know who's the culprit. If it works, then Network Manager configuration is messed up and you need to repair it. If it doesn't then you need to review your router configuration, in which case the router manual is necessary.

One way to fix network manager, just open the configuration interface in "Network Settings", select the desired network (lets say Wired), look for the cog button, and fix the configuration selecting "automatic".

There's also a select option, where you can select "Reset" (do NOT use "Forget) and it will restore the defaults.

Of course, network manager won't configure your devices if you have them configured in your /etc/networking/interfaces. Just delete/comment out those lines, then try again.

These options assumes you are using a GNOME-like environment, other environment can have similar options.

|improve this answer|||||
  • When dhclient command works, "Network" shows a Wired connection, but selecting it and clicking on "Options" do nothing. When the dhclient command doesn't work, selecting Wired and clicking on Options shows an error message about UUID not defined (or something similar to that). "Network Connections" doesn't show any connection at all, when everything was working fine, it used to show one ethernet connection. – Aditya May 16 '14 at 15:27
1

I solved it by editing the file /etc/network/interfaces.conf

I left only these two lines:

# Interfaces (5) file used by ifup (8) and ifdown (8)
auto io
iface io inet loopback

Then I restarted Ubuntu.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.