Hi all,

I would like to bring up and configure a network interface which
exists in a (network) namespace.  I would like to use standard OpenRC
'net.<iface>' init script to do so.

Since the interface (veth1) exists only in a namespace (myns) I need
that the init script would be executed within that namespace:

  ip netns exec myns /etc/init.d/net.veth1 start|stop|...

While I can do that manually as above the automatic run (during boot)
is however executed in the global namespace.

My current, not very good approach is that I've created a wrapper around
runscript and created a copy of /etc/init.d/net.lo
to /etc/init.d/net.veth1 where I've changed the first line to that
wrapper.  It does work when invoking the script manually but it is not
executed by OpenRC at all during boot or when I type 'rc' even if
net.veth1 is included in default runlevel.  Also, to have a copy of init
script is not very nice.  Therefore I'm seeking other solutions.  Is
there any way to tell OpenRC that it should configure an interface
in a specific namespace?

The wrapper script for curious:

  #!/bin/sh
  namespace=${1}
  shift
  /bin/ip netns exec ${namespace} /sbin/runscript ${@}

First line of /etc/init.d/net.veth1 then looks like this:

  #!/usr/local/bin/runscript-netns myns

Robert


-- 
Róbert Čerňanský
E-mail: ope...@tightmail.com
Jabber: h...@jabber.sk

Reply via email to