Why can't I access internet through static IP set-up Ubuntu Server 14.04?

9,006

Solution 1

First and foremost with issues like this is to re-boot first, then ask questions if the issue persists.

A significant indicator in this case was the Tx and Rx packet count being 0 in the ifconfig listing.

Investigation at the packet level can be informative in these cases. Use tcpdump (or wireshark, if you prefer) to observe packet traffic while you try to ping other things. Are there outgoing packets, but no return packets? No packets at all? ... Run this command in one terminal:

sudo tcpdump -n -tttt -i eth0

While trying to ping the gateway (the closest external point) in another terminal:

ping 128.159.180.254

And observe any output on the tcpdump terminal.

On a server, with no gui, one can make other terminals to work with. Depress and hold the "ALT" key then depress the "F2" key and you will have a new terminal. Depress and hold the "ALT" key and then depress the "F1" key and you will go back to your original terminal. Similarly, for "ALT" F3, F4, F5, and F6.

Solution 2

After a system reboot and retrying the tcp dump suggested by Doug Smythies the system appears to have connected successfully! There must have been some settings that did not take after the configuration, however the issue seems to be resolved. Thank you for your comments!

Share:
9,006

Related videos on Youtube

Labandabon
Author by

Labandabon

Updated on September 18, 2022

Comments

  • Labandabon
    Labandabon over 1 year

    Just installed Ubuntu Server 14.04 and set-up a static IP scheme for the machine. However when I try to ping google.com I get destination host unreachable. I can ping the machine IP just fine, the gateway also reports destination host unreachable. The machine is connected to a switch and we have a set range of IPs from the ISP. I previously set-up a Windows 7 machine to static IP scheme and have used the same DNS and Gateway. On the Windows machine I am able to connect to the internet just fine. Network set-up (found in /etc/network/interfaces) is as follows:

    auto lo
    iface lo inet loopback
    
    auto eth0
    iface eth0 inet static
      address 128.159.180.xxx
      netmask 255.255.255.0
      network 128.159.180.0
      broadcast 128.159.180.255
      gateway 128.159.180.254
      dns-nameservers 208.69.150.252
    

    A few things to note: This is Ubuntu Server 14.04 so it is CLI only no desktop GUI and I have check to make sure that DHCP is not running and have uninstalled the DHCP client from the machine. Please help discover why I have no internet connection.

    EDIT: for ifconfig eth0

    eth0    Link encap:Ethernet HWaddr: 00:25:90:d0:ad:5a
            inet addr: 128.159.180.xxx Bcast: 128.159.180.255 Mask: 255.255.255.0
            UP BROADCAST MULTICAST MTU:1500 Metric:1
            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000
            RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
            Memory:fb820000-fb840000
    

    for ip route list:

    default via 128.159.180.254 dev eth0
    128.159.180.0/24 dev eth0 proto kernel scope link src 128.159.180.xxx
    
    • steeldriver
      steeldriver about 9 years
      Can you add the outputs of ifconfig eth0 and ip route list please?
    • Labandabon
      Labandabon about 9 years
      added to the post as an edit.
    • Labandabon
      Labandabon about 9 years
      Yes, I have mapped all devices connected to the network and made sure that the ip address does not conflict. There is no DHCP on the network either
    • Labandabon
      Labandabon about 9 years
      again to make sure there wasn't an IP conflict I changed the address just temporarily using "sudo ifconfig eth0 128.159.180.xxx netmask 255.255.255.0" where xxx was a new subnet address, still have issues pinging the gateway and internet
    • Doug Smythies
      Doug Smythies about 9 years
      It is not clear to me why your Tx and Rx packets counters are 0 in your ifconfig listing. Can you learn anything with a packet sniffer? I.E. "sudo tcpdump -n -tttt -i eth0" in one terminal and "ping 128.159.180.254" in another terminal.
    • Labandabon
      Labandabon about 9 years
      There is not a GUI on this machine so I do not know a way to open multiple terminals. It boots into CLI
    • Doug Smythies
      Doug Smythies about 9 years
      I only use servers, but mainly via ssh. Anyway... depress and hold the "ALT" key then depress the "F2" key and you will have a new terminal to work with. Depress and hold the "alt" key and then depress the "F1" key and you will go back to your original terminal. Similarly, you can have a bunch of terminals using other "FN keys", but I forget how many.
    • Labandabon
      Labandabon about 9 years
      very Helpful! Ping 254 shows Destination Host Unreachable and the second terminal is not detecting any packets
    • Labandabon
      Labandabon about 9 years
      @DougSmythies Your assistance and steeldrivers assistance helped me solve this issue could one of you answer this question allowing me to accept it as the answer? Thanks!
    • Labandabon
      Labandabon about 9 years
      @steeldriver Your assistance and DougSmythies assistance helped me solve this issue could one of you answer this question allowing me to accept it as the answer? Thanks!
  • Fabby
    Fabby about 9 years
    Labandabon: It's considered bad form on Ask Ubuntu to answer your own question when someone else helped you arrive to the conclusion. You should have left the opportunity to @DougSmythies to answer the question so that he would have gotten some reputation out of the work he did for you... ;-)
  • Labandabon
    Labandabon about 9 years
    @Fabby I did not mean to step on anyones toes. and have been looking for a way to upvote both DougSmythies and steeldriver as they both helped me resolve this issue by looking into the surrounding problems. It so happens that a restart is what it needed so I was just wanting to share that with them. If you have a suggestion as how to give them both credit for the assistance they provided I'd love to know how. Thanks
  • Fabby
    Fabby about 9 years
    Nostepping on my toes... ;-) But with your reputation, you cannot upvote yet. :-( So I would delete my answer, leave a comment to the people that helped you and ask them to answer the question and accept one answer... They'll have to figure it out amongst themselves... ;-)
  • Doug Smythies
    Doug Smythies about 9 years
    More than anything, we appreciate that you reported back your findings. So very many don't.