LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 10-23-2004, 06:34 AM   #1
Hazzie
LQ Newbie
 
Registered: Aug 2003
Location: Stockport, UK
Distribution: RH9
Posts: 12

Rep: Reputation: 0
Connect to Internet via a router


Hi i am getting the following message when i try to connect to the internet (or even ping an IP address).

ping 212.28.224.56
connect: Network is unreachable

I can ping from my Linux box to my XP box on my internal network fine.
I can ping my router fine.
My XP box can connect to the internet (its how i am writting this post).

From a few searches people have asked for this information

route -n
Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
and ifconfig
Code:
eth0      Link encap:Ethernet  HWaddr 00:0C:6E:2F:8B:44
          inet addr:192.168.0.3  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:693 errors:0 dropped:0 overruns:0 frame:0
          TX packets:498 errors:0 dropped:0 overruns:0 carrier:0
          collisions:6 txqueuelen:100
          RX bytes:54630 (53.3 Kb)  TX bytes:52352 (51.1 Kb)
          Interrupt:11 Base address:0xd800

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:700 (700.0 b)  TX bytes:700 (700.0 b)
my router is configured as 192.168.0.1

From the above route table i presume it says that my network card (eth0) can access the following paths 192.168.0.0 and 169.254.0.0. I have no real idea how the 169.254.0.0 got in there (but thats not the issue here i think). Do i have to specify a specific IP for the router in that table and if so is the command to do it

route add -net 192.168.0.1 netmask 255.255.255.0 dev eth0

Am i on the right track?
 
Old 10-23-2004, 07:06 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 9,920

Rep: Reputation: 338Reputation: 338Reputation: 338Reputation: 338
You need to specify a gateway:

route add default gw 192.168.0.1

Also make sure that your /etc/resolv.conf file contains nameserver
information.
 
Old 10-23-2004, 07:35 AM   #3
Hazzie
LQ Newbie
 
Registered: Aug 2003
Location: Stockport, UK
Distribution: RH9
Posts: 12

Original Poster
Rep: Reputation: 0
Ahh well i was in the right area then..

Thanks for your quick reply, it worked a treat.
 
Old 10-24-2004, 09:51 AM   #4
Hazzie
LQ Newbie
 
Registered: Aug 2003
Location: Stockport, UK
Distribution: RH9
Posts: 12

Original Poster
Rep: Reputation: 0
Just a follow up to this. I shutdown my machine last night. When i switched it back on the route that I added last night no longer appears in the routing table and i cannot access the internet again. Is there a way to make it stick?
 
Old 10-27-2004, 02:24 AM   #5
getinfo
LQ Newbie
 
Registered: Oct 2004
Posts: 3

Rep: Reputation: 0
Hi,

I think you need to add this line in /etc/sysconfig/network

gateway=192.168.0.1

and save the file

then restart the service ..and it will stick eventhough you boot the system
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to connect Internet via a router? myouch Linux - Networking 7 10-07-2005 10:59 PM
can't connect to Internet with adsl router buzzgrowl Linux - Newbie 8 10-06-2005 09:49 AM
Connect to the internet with a belkin router.....What do i have to do?????? PaulBak Linux - Networking 26 09-01-2004 03:57 PM
cannot connect to internet after switching dsl router Skunk_Face Linux - Networking 4 03-03-2004 04:08 AM
Can't connect to internet. (router) NomDeGuerre Slackware 9 02-27-2004 12:55 PM


All times are GMT -5. The time now is 02:43 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
Open Source Consulting | Domain Registration