LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-05-2009, 09:35 PM   #1
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Rep: Reputation: 32
Internet connection wont work... period


Hello all, I have been trying for HOURS to get my internet connection to work. I've just installed Ubuntu fresh, and ever since I've installed it I haven't been able to get the internet working. This is the first time I've ever used Ubuntu. I've tried EVERYTHING I know, and nothing seams to work. Ping always reports "Destination Host Unreachable". Here is an output from my terminal DIRECTLY after a reboot:

Code:
th317erd@th317erd-desktop:~$ 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 eth1
0.0.0.0         192.168.1.1     0.0.0.0         UG    100    0        0 eth1

th317erd@th317erd-desktop:~$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.100 icmp_seq=1 Destination Host Unreachable
From 192.168.1.100 icmp_seq=2 Destination Host Unreachable
From 192.168.1.100 icmp_seq=3 Destination Host Unreachable
^C
--- 192.168.1.1 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4024ms
, pipe 3

th317erd@th317erd-desktop:~$ cat /etc/network/interfaces 
auto lo
iface lo inet loopback

auto eth1
iface eth1 inet static
	address 192.168.1.100
	broadcast 192.168.1.255
	netmask 255.255.255.0
	gateway 192.168.1.1

root@th317erd-desktop:/home/th317erd# uname -a
Linux th317erd-desktop 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:58:03 UTC 2009 x86_64 GNU/Linux
Also, I'd like to mention that eth0 is my onboard network card, which cannot be disabled, but the connection in the back is broken. Eth0 is still active, but I haven't set it up (because I don't want to use it). Eth1 is the network card I added to the system and am using.

What should I do? Why does ping always report "Destination Host Unreachable" no matter what I do?

By the way, the internet works fine in Windows. I dual boot my system, and all I have to do is reboot into windows if I want to use the internet. Help!
 
Old 05-06-2009, 12:33 PM   #2
mknirsch
Member
 
Registered: Feb 2003
Location: Germany
Distribution: SLES 10, SuSe 11.x
Posts: 31

Rep: Reputation: 16
Hello "The Nerd",

when your kernel loaded drivers for your network cards you'll find this devices in /proc/net/dev:
# cat /proc/net/dev
In case a network interface is visible in /proc/net/dev you do not have to cope with driver problems. Enter
# ifconfig
in order to obtain information about your network interfaces. In case you want to shut down eth0 enter
# ifconfig eth0 down
Your next ifconfig command will now exclude this interface (use the -a swith to display non active interfaces)

To work on your "connection problem" I assume the following:
- your computer has a fixed IP address configured in /etc/hosts (192.168.1.1)
- your computer is connected to an Internet router with fixed IP address (192.168.1.100)
- you know DNS of your ISP (using Windows open the command window and enter "ipconfig /all". This command will list your IP configuration and will also display the IP address of your DNS service
- you have no physical firewall between your computer and the internet router

To proceed I initially recommend a static configuration, that makes life a bit easier when searching for configuration problems. Later on you can change back to DHCP etc. if you like.

a) check /etc/hosts
example entry consists of ip address domain spec alias # comment:
192.168.1.1 domain.home.told domain # (told = your top level domain if any)
192.168.1.100 told.home.told told # your internet access router

b) check the correct IP configuration of your internet router. In the router manual you'll probably find an ip address that can be used for configuration. Use your working windows to get the router configuration.

c) Ensure that we first look into /etc/hosts (here we define our ip addresses, alias etc.)
Open /etc/host.conf (the resolver) and enter the lines
order hosts, bind
multi on

d) Verify the basic connectivity to your ISP router Enter
# ping told
The ping command should be used to verify the basic connectivity between two points in a network. told shall be translated to the ip address of your internet router. In case ping fails you have either a problem with your network cabling of with your ip configuration.

e) Verify connectivity to the DNS
# nslookup www.cisco.com
should return the ip address of cisco.com using your DNS server. If this nslookup call fails immediately no nameserver is configured. Please enter the following line into the file /etc/resolv.conf:
nameserver 10.11.12.13 # with 10.11.12.13 is the DNS ip address

In case the nslookup fails after 20-30 seconds a nameserver is configured but can not be reached or does not respond. Possible reasons are firewall systems blocking the nslookup, routing errors or a DNS that is down.

enter
#route -n
in order to display the current routing configuration. It consists of your network interface (definition) in line 1 and your default route (line 3)

Destination Router Genmask Flags Metric Ref Use Iface
192.168.1.1 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.1.100 0.0.0.0 UG 0 0 0 eth0

All traffic not assigned to the 192.168.1.0/24 net is routed via the default route to the ISP router device.

Else enter the following command:
route add default gw 192.168.1.100

Then go to file /etc/sysconfig/network/routes (this is the location in my SLES, please check in Ubuntu) Here you should find the entry
default 192.168.1.100

When changing the configuration files restart your network in order to reload the new configurations. If the nslookup still fails check /etc/hosts.allow and /etc/hosts.deny to make sure you are not blocking yourself.

When ping DNS successfully completes and you still get no response on nslookup try
strace -e options ping DNS
options (can be comma separated) are socket, connect, send, recvfrom
The first socket shows the socket number; in the following connect (on the socket number) a sin_port=htons(53)..
is the DNS request. Next look for recvfrom to obtain the data returned from the DNS.

Hope my comments are of any help for you.

regards

Martin
 
  


Reply

Tags
configuration, dns, network


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
internet connection wont work bixler_69 Linux - Newbie 8 11-21-2007 02:24 PM
My internet wont work vicky_me Linux - Networking 4 09-05-2006 03:02 AM
why wont my internet work? jonny_fun Linux - Networking 3 05-01-2006 12:59 PM
Internet WONT work! :-( Damien295x Linux - General 8 11-01-2005 09:37 AM
why wont my internet work? jimthing2001 Linux - General 2 01-06-2004 08:14 AM


All times are GMT -5. The time now is 01:16 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration