Question: Iptables -- 127.0.0.1




I have a little confusion with this.

I hear about this "sanity check" for packets that may have
a spoofed source address (or destination) of 127.0.0.1

Every single reference, tutorial, sample iptables scripts,
etc. that I've seen, they address the issue referring to
127.0.0.1 as the loopback address. Example:

iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -s 127.0.0.1 -j DROP
iptables -A INPUT -d 127.0.0.1 -j DROP

That way, if the packet legitimately is from the host to
itself, then it will match the first rule and pass; if
a packet did not pass the first rule, then it can not
possibly have source or destination IP of 127.0.0.1, and
thus it is dropped, guilty of being a fake packet.

What was recently brought to my attention is: shouldn't
that be 127.0.0.0/255.0.0.0 ?? That is, shouldn't the
entire range 127.*.*.* be considered? I'm not sure the
claim has merit, but it made me wonder -- I always
thought 127.0.0.1 is *the one* special IP address for
the loopback interface; but I'm told that the entire
range 127.*.*.* has the same effect? Can someone
clarify this?

If the claim is true, then why aren't all the examples
and tutorials on iptables out there using the 127.0.0.0/8
subnet?

Thanks,

Carlos
--
.



Relevant Pages

  • RE: Transfer a sending packet to upper TCP/IP protocol layer in IM
    ... source and destination MAC addresses are the same for both IP versions. ... the destination NIC of IPv6 packet is the same as the destination NIC of my ... encapped IPv4 packet. ...
    (microsoft.public.development.device.drivers)
  • Re: TOE brain dump
    ... primarily over ATMish core networks. ... "if you can't find header address ... the flow, if you can find a VC from cache, send the packet there" ... destination node address selector bits in header, ...
    (Linux-Kernel)
  • Re: site to site vpn with internal NAT
    ... :interface. ... :192.168.1.101 tries to contact a peer on the remote side, ... so the *destination* IP 192.168.49.x will be changed to the destination ... and since there is a match, the packet will go out over the VPN. ...
    (comp.dcom.sys.cisco)
  • RE: Transfer a sending packet to upper TCP/IP protocol layer in IM
    ... the destination NIC of IPv6 packet is the same as the destination NIC of my ... encapped IPv4 packet. ... you should clearly realize that emulating non-existent IPv6 ...
    (microsoft.public.development.device.drivers)
  • IPFilter 5.0.0 - feedback?
    ... rewrite - change both source and address fields for incoming or ... encap - encapsulated the packet in a new IP header (this will be ... encap is pretty much the same as divert, minus the port numbers to ... REWRITING SOURCE AND DESTINATION ...
    (freebsd-net)

Quantcast