LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 04-21-2010, 08:14 AM   #1
homer_3
Member
 
Registered: May 2008
Posts: 99

Rep: Reputation: 15
Can't set static route?


Using Ubuntu 9.1, I get the error "SIOCADDRT: No such process" whenever I try to set a static route using

sudo route add -net dest netmask 255.255.255.0 gw gateway

and

sudo ip route add dest/24 via gateway dev eth0

gives me "RTNETLINK answers: No such process".

From googling, it looks like others have had this problem, but I haven't found any working solutions yet. Anyone have any idea how to fix this?

edit: Ok, finally found the issue. The gateway has to be on the same subnet... ugh, is there anyway to use a gateway on a different subnet without tunnels? I can ping the machine I want to be the gateway, so I feel like I should be allowed to set it as a next hop for specific addresses.

Last edited by homer_3; 04-21-2010 at 08:21 AM.
 
Old 04-21-2010, 10:21 PM   #2
TBC Cosmo
Member
 
Registered: Feb 2004
Location: NY
Distribution: Fedora 10, CentOS 5.4, Debian 5 Sparc64
Posts: 356

Rep: Reputation: 43
It sounds like you want to reach networks beyond this machine that is not on your local lan segment. The way to do that is to set up proper routing on this machine.
 
Old 02-16-2011, 02:03 PM   #3
elnoob
LQ Newbie
 
Registered: Feb 2011
Posts: 3

Rep: Reputation: 0
I know it is much much later but...

quote: "edit: Ok, finally found the issue. The gateway has to be on the same subnet... ugh, is there anyway to use a gateway on a different subnet without tunnels? I can ping the machine I want to be the gateway, so I feel like I should be allowed to set it as a next hop for specific addresses."

I was about to say the same thing. I just ran into the same issue.

What I did was enter the netmask you are currently using. Also note that adding it this was will get removed upon a reboot.

I ended up adding the same line into rc.local instead. " /sbin/route add ... ... "
 
  


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
route-eth - Adding a static route gbwien Linux - Networking 5 02-24-2012 05:15 AM
set static route failed, desktop no ping R03L Linux - Networking 25 01-27-2010 08:48 AM
static route anhtt Solaris / OpenSolaris 1 11-11-2007 03:50 PM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 11:13 AM
static route cox Linux - Networking 3 09-30-2003 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

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

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