[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why RNF_IGNORE?



Just replying to myself w/ some little details...

Henric Jungheim wrote:

I ran into a bit of a weird problem that I think it caused by this flag. Try something like this (assuming fxp0 is the only interface--or, at least, the one w/ the default route):

GW = default route (on the fxp0 subnet)
TEST = some box on the fxp0 subnet (other than GW)


These addresses do need to be such that searching for "TEST" requires backtracking.

My routing table looked like this after getting the redirect:

Routing tables

Internet:
Destination Gateway Flags Refs Use Mtu Interface
default 192.168.201.1 UGS 1 3 1500 fxp0
127.0.0.1 127.0.0.1 UH 1 6 33224 lo0
192.168.1/24 link#2 UC 0 0 1500 fxp1
192.168.201/24 link#1 UC 0 0 1500 fxp0
192.168.201.1 0:0:24:c0:d:be UHL 1 0 1500 fxp0
192.168.201.3 192.168.201.3 UGHD 0 1 1500 fxp0


(In this case, GW = 192.168.201.1 and TEST=192.168.201.3.)

BTW, is it ever sane to send or accept a host ICMP redirect where the destination is on the same subnet as the gateway? (The subnet mask is known in this case since it has to be the interface's mask.)

route -n flush
ifconfig fxp0 down
route -n add default GW
ifconfig fxp0 up
ping TEST


To see some of what is going on, I massaged the output of "netstat -nrAf inet" and fed the result to graphviz-1.8.5's "dot" (it looks like the port is 1.7.something, but I'd already built 1.8.5 builds w/o too much fuss). Something like this prints the tree:

   netstat -nrAf inet | awk -f graphnet | dot -Tps | lpr

Where "graphnet" is the following:

function quotename(name) {
   return "\"" name "\"";
}

BEGIN {
print "digraph netstat {";
print " size=\"8,10.5\";";
print " margin=\"0.25\";";
print " node [fontsize=8];";
link="";
}
$1 !~ /^0x/ { next; }
/\(root node\)/ { print " ", quotename($1), "[label=Root,shape=box];" }
$2 ~ /\([0-9]+\)/ {
name = substr($2, 2, length($2) - 2);
if($6 == "mk")
name = name "/" substr($9, 3, length($9) - 4);
print " ", quotename($1), "[label=\"" name "\"];";
print " ", quotename($1), "-> {", quotename($3), quotename($5), "}" ";";
}
$2 !~ /^[(]/ { print " ", quotename($1), "[label=\"" $8, $4 "\\n" $2 "\\n" $3 "\",shape=box];" }
{ if(link != "") { print " ", link, "->", quotename($1), "[arrowhead=none];"; link = "" } }
/=>/ { link = quotename($1); }
END { print "}" }