LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable to connect to Internet. (Network is unreachable) (http://www.linuxquestions.org/questions/linux-newbie-8/unable-to-connect-to-internet-network-is-unreachable-486459/)

georgiozoze 09-24-2006 06:31 AM

Unable to connect to Internet. (Network is unreachable)
 
Hello friends,

I can't connect to the internet.
If i ping 192.168.1.1 (router IP) i take 0% packet loss.
But when i am going to ping 64.179.4.146 says Network is unreacable.

If i run netstat -nr the result is:
MyServer:~ # netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 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

MyServer:~ # /sbin/route add -net 0.0.0.0 gw 192.168.1.1 eth0
MyServer:~ # netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 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.1 0.0.0.0 UG 0 0 0 eth0

Now i can ping the IP 64.179.4.146 but still i can't browse to the internet.

MyServer:~ # ping http://www.linuxquestions.org
ping: unknown host http://www.linuxquestions.org


MyServer:~ # ifconfig
eth0 Link encap:Ethernet HWaddr 00:0B:CD:1C:71:01
inet addr:192.168.1.3 Bcast:255.255.255.255 Mask:255.255.255.0
inet6 addr: fe80::20b:cdff:fe1c:7101/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4815 errors:0 dropped:0 overruns:0 frame:0
TX packets:100 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:313620 (306.2 Kb) TX bytes:11877 (11.5 Kb)
Interrupt:177

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:16436 Metric:1
RX packets:294 errors:0 dropped:0 overruns:0 frame:0
TX packets:294 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:21631 (21.1 Kb) TX bytes:21631 (21.1 Kb)

My firewall is disabled.

MyServer:~ # cat /etc/hosts
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#

127.0.0.1 localhost

# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback

fe00::0 ipv6-localnet

ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
192.168.1.3 MyServer.site MyServer

My internet Connection is Cable.

Thanks guys.

w3bd3vil 09-24-2006 06:34 AM

cat /etc/resolv.conf
you must be missing dns servers there.

georgiozoze 09-24-2006 06:47 AM

That's my resolv.conf

MyServer:~ # cat /etc/resolv.conf
# generated by NetworkManager, do not edit!

search company.com


nameserver 192.168.1.1


but i can't figure out is something is missing.

jlliagre 09-24-2006 07:47 AM

What returns:
Code:

grep hosts /etc/nsswitch.conf

georgiozoze 09-24-2006 07:59 AM

MyServer:~ # grep hosts /etc/nsswitch.conf
hosts: files dns


that's the output.

jlliagre 09-24-2006 01:00 PM

Are you sure your router serves/relays dns queries ?

georgiozoze 09-24-2006 01:37 PM

What exactly you mean?
My router is Zonet.
Also, in my LAN i don't have problem i can see my server with samba, but i don't have access to internet.

jlliagre 09-24-2006 02:07 PM

Quote:

Originally Posted by georgiozoze
What exactly you mean?

I mean, your settings are implying your router (192.168.1.1) is acting as a DNS server, which may be incorrect.
Quote:

My router is Zonet.
So have a look at its documentation and see what it tells about DNS.
I suspect you'd rather set your /etc/resolv.conf nameserver to your ISPs DNS servers.

georgiozoze 09-24-2006 02:27 PM

Sorry, but i didn't find something on the documents.

When i was with my old machine it was allright and i had the same settings. Now that i change my hardware i have this problem.
I read somewhere that maybe i need to do compile to my kernel. Is it possible to need it?

I don't believe that the problem is on router, because i connect the pc direct to the cable modem and when i make ping 64.179.4.146 , the output is:
connect: Network is Unreachable

jlliagre 09-24-2006 04:02 PM

Quote:

Originally Posted by georgiozoze
Sorry, but i didn't find something on the documents.

When i was with my old machine it was allright and i had the same settings. Now that i change my hardware i have this problem.
I read somewhere that maybe i need to do compile to my kernel. Is it possible to need it?

Very unlikely.
Quote:

I don't believe that the problem is on router, because i connect the pc direct to the cable modem and when i make ping 64.179.4.146 , the output is:
connect: Network is Unreachable
Well, you wrote earlier:

Now i can ping the IP 64.179.4.146 [...]

georgiozoze 09-24-2006 05:05 PM

Yes i wrote it.

But, when i reboot the machine i couldn't ping.

If i'll write again the command /sbin/route add -net 0.0.0.0 gw 192.168.1.1 eth0
i can ping, but if i make again a reboot i can't.

I don't know why.

jlliagre 09-24-2006 11:16 PM

That's because you didn't tell the machine to have this routing setting to persist.

Please tell what distribution you are using.

georgiozoze 09-25-2006 02:27 AM

I have Suse 10.1

jlliagre 09-25-2006 11:28 AM

Quote:

Originally Posted by georgiozoze
I have Suse 10.1

So the supported way to configure your network settings is through the yast interface.
Open the "DNS and hostname" icon to enter the DNS server(s), and the "Routing" icon to tell what the defaultroute is.

georgiozoze 09-25-2006 12:32 PM

In the routing icon is empty. Nothing.


All times are GMT -5. The time now is 11:15 PM.