Реклама: |
Even though we're forwarding some packets, and blocking other packets, we're typically
behaving like a well behaved router should by decrementing the TTL on the packet and
acknowledging to the entire world that yes, there is a hop here. But we can hide our
presence from inquisitive applications like unix traceroute which uses UDP packets with
various TTL values to map the hops between two sites. If we want incoming traceroutes to
work, but we do not want to announce the presence of our firewall as a hop, we can do so
with a rule like this:
block in quick on xl0 fastroute proto udp from any to any port 33434 >< 33465
The presence of the fastroute keyword will signal ipfilter to not pass the
packet into the Unix IP stack for routing which results in a TTL decrement. The packet
will be placed gently on the output interface by ipfilter itself and no such decrement
will happen. Ipfilter will of course use the system's routing table to figure out what the
appropriate output interface really is, but it will take care of the actual task of
routing itself.
There's a reason we used block quick in our example, too. If we had used pass,
and if we had IP Forwarding enabled in our kernel, we would end up having two paths for a
packet to come out of, and we would probably panic our kernel.
It should be noted, however, that most Unix kernels (and certainly the ones underlying
the systems that ipfilter usually runs on) have far more efficient routing code than what
exists in ipfilter, and this keyword should not be thought of as a way to improve the
operating speed of your firewall, and should only be used in places where stealth is an
issue.