[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Naming of network devices - how to improve it in buster



On Sun, Jul 16, 2017 at 01:54:27PM +0200, Guus Sliepen wrote:
> On Sat, Jul 15, 2017 at 10:25:22PM -0300, Henrique de Moraes Holschuh wrote:
> > It is indeed Very Cool, but it might not solve one little thing:
> > iptables firewalling.
> > 
> > Is that a way to trigger an ifrename using this, so that the network
> > device ends up being named "foo" ?
> 
> That's indeed an interesting issue. Currently, ifupdown doesn't rename
> interfaces. You could add a line like:
> 
> 	post-up ip link set $IFACE name $LOGICAL
> 
> Which will do what you want, except ifupdown doesn't track interface
> renames this way and will get very confused. In particular, ifdown will
> not work anymore. So some code should be added to ifupdown to support
> interface renaming.

This is what I assumed your new code does -- it seemed an obvious and
natural thing to do.

As Ben noticed, the post-up stanza above can't work as Linux doesn't allow
renaming interfaces at that point.  It can't work in pre-up either as
ifupdown wouldn't know about the rename.

Thus, what about this:
auto mac/00:16:0a:26:99:c6/=en0
iface en0 inet6 static
	address 3:1415:9265:3589:7932:3846:2643:3832/64
	gateway 3:1415:9265:3589::1
	rename

With the rename command taking an optional argument (the new name) that
defaults to the logical name (ie, after =).


Meow!
-- 
⢀⣴⠾⠻⢶⣦⠀ 
⣾⠁⢠⠒⠀⣿⡁ A dumb species has no way to open a tuna can.
⢿⡄⠘⠷⠚⠋⠀ A smart species invents a can opener.
⠈⠳⣄⠀⠀⠀⠀ A master species delegates.


Reply to: