This is the system call that would be needed: http://man7.org/linux/man-pages/man2/setns.2.html

Also, there's a veth device that can be simpler: http://man7.org/linux/man-pages/man4/veth.4.html



On Tue, Apr 28, 2020 at 12:22 PM Balazs Scheidler <bazsi77@gmail.com> wrote:
I think this shouldn't be more difficult than a setsockopt() provided syslog-ng has the appropriate permissions. 

also, if dns settings are not the same, that might complicate things.

On Tue, Apr 28, 2020, 09:58 Monitto Pitchaimani sebastin (mopitcha) <mopitcha@cisco.com> wrote:

Hi Gabor,

Thanks for the reply.

My use case is that syslog-ng is running in one namespace but I wanted to send the logs to the remote server which is reachable in another namespace.

Can we specify the outgoing namespace in destination network() in syslog-ng configuration.

 

Thanks,

Monitto

 

From: syslog-ng <syslog-ng-bounces@lists.balabit.hu> on behalf of Nagy Gábor <gabor.hl@gmail.com>
Reply to: Syslog-ng users' and developers' mailing list <syslog-ng@lists.balabit.hu>
Date: Monday, 27 April 2020 at 9:11 PM
To: Syslog-ng users' and developers' mailing list <syslog-ng@lists.balabit.hu>
Subject: Re: [syslog-ng] Syslog-ng network namespace support

 

Sorry if I misunderstood your question.
Do you mean does syslog-ng use Linux namespaces?
http://man7.org/linux/man-pages/man7/namespaces.7.html

AFAIK it does not.

If you mean that a remote host(e.g. server) has network namespaces, I think that should work, as that's transparent to a different host (e.g. client).

Can you elaborate your use case, please?

It's possible that we should submit a feature request on syslog-ng github page:
https://github.com/syslog-ng/syslog-ng/issues/

 

Regards,

Gábor

 

Monitto Pitchaimani sebastin (mopitcha) <mopitcha@cisco.com> ezt írta (időpont: 2020. ápr. 27., H, 17:22):

Hi All,

Does syslog-ng supports log forwarding to remote host in different network namespaces?

 

 

Regards,

Monitto

______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.balabit.com/wiki/syslog-ng-faq

______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.balabit.com/wiki/syslog-ng-faq



--
Bazsi