LinuxQuestions.org
Help answer threads with 0 replies.
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 10-30-2008, 02:19 PM   #1
Kanyong
LQ Newbie
 
Registered: Oct 2008
Posts: 1

Rep: Reputation: 0
how to set preference and metric when configuring a satic route


I am trying to figure out how to set preference and metric for a static route.

Based on the manual of "ip route" command, seems like both metric and preference options are acceptable. But when tried, I got failure. i,e

ip route add 1.1.0.0/16 via 2.2.2.2 metric 1 preference 5
ip: either "to" is duplicate or "metric" is garbage.

And, the linux "route" command only accept metric option. I can do the following succesfully.

route add -net 1.1.0.0/16 gw 2.2.2.2 metric 1

can anyone help me out?

Thanks a lot,
Yong
 
Old 11-01-2008, 05:02 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Kanyong View Post
ip route add 1.1.0.0/16 via 2.2.2.2 metric 1 preference 5
ip: either "to" is duplicate or "metric" is garbage.
Using the right values for network and gateway the command finishes OK for me (iproute 2.6.18 and recent kernel 2.6)?..
 
Old 11-04-2008, 04:42 AM   #3
davedave1
LQ Newbie
 
Registered: Jun 2007
Location: Canberra
Distribution: Gentoo, Ubuntu 7, Ubuntu 5
Posts: 17

Rep: Reputation: 0
I'm not sure where you found 'preference'
But metric can be used to specify routes. The system will preferentially use the route with the lower metric so that will be enough.


Have a look at http://publib.boulder.ibm.com/infoce.../chgtcprte.htm
 
  


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
pppd connects and route set up, but cannot resolve detly Linux - Networking 12 02-25-2008 10:16 PM
How programatically in C do I get/set the default route or gateway address of eth0 jroberts5477 Linux - Networking 2 09-15-2006 01:11 PM
default route has to be set evey reboot? lucktsm Linux - Networking 3 11-28-2005 05:07 PM
how do you set up your Linux box to route secure wifi? richard3403 Linux - Wireless Networking 0 11-15-2003 02:40 PM
Help! Tring to set up a linux route MarleyGPN Linux - Networking 7 08-27-2003 04:37 PM

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

All times are GMT -5. The time now is 12:29 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