netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Make predictable/persistent network interface names more handy
@ 2015-01-11 20:52 Richard Weinberger
  2015-01-11 20:52 ` [PATCH 1/3] net: Make interface aliases available for general usage Richard Weinberger
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: Richard Weinberger @ 2015-01-11 20:52 UTC (permalink / raw)
  To: davem
  Cc: coreteam, netfilter-devel, linux-kernel, netdev, bhutchings,
	john.fastabend, herbert, vyasevic, jiri, vfalico, therbert,
	edumazet, yoshfuji, jmorris, kuznet, kadlec, kaber, pablo, kay,
	stephen

Since the Linux distribution of my choice makes use of
predictable network interface names[0] my USB gadgets
are no longer usb0 but enp0s29u1u2. Same for all other network devices.
While I can fully understand that this new naming scheme makes sense
for a lot of people and makes their work easier it does not really work for me.
My brain is not able to remember that my Beaglebone's USB-Ethernet
is now enp0s29u1u2. Even after looking at the output of ifconfig
I have to copy&paste the interface name.
Instead of just disabling the feature I thought about
a generic solution which satisfies both needs.

For block devices we also have predictable device names,
udev creates a symlink to the kernel device.
This works very good and reliable.
My idea is to use the network device alias as symlink.
Such that we can have both the easy to use kernel name and
the predictable/persistent name from udev.
systemd/udev could store the original kernel interface name
as alias after renaming the interface.
Existing users would not notice but one can still use the kernel name.
So I can use tcpdump -i usb0 _and_ tcpdump -i enp0s29u1u2.

This patch series implements my idea.
I'd love to get some feedback!

Patch 1/3 exposes the interfaces alias for general userspace usage, i.e. that ifconfig <alias> works.
Of course you can only use the first 15 chars of an alias.

In-kernel users of interface names need also an update, patch 2/3 updates x_tables.
I'm sure there is more todo, i.e. nftables.
We could also define that netfilter will never use the alias but this needs documented cleary.

Patch 3/3 is a cleanup in continuation of 2/3.

[0] http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/

Thanks,
//richard

git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc.git netalias

[PATCH 1/3] net: Make interface aliases available for general usage
[PATCH 2/3] x_tables: Use also dev->ifalias for interface matching
[PATCH 3/3] x_tables: Factor out 16bit aligment ifname_compare()

 include/linux/netdevice.h          |  1 +
 include/linux/netfilter/x_tables.h | 41 +++++++++++++++++++++++++++---
 include/net/net_namespace.h        |  1 +
 net/core/dev.c                     | 52 ++++++++++++++++++++++++++++++++++++++
 net/ipv4/netfilter/arp_tables.c    | 37 ++++-----------------------
 net/ipv4/netfilter/ip_tables.c     | 15 ++++-------
 net/ipv6/netfilter/ip6_tables.c    | 18 +++++--------
 net/netfilter/xt_physdev.c         |  9 ++-----
 8 files changed, 110 insertions(+), 64 deletions(-)

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2015-01-12 17:41 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-11 20:52 [RFC] Make predictable/persistent network interface names more handy Richard Weinberger
2015-01-11 20:52 ` [PATCH 1/3] net: Make interface aliases available for general usage Richard Weinberger
2015-01-11 22:40   ` Stephen Hemminger
2015-01-11 22:43     ` Richard Weinberger
2015-01-11 20:52 ` [PATCH 2/3] x_tables: Use also dev->ifalias for interface matching Richard Weinberger
2015-01-12 16:04   ` Eric Dumazet
2015-01-12 16:12     ` Richard Weinberger
2015-01-12 16:32     ` Jan Engelhardt
2015-01-12 16:46       ` Eric Dumazet
     [not found]     ` <1425960.ovH4s7sjue@rofl>
2015-01-12 16:51       ` Eric Dumazet
2015-01-12 17:19         ` Patrick Schaaf
2015-01-12 17:22           ` Patrick McHardy
2015-01-12 17:41             ` Patrick Schaaf
2015-01-11 20:52 ` [PATCH 3/3] x_tables: Factor out 16bit aligment ifname_compare() Richard Weinberger
2015-01-11 20:59   ` Joe Perches
2015-01-11 21:02     ` Richard Weinberger
2015-01-11 21:14       ` Joe Perches
2015-01-11 21:30         ` Richard Weinberger
2015-01-11 21:39           ` Joe Perches
2015-01-11 21:42             ` Richard Weinberger
2015-01-12  2:50               ` David Miller
2015-01-12  8:18                 ` Richard Weinberger
2015-01-12  8:40                   ` Joe Perches
2015-01-11 22:23           ` Jan Engelhardt
2015-01-11 22:42 ` [RFC] Make predictable/persistent network interface names more handy Stephen Hemminger
2015-01-11 22:47   ` Richard Weinberger
2015-01-11 22:51   ` Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).