From: prmarino1@gmail.com
To: Hannes Frederic Sowa <hannes@stressinduktion.org>,
Robert Sander <r.sander@heinlein-support.de>,
netfilter@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: Configure ICMP error source address
Date: Fri, 08 Jan 2016 22:57:08 -0500 [thread overview]
Message-ID: <20160109035708.5251154.82433.21820@gmail.com> (raw)
In-Reply-To: <568FDFBF.3010300@stressinduktion.org>
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 additional 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.
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?
Original Message
From: Hannes Frederic Sowa
Sent: Friday, January 8, 2016 11:11
To: prmarino1@gmail.com; Robert Sander; netfilter@vger.kernel.org; netdev@vger.kernel.org
Subject: Re: Configure ICMP error source address
On 08.01.2016 16:24, prmarino1@gmail.com wrote:
> Don't put a public address on a lo device use a dummy eth interface instead. Any IP address and it's subnet assigned to a lo device is marked as a marcian address and the traffic is dropped if it tries to leave the lo device.
O_o
> I know that there is som old documentation out there (for example quagga's documentation) that says you can do it but it's been wrong since the 2.4 version off the kernel.
> Linux treats the lo device differently that what routers call a loopback device. The dummy driver is the linux equivalent of what routers call a loopback device.
What you write seems odd to me, we don't treat lo devices differently to
dummy devices in respect if you bind a public ip address on it.
Bye,
Hannes
next prev parent reply other threads:[~2016-01-09 3: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 [this message]
2016-01-09 9:57 ` Hannes Frederic Sowa
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=20160109035708.5251154.82433.21820@gmail.com \
--to=prmarino1@gmail.com \
--cc=hannes@stressinduktion.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).