LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 09-13-2017, 11:19 AM   #1
bkannadassan
LQ Newbie
 
Registered: Sep 2017
Posts: 10

Rep: Reputation: Disabled
Same route when added error thrown for ip add, anyway to silently discard ?


Hi All!

ip route add default via 192.168.108.132 table PBR.table1
RTNETLINK answers: File exists

When I add the same route I am getting error. Though this is expected we want this to be silently discarded. Reason for the same is from the application we execute this command via system call and when system call returns status other than 0 we are thinking its failed.

rgds
Balaji
 
Old 09-14-2017, 04:25 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
So if your application doesn't care about the result then program your application to ignore the result, otherwise try:

Code:
ip route add default via 192.168.108.132 table PBR.table1 > /dev/null 2>&1 ; true
 
  


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
Why static routes set using 'ip route add' and 'route add' commands are not used for routing packets within the same network? kanak@tetcos.com Linux - Networking 7 04-25-2017 05:52 AM
[SOLVED] Make Sendmail silently discard 'Catchall' addresses Andy Woolford Linux - Server 7 08-04-2011 10:58 AM
cannot add default route in user defined table (added in rt_tables) mgautam Linux - Networking 3 10-05-2009 05:45 AM
route add error with ubuntu 6.10 ashan Linux - Networking 8 04-27-2007 07:49 PM
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

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