[Openswan dev] Re: Openswan 2.4.0dr9 multiple defaultroute patch

Peter Bieringer pb at bieringer.de
Tue Aug 16 00:36:46 CEST 2005



--On Montag, 15. August 2005 21:57 +0200 Dirk Nehring 
<dnehring at marcant.net> wrote:

> On Mon, Aug 15, 2005 at 09:30:34PM +0200, Paul Wouters wrote:
>> On Mon, 15 Aug 2005, mcr at xelerance.com wrote:
>>
>> > How about, instead:
>> >
>> > defaultinterface() {
>> >	phys=`netstat -nr |
>> >		awk '$1 == "0.0.0.0" && $3 == "0.0.0.0" { print $NF; exit }'`
>>
>> Can we use the 'ip' command instead? Officially, netstat is obsoleted on
>> Linux.
>
> Oh yes:
>
> defaultinterface() {
> 	phys=`ip route list |
> 		 awk '$1 == "default" { print $5; exit }'`
>
>
> and some lines down...
>
>        next=`ip route list |
>                awk '$1 == "default" { print $3; exit }'`

Suggestion for an improvement:

# ip route show 0.0.0.0/0

	Peter
-- 
Dr. Peter Bieringer                     http://www.bieringer.de/pb/
GPG/PGP Key 0x958F422D               mailto: pb at bieringer dot de
Deep Space 6 Co-Founder and Core Member  http://www.deepspace6.net/


More information about the Dev mailing list