Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Oct 2008 11:52:57 +0200
From:      Johann Hugo <jhugo@meraka.csir.co.za>
To:        freebsd-stable@freebsd.org
Subject:   "route flush" does not delete routes created with -interface option
Message-ID:  <200810071152.57186.jhugo@meraka.csir.co.za>

next in thread | raw e-mail | index | archive | help
Is there a way to get rid of all the routes in a routing table ?

This is more or less what I do:

route add 146.64.80.0/24 192.168.0.100
route add 146.141.0.0 -interface tun1
route add 146.182.0.0 -interface tun1
route add 146.230.0.0 -interface tun1

netstat -rn inet
146.64.80.0/24     192.168.0.100      UGS         0        0   sis0
146.141.0.0/16     tun1                      US           0        0   tun1
146.182.0.0/16     tun1                      US           0        0   tun1
146.230.0.0/16     tun1                      US           0        0   tun1

If I do "route -n flush -inet" then it does not delete the routes created with 
a -interface option. see verbose output:

route -vn flush -inet
RTM_GET: Report Metrics: len 204, pid: 0, seq 0, errno 0, 
flags:<UP,GATEWAY,STATIC>
locks:  inits:
sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA>
 146.64.80.0 192.168.0.100 (255) ffff ffff ff sis0:0.0.24.c7.8b.80 
192.168.0.44
RTM_DELETE: Delete Route: len 204, pid: 0, seq 2, errno 0, 
flags:<UP,GATEWAY,STATIC>
locks:  inits:
sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA>
 146.64.80.0 192.168.0.100 (255) ffff ffff ff sis0:0.0.24.c7.8b.80 
192.168.0.44
RTM_GET: Report Metrics: len 260, pid: 0, seq 0, errno 0, flags:<UP,STATIC>
locks:  inits:
sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA,BRD>
 146.141.0.0 tun1 (255) ffff ffff tun1 dsl-146-145-96.telkomadsl.co.za 
dsl-146-144-01.telkomadsl.co.za
RTM_GET: Report Metrics: len 260, pid: 0, seq 0, errno 0, flags:<UP,STATIC>
locks:  inits:
sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA,BRD>
 146.182.0.0 tun1 (255) ffff ffff tun1 dsl-146-145-96.telkomadsl.co.za 
dsl-146-144-01.telkomadsl.co.za
RTM_GET: Report Metrics: len 260, pid: 0, seq 0, errno 0, flags:<UP,STATIC>
locks:  inits:
sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA,BRD>
 146.230.0.0 tun1 (255) ffff ffff tun1 dsl-146-145-96.telkomadsl.co.za 
dsl-146-144-01.telkomadsl.co.za

uname -a
FreeBSD groenwifi.cids.org.za 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #19: Tue 
Aug 26 13:40:13 UTC 2008



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810071152.57186.jhugo>