R
R
romy42019-09-26 20:49:37
linux
romy4, 2019-09-26 20:49:37

How to disable file rebind or make an overlay for a certain process?

The previous question was about creating a subnet for a separate tunnel. Understood, works - everything is fine. Except for one moment.
DNS resolving The dns resolving
subsystem (dns client) uses the file /etc/resolv.conf, which by default (coincidentally) is a link to /run/systemd/resolve/stub-resolv.conf.
Starting a process in a network namespace rebinds the link to the file from /etc/netns/myns/resolv.conf
But since I have one tunnel running without a namespace, some of its rules resolvconf is reloaded and updated accordingly /run/systemd/resolve/stub-resolv.conf, thereby destroying the rebinding for the process running in my mynsnamespace.
solution suggested on stackoverfly

nsenter --net=/var/run/netns/test unshare --mount sh -c 'mount --bind /etc/netns/test/resolv.conf /etc/resolv.conf; exec bash'
is essentially the same as
ip netns exec myns bash

How can rebinding or any other ideas be banned?
Essentially I need something overlayfs, but I'm very unsure if that's what I need. There must be an easier option.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question