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 12-26-2013, 08:04 AM   #1
vbavba
LQ Newbie
 
Registered: Dec 2013
Posts: 4

Rep: Reputation: Disabled
ip route script giving metric


Hi,

I have some ip route commands /configurations at one my box and i try to copy this to a startup script. I have wrote the script from an example but i couldnt give any information about metrics on the script which I have on running conf. How can i give these metrics in my simple file?
 
Old 12-26-2013, 10:19 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
The syntax for specifying a metric value with the ip route command is fairly straightforward:
Code:
ip route add <network> via <gateway> metric <metric>
Your question is a bit vague. Are you having trouble with the command itself, or is it something to do with how the script obtains/generates/uses the metric value?
 
Old 12-27-2013, 03:28 AM   #3
vbavba
LQ Newbie
 
Registered: Dec 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
my problem is giving the metric values to the startup script not at the shell
 
Old 12-27-2013, 03:47 AM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
A regular script is just a collection of commands, so the syntax would be exactly the same.

However, if you want to add a route with a metric value to the config files used by the init scripts of your distribution, then the answer would have to be distribution-specific.

Have I understood your question correctly? And if so, which Linux distribution are you using?
 
Old 12-27-2013, 03:54 AM   #5
vbavba
LQ Newbie
 
Registered: Dec 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi,

True its a true based distro
 
Old 12-27-2013, 04:20 AM   #6
vbavba
LQ Newbie
 
Registered: Dec 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Pardon this is a Redhat based distro
 
  


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
[SOLVED] A script is not giving any output. Satyaveer Arya Programming 21 02-12-2012 08:36 PM
Change default route metric MikeyCarter Linux - Networking 1 09-10-2011 08:47 AM
Script is giving me error dhirendrs Programming 8 08-12-2010 06:42 AM
how to set preference and metric when configuring a satic route Kanyong Linux - Networking 2 11-04-2008 04:42 AM
New ROUTE target giving error maxx.usr Linux - Kernel 1 02-23-2007 03:59 PM

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

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