On Tue, Jul 26, 2022 at 12:09:29PM +0000, Klemens Nanni wrote:
> On Tue, Jul 26, 2022 at 12:44:20PM +0100, Stuart Henderson wrote:
> > I tried looking for a command to do this and completely failed
> > hence the ugly ps command. Do we want something like this?
> 
> I think it's useful.  There's also netstat(1)' -R but that just dumps
> everything without indication where the current process is.
> 
> > Index: route.8
> > ===================================================================
> > RCS file: /cvs/src/sbin/route/route.8,v
> > retrieving revision 1.103
> > diff -u -p -r1.103 route.8
> > --- route.8 31 Mar 2022 17:27:20 -0000      1.103
> > +++ route.8 26 Jul 2022 11:41:41 -0000
> > @@ -102,6 +102,8 @@ Execute a command forcing the process an
> >  routing table and appropriate routing domain as specified with the
> >  .Fl T Ar rtable
> >  option.
> > +The current routing table can be displayed with
> > +.Xr id 1 .
> 
> Perhaps put this under the -T rtable description?  There you'll spot it
> earlier and every route command suports [-T rtable].
> 
> >  .It Xo
> >  .Nm route
> >  .Op Fl nqv
> > @@ -625,6 +627,7 @@ to create the new entry.
> >  .El
> >  .Sh SEE ALSO
> >  .Xr netstat 1 ,
> > +.Xr getrtable 2 ,
> 
> I don't think this is warranted.
> 
> >  .Xr gethostbyname 3 ,
> >  .Xr netintro 4 ,
> >  .Xr route 4 ,
> 
> rtable(4) has a bunch of examples but also lacks id -R and is not
> referenced where one might find it useful:
> 
>       $ man -k xr~'^(rdomain|rtable)'
>       pair(4) - virtual Ethernet interface pair
>       route(4) - kernel packet forwarding database
>       wg(4) - WireGuard pseudo-device
>       bgpd.conf(5) - Border Gateway Protocol daemon configuration file
>       sshd_config(5) - OpenSSH daemon configuration file
>       ifconfig(8) - configure network interface parameters
>       route, rt_setgate, rtdeletemsg, rtredirect(9) - kernel routing interface
>       rtalloc, rtalloc_mpath, rtfree, rtisvalid, rtref(9) - routing entry 
> interface
> 
> So instead maybe point at rtable(4) from here (and show id -R there)?

Like this.

Feedback? Objection? OK?


Index: sbin/route/route.8
===================================================================
RCS file: /cvs/src/sbin/route/route.8,v
retrieving revision 1.103
diff -u -p -r1.103 route.8
--- sbin/route/route.8  31 Mar 2022 17:27:20 -0000      1.103
+++ sbin/route/route.8  29 Jul 2022 13:54:26 -0000
@@ -78,6 +78,9 @@ Suppress all output.
 .It Fl T Ar rtable
 Select an alternate routing table to modify or query.
 The default is to use the current routing table.
+.Pp
+The current routing table can be displayed with
+.Xr id 1 .
 .It Fl t
 Write routing messages to a fake device
 .Pa ( /dev/null )
@@ -624,10 +627,12 @@ low on resources and was unable to alloc
 to create the new entry.
 .El
 .Sh SEE ALSO
+.Xr id 1 ,
 .Xr netstat 1 ,
 .Xr gethostbyname 3 ,
 .Xr netintro 4 ,
 .Xr route 4 ,
+.Xr rtable 4 ,
 .Xr tcp 4 ,
 .Xr hosts 5 ,
 .Xr mygate 5 ,
Index: share/man/man4/rdomain.4
===================================================================
RCS file: /cvs/src/share/man/man4/rdomain.4,v
retrieving revision 1.18
diff -u -p -r1.18 rdomain.4
--- share/man/man4/rdomain.4    31 Mar 2022 17:27:21 -0000      1.18
+++ share/man/man4/rdomain.4    29 Jul 2022 14:00:03 -0000
@@ -114,10 +114,14 @@ in rtable 4:
 .Pp
 .Dl # route -T4 exec /usr/sbin/sshd
 .Pp
-Display to which rdomain processes are assigned:
+Display to which routing table processes are assigned:
 .Pp
 .Dl $ ps aux -o rtable
 .Pp
+Display the routing table of the current process:
+.Pp
+.Dl $ id -R
+.Pp
 A
 .Xr pf.conf 5
 snippet to block incoming port 80,
@@ -133,6 +137,7 @@ Delete rdomain 4 again:
 # ifconfig lo4 destroy
 .Ed
 .Sh SEE ALSO
+.Xr id 1 ,
 .Xr netstat 1 ,
 .Xr ps 1 ,
 .Xr lo 4 ,

Reply via email to