LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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-06-2008, 02:29 AM   #1
leiw
Member
 
Registered: Apr 2006
Posts: 131

Rep: Reputation: 15
Route problem


Hello,

The following error occur when I type route add -net 10.0.0.0 netmask 255.255.255.0 gw 192.16.0.2


SIOCADDRT: Network is unreachable


OS: Centos 5


Thx
 
Old 05-06-2008, 07:30 AM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
"gw 192.16.0.2", is this accurate or meant to be "gw 192.168.0.2".

In my experiences it'll need to be done one of a couple ways depending on scenario and versions.
first, make sure that your host (i'll call it 192.168.0.3) can route to your default gw (192.168.0.1) to the world. now, assuming that 192.168.0.2 is a system that has connection to 10.0.0/24 we'll want to use it as a gw for all of that traffic so you'll want to tell 0.3 host how to send 10. traffic with something like...
Code:
route add -net 10.0.0.0/24 gw 192.168.0.2 dev eth0
if this works, you can put it in a route-ethX file for your configuration in the format that ip route understands.

/etc/sysconfig/network-scripts/route-eth0:
Code:
10.0.0.0/24 via 192.168.0.2 dev eth0
then it'll be added when the interface comes up and removed when it is downed.

hope this helps.

If I'm not even close, please provide more details about your network configuration to better understand your situation and see if we are not able to identify a better solution for you. ;-)
 
Old 05-07-2008, 08:30 AM   #3
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
you can do this as well route is depreciated.

Code:
ip route add 10.0.0.0/24 via 192.168.0.2
 
Old 05-08-2008, 02:18 AM   #4
tajamari
Member
 
Registered: Jul 2007
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252

Rep: Reputation: 32
Quote:
Originally Posted by leiw View Post
Hello,

The following error occur when I type route add -net 10.0.0.0 netmask 255.255.255.0 gw 192.16.0.2


SIOCADDRT: Network is unreachable


OS: Centos 5


Thx
i have two questions

1. is it 192.16.0.2 or 192.168.0.2?
2. can you ping 192.168 segment from you 10.0.0 segment?

if yes you need 10.0.0.0/24 or /125 /26 or whatever you prefer on your route command
 
  


Reply



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
iproute2 (ip route), pppoe and default route lorddoskias Linux - Networking 0 05-09-2007 11:04 AM
Default route took 20s to display with 'route' command Akhran Linux - Newbie 3 11-04-2006 04:59 AM
I am not able to add a new route to my route table using route command prashanth s j Linux - Networking 2 09-03-2005 04:34 AM
ADSL as a Alternate route or backup route bhagat2000 Linux - Networking 0 05-27-2004 03:17 PM
Working with 'route' and unwanted route entries pioniere Linux - Networking 6 02-05-2003 12:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:11 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration