Re: restrict implicit binding to interfaces
- From: Allen Kistler <ackistler@xxxxxxxxx>
- Date: Wed, 29 Oct 2008 17:49:46 -0500
David Schwartz wrote:
On Oct 29, 4:13 am, Wolfgang Draxinger <wdraxin...@xxxxxxxxxxxxxxxx>
wrote:
How can I do that, I mean: If a program requests to be bound to a
certain interface explicitly, then and only then it bound to
that interface. Otherwise it's just bound implicitly to the not
restricted interfaces.
Programs don't bind to interfaces. Your question doesn't make any
sense.
In the particular case it's a proxy server (the deamon is not
buggy, so explicit binding works, but I'd like to have some
fallback). Squid shall listen only to the internal network, so
it can't be abused from outside.
Programs don't listen to networks. Again, your question doesn't make
any sense.
But there's a also a OpenVPN
running for incomming connections, to enable a route to the
storage server which won't permit incomming connections from the
internet. And then the system shall be also ordinary router,
routing traffic into the subnet (which is a public IP address
space). I know, that using paravirtualization and some network
trickery would do the trick, but I'd like to do it on a single
logical host.
However I considered to use a small UML process, that would
contain the ppp0 device, so that this one has it's own router.
Can you state precisely what it is you are trying to do? What is the
rule for whether a connection should or should not be allowed to the
proxy?
I think what he's asking is how he can control on what addresses an app listener opens a socket. Most apps open sockets on 0.0.0.0 (i.e., every interface) by default. Some let you specify listening addresses. He appears to want a way to designate some interfaces as "restricted" and others as "not restricted" so that apps open listeners on the "not restricted" interfaces by default, but can open listeners on the "restricted" interfaces if their configs specifically request it.
I doubt that what he wants is possible. It would take rethinking the call to open a socket at the API in order to apply to apps (e.g., ntpd) that don't let you specify listening on only some addresses. (I understand there have been flame wars over ntpd on this point. I only use it as an example, not as a spark for another war.)
You seem to be under the misconception that addresses belong to.
interfaces. They don't under Linux, they belong to the machine as a
whole. When you bind to an address, you accept packets sent to that
address regardless of what interface they arrive on. Otherwise, it
would be impossible to set up a functional router.
- Follow-Ups:
- Re: restrict implicit binding to interfaces
- From: David Schwartz
- Re: restrict implicit binding to interfaces
- From: Wolfgang Draxinger
- Re: restrict implicit binding to interfaces
- References:
- restrict implicit binding to interfaces
- From: Wolfgang Draxinger
- Re: restrict implicit binding to interfaces
- From: David Schwartz
- restrict implicit binding to interfaces
- Prev by Date: BIND -- can't register nameserver
- Next by Date: Re: restrict implicit binding to addresses
- Previous by thread: Re: restrict implicit binding to interfaces
- Next by thread: Re: restrict implicit binding to interfaces
- Index(es):
Relevant Pages
|