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. |
cat /etc/resolv.conf
you must be missing dns servers there. |
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. |
What returns:
Code:
grep hosts /etc/nsswitch.conf |
MyServer:~ # grep hosts /etc/nsswitch.conf
hosts: files dns that's the output. |
Are you sure your router serves/relays dns queries ?
|
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. |
Quote:
Quote:
I suspect you'd rather set your /etc/resolv.conf nameserver to your ISPs DNS servers. |
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 |
Quote:
Quote:
Now i can ping the IP 64.179.4.146 [...] |
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. |
That's because you didn't tell the machine to have this routing setting to persist.
Please tell what distribution you are using. |
I have Suse 10.1
|
Quote:
Open the "DNS and hostname" icon to enter the DNS server(s), and the "Routing" icon to tell what the defaultroute is. |
In the routing icon is empty. Nothing.
|
it should be empty, fill it up.
|
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. |
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! |
The default route should be set in this file:
Code:
/etc/sysconfig/network/ifroute-eth0 Code:
default 192.168.1.1 255.255.255.0 |
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. |
Your DNS settings are either missing or wrong.
As already stated, check /etc/resolv.conf |
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:i have ifroute-lo what should i do? |
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. |