From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 60443198005 for ; Sun, 17 Mar 2013 09:53:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 22537E06CF; Sun, 17 Mar 2013 09:53:39 +0000 (UTC) Received: from smtp2.mail.fcom.ch (smtp2.mail.fcom.ch [212.60.46.171]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6238DE0698 for ; Sun, 17 Mar 2013 09:53:37 +0000 (UTC) Received: from dmj.nu (31-6-144-5-pool.cable.fcom.ch [5.144.6.31]) by smtp2.mail.fcom.ch (Postfix) with ESMTP id EDE2C2056E for ; Sun, 17 Mar 2013 09:53:35 +0000 (UTC) Received: from queen.localnet (queen.dmj.nu [192.168.1.11]) by dmj.nu with ESMTP; Sun, 17 Mar 2013 10:53:35 +0100 id 000000000070A243.000000005145929F.00001908 From: Dan Johansson To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Re: udev upgrade renames eth-interfaces Date: Sun, 17 Mar 2013 10:53:35 +0100 Message-ID: <2888772.qhxvxar0aE@queen> User-Agent: KMail/4.9.5 (Linux/3.7.10-gentoo; KDE/4.9.5; x86_64; ; ) In-Reply-To: References: <2684742.xaYK2yrzKb@queen> <1435275.X1LWAPJTBc@queen> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-message-flag: Using Microsoft software might be a security risk X-Virus-Scanned: clamav-milter 0.96.5 at smtp2 X-Virus-Status: Clean X-Archives-Salt: 44024213-7fcb-4352-aadd-88bbfdda394e X-Archives-Hash: a5f1efcd3d912cdb281ccd09fc599bbe On Saturday 16 March 2013 12.08:23 Canek Pel=E1ez Vald=E9s wrote: > On Sat, Mar 16, 2013 at 11:03 AM, Dan Johansson wrote: > > On Saturday 16 March 2013 09.39:17 Jonathan Callen wrote: > >> > Hello, > >> > > >> > Today I upgraded udev on one of my boxes (after hesitating a lon= g > >> > time). Even if I have /etc/udev/rules.d/80-net-name-slot.rules = and > >> > my old 70-persistent-net.rules in place, my interfaces gets rena= med > >> > (eth0 gets swapped with eth1) which then messes up my whole > >> > configuration (routing tables and firewall rules). Any suggestio= n > >> > how to keep my old names and order? > >> Udev, as of version 187, will now refuse to rename a network inter= face > >> to the name of a network interface that already exists -- which, d= ue > >> to race conditions, can be the case if you are attempting to renam= e a > >> network device to a name the kernel will later use to name the nex= t > >> enumerated device. The fix for this issue is to *not* use names t= hat > >> match "eth[0-9]*", "wlan[0-9]*", etc. and instead use a name that = the > >> kernel would *not* automatically assign. Unfortunately, that mean= s > >> that you *cannot* keep your old names and order (upstream claims t= hat > >> the means used to ensure those names were used was unreliable and > >> prone to race conditions anyway, which, looking at the code, I can= > >> believe). > > This is great... > > (I hope you can hear the irony) > > > > OK, so I removed the two udev rules (70-persistent-net and 80-net-n= ame-slot) files, thinking if this is the way the "upstream devs" are go= ing then I have to check it out. >=20 > That's the smart thing to do. >=20 > > After removing the udev-rules and rebooting I got my two new networ= k interfaces called enp0s4 and enp0s5 (no idea what that is supposed to= mean). >=20 > http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkIn= terfaceNames >=20 > http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builti= n-net_id.c >=20 > Basically, "en" is for "ethernet", "p" is for "PCI bus", and "0s4" an= d > "0s5" is for the topology of the cards in your machine: the cards are= > in the PCI bus number 0, slot number 4 and 5. In other words, if you > do "find /sys -name enp0s4", I'm betting you will get something like:= >=20 > /sys/devices/pci0000:00/0000:00:1c.1/0000:00:004.0/net/enp0s4 >=20 > The "0000:00:004.0" is the part that determines the naming of yout > device. This naming is deterministic: as long as you don't move the > cards from PCI slot, they will be named like that always. >=20 > > My next step was to replace eth0 with enp0s5 and eth1 with enp0s4 i= n /etc/conf.d(net and create two new links (net.lo -> net.enp0s[45]) in= /etc/init.d > > Now I could start the two network interfaces (/etc/init.d/net.enp0s= [45] start). > > BUT, as soon as I try to start some service (sshd, ntpd, ...) that= is using the network I get a lot of complains that eth0 and eth1 is no= t started (and can not be started) and the service wont start. > > What have I missed??? >=20 > Do you have net.eth0 or net.eth1 in /etc/rc.conf? No, but I still had the links in /etc/init.d/. Removing those and addin= g lins for enp0s[45] did the trick. Thanks, --=20 Dan Johansson, *************************************************** This message is printed on 100% recycled electrons! ***************************************************