LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable to connect to Internet. (Network is unreachable) (https://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.

w3bd3vil 09-25-2006 12:38 PM

it should be empty, fill it up.

georgiozoze 09-25-2006 01:15 PM

OK,I WENT TO ROUTING AND I PUT in the Default Gateway 192.168.1.1

In the expert cofiguration
Destination : 192.168.1.3
Gateway: 192.168.1.1
netmask: 255.255.255.0

And i checked the Enable IP Forwarding.

After all that i couldn't connect.
In the terminal i wrote
ifconfig eth0 up
dhcpcd -n

and finally i have access to internet.

The problem that i have now is that the internet is slow and when i reboot the machine every time i need to write dhcpcd -n and ifconfig eth0 upto have access.

georgiozoze 09-25-2006 02:23 PM

ok guys,

thanks for your help, i think that is done. Until now i don't have problem. I hope in the future too.

Thanks again!

jlliagre 09-25-2006 06:08 PM

The default route should be set in this file:
Code:

/etc/sysconfig/network/ifroute-eth0
which should contains something like:
Code:

default 192.168.1.1 255.255.255.0

georgiozoze 10-13-2006 08:09 PM

Hey again guys,

Just know i can't connect again to the internet.
It's ok when ping 64.233.189.104
but when i ping www.google.com
the output is
ping:Unknown host www.google.com

What's happened again, and the dhcpcd -n doesn't do anything this time.

jlliagre 10-14-2006 02:11 AM

Your DNS settings are either missing or wrong.

As already stated, check /etc/resolv.conf

georgiozoze 10-14-2006 05:32 AM

cat /etc/resolv.conf

nameserver 192.168.1.1
search myserver.com


is this wrong?


Also i don't have the file ifroute-eth0
The default route should be set in this file:
Code:/etc/sysconfig/network/ifroute-eth0
i have ifroute-lo

what should i do?

jschiwal 10-14-2006 05:51 AM

Does your router supply a dhcp service? I can't tell from your posts if you are trying to set up your system with a static address or dynamically using dhcp. Your main problem is that /etc/resolv.conf doesn't contain the nameserver (DNS) addresses. If you use DHCP, they should be supplied for you. You probably want to read through the Networking section of the SuSE Reference, ( Chapter 18 ) and configure your interface using YaST. There is an option to have your dhcp client update the resolv.conf file.


All times are GMT -5. The time now is 12:13 AM.