Re: restrict implicit binding to interfaces



Wolfgang Draxinger <wdraxinger@xxxxxxxxxxxxxxxx> writes:

Allen Kistler wrote:

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.

Yes, that's exactly what I want.

Then you will likely have to change the source code of those apps.

It's not hard. Although It was 15 years ago when I did this.

Normally the bind() call uses some constant for one of the parameters.
I think it's INADDR_ANY. (which usually has the value 0x00).

You change this to match the IP address you explicitly want.

So if a device has multiple interfaces, this forces the application to
only listen to the interface specified. If you have an inside network,
and an outside network, you can force the app to listen to one of the
other.

This is uncommon for many apps. Luckily for Linux, the source code is
usually available.

.



Relevant Pages

  • Re: restrict implicit binding to interfaces
    ...  Some let you specify listening addresses. ... others as "not restricted" so that apps open listeners on the "not ... restricted" interfaces by default, but can open listeners on the ...
    (comp.os.linux.networking)
  • Re: restrict implicit binding to interfaces
    ... Most apps open sockets on 0.0.0.0 ... Some let you specify listening ... that apps open listeners on the "not restricted" interfaces by ...
    (comp.os.linux.networking)
  • Re: [9fans] Install from CD fails
    ... suddenly changed but now untested binaries. ... most PLs no amount of type checking of the interfaces can ... on many platforms we've developed a term "bug for bug ... apps got developed that depended critically upon specific ...
    (comp.os.plan9)
  • Custom Class Interfaces and webservices
    ... We develop custom objects with our apps and are wanting to take a more enterprise view of our classes. ... This means using interfaces upon our classes to allow specif apps to see speceif properties and methods. ... I can't mark the interface as Serializableand they wont serialize. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: MFC application with its own desktop
    ... It sounds like you want an application with multiple top-level windows. ... is for things like Office and apps that resemble Office apps, ... standard interfaces that solve the problem. ... I am a new guy in mfc. ...
    (microsoft.public.vc.mfc)