Gentoo Archives: gentoo-user

From: Michael Orlitzky <mjo@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] VRFs / Jails / Containers
Date: Sun, 03 Feb 2019 18:23:41
Message-Id: 74059fda-f78a-0dfb-3e51-e37825e60422@gentoo.org
In Reply to: Re: [gentoo-user] VRFs / Jails / Containers by Grant Taylor
1 On 2/3/19 12:39 PM, Grant Taylor wrote:
2 > On 2/3/19 6:26 AM, Michael Orlitzky wrote:
3 >> You can add commands to your existing network configuration that will be
4 >> run when an interface comes up. For example, in /etc/conf.d/net,
5 >>
6 >>   ifup_wlan0="iwconfig \$int key s:secretkey enc open essid foobar"
7 >
8 > Ya.... I find that to be an absolute kludge. Does it work? Yes. Is
9 > it clean? Probably not. Is it graceful? Absolutely not.
10 >
11 > Think about how it's possible to configure bridging / bonding / VLANs
12 > via various parameters and having netifrc construct the commands that
13 > are run in the background.
14 >
15
16 Ultimately netifrc is just a shell script that parses another shell
17 script to construct a third shell script. I don't think doing it with
18 only two shell scripts is that much less elegant =)
19
20 You could go all the way and write your own OpenRC service as
21 /etc/init.d/whatever. You can make it depend on the network being up,
22 and then just write everything that you want it to do into the start
23 function with the corresponding "undo" steps in the stop function.
24
25 If the series of commands is long and complicated and if you sometimes
26 want to do/undo this subset of the configuration independently, then
27 that's how I'd do it.

Replies

Subject Author
Re: [gentoo-user] VRFs / Jails / Containers Grant Taylor <gtaylor@×××××××××××××××××××××.net>