From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: prmarino1@gmail.com, Robert Sander <r.sander@heinlein-support.de>,
netfilter@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: Configure ICMP error source address
Date: Sat, 9 Jan 2016 10:57:31 +0100 [thread overview]
Message-ID: <5690D98B.7070003@stressinduktion.org> (raw)
In-Reply-To: <20160109035708.5251154.82433.21820@gmail.com>
On 09.01.2016 04:57, prmarino1@gmail.com wrote:
> The reason why is in the kernel documentation distributed with the source code.
> Its not all immediately obvious why and where the kernel does this
unless you were involved in the original debates about it. The problems
with binding a public ip address to a loopback address are more
recently is partialy selinux but mostly of it is because of how routing
changed when iproute2 was introduced in the 2.2 kernel (if I remember
the versions correctly it was so long ago). The reason is security,
many processes bind to the loopback interface for IPC and just grab the
first address on the first lo device they find, some of the developers
of the applications weren't even aware they were doing it because in
some cases it was C libraries several layers deep doing it because odd
loopback addresses were common on UNIX ( I remember an AIX admin back
in the early 90's telling me I should always use addresses like
127.1.0.2 on the loopback because it was valid made it harder for
script kiddies to attack processes ). This was fine when additional
addresses would need additiona
l alias on the interface for ifconfig (lo:1 for example) but with iproute2 you could now assign multiple ip addresses to an interface without creating an alias (commonly seen on the keepalived mailing list "why doesn't my VIP show up in ifconfig?")
> So there was a decision made to declare all subnets assigned to the loopback interface as unroutable to prevent a lot of very common security holes that were being seen in the wild.
selinux can only affect what happens between user space and kernel
space, it cannot install policy what happens during forwarding if no
user space is involved.
In general the kernel makes sure nothing leaves or enters the system
with an address in the 127.0.0.0/8 subnet. Albeit we have a sysctl
nowadays to lift this restriction, sysctl_route_localnet.
Besides that I don't see any differences, as I bind addresses to the
loopback interface from time to time and it works.
One must just be careful if the kernel is switched from weak end mode
into a stong end mode by enabling more strict arp filters, but this
would also break setups with dummy interfaces.
> That said you can make it work but you have to do a lot of things you should never do on a firewall like turn off selinux. Or you can simply use the dummy driver and bind your public IP's to that and the problems magically go away. And it makes a lot of sense why else would there be a need for the dummy network driver?
I would also use dummy interfaces in production systems, merely to split
the statistics from dummy.
Thanks,
Hannes
next prev parent reply other threads:[~2016-01-09 9:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-08 9:31 Configure ICMP error source address Robert Sander
2016-01-08 15:24 ` prmarino1
2016-01-08 16:11 ` Hannes Frederic Sowa
2016-01-09 3:57 ` prmarino1
2016-01-09 9:57 ` Hannes Frederic Sowa [this message]
2016-01-09 16:41 ` Robert Sander
2016-01-09 22:55 ` Pascal Hambourg
2016-01-09 23:01 ` Hannes Frederic Sowa
2016-01-10 19:12 ` Robert Sander
2016-01-08 16:21 ` Hannes Frederic Sowa
2016-02-15 9:13 ` Robert Sander
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5690D98B.7070003@stressinduktion.org \
--to=hannes@stressinduktion.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter@vger.kernel.org \
--cc=prmarino1@gmail.com \
--cc=r.sander@heinlein-support.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.