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 06-27-2005, 03:33 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Question deleting all default gw


How can I delete all default gws in a single CLI stroke?

I thought
Code:
ip route del default
would do,... but it only removes a single GW instance. If there are more, they remain the same.
 
Old 06-28-2005, 07:52 AM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
It would need to be done with at least 3 commands, one each for each route and one to flush the route cache..
You could make a script to do that, eg copy some of the ifdown script..

What are you trying to achieve with it?
 
Old 06-28-2005, 08:29 AM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
I'm working on a script that creates a multipath default route from separate DHCP connections.
 
Old 06-28-2005, 09:38 AM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
So, basically, I could keep running "ip route del default" while there are "default" items in ip route show, right?

Something like:
Code:
while [ $(ip route show | grep default | wc -l) != 0 ]; do
     ip route del default
done
ip route flush cache
That WOULD do, right?
 
Old 06-28-2005, 10:15 AM   #5
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
There are different behaviours of ip route.. Mine requires more detail to delete..

That script would work ok..
The important part is to make replies go back out the path they came in on, as explained in http://www.tldp.org/HOWTO/Adv-Routin...ple-links.html
 
Old 06-28-2005, 10:26 AM   #6
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
Oh, I know, I know!
 
  


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
Details about default web Browser & default Email client sudhasmyle Linux - Software 4 06-15-2006 11:45 AM
Default Drowser & Default E-mail Cli sudhasmyle Linux - Networking 1 11-20-2004 10:42 AM
Deleting 2.6 usercsr Slackware 13 05-20-2004 01:37 AM
setting default page size and default tray lived4eva Linux - General 1 11-04-2003 02:39 PM
New Virtual Servers Default to Default Server Page? DigiDave Linux - Software 4 10-18-2003 03:23 AM

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

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