You are not logged in.

#1 2013-01-04 05:50:18

solarwind
Member
From: Toronto
Registered: 2008-03-18
Posts: 546

/etc/iftab not being respected

Hi all,

I'm running an up-to-date Arch Linux on my server which has two gigabit Ethernet ports. I have my /etc/iftab as follows:

eth0 mac 00:1d:7d:96:f8:dd
eth1 mac 64:70:02:10:55:41

However, ifconfig -a tells me that the interfaces are the opposite of what I have configured in the iftab - even after rebooting.

% ifconfig -a                                                                                                                 [0]
eth0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 64:70:02:10:55:41  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.2  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::21d:7dff:fe96:f8dd  prefixlen 64  scopeid 0x20<link>
        ether 00:1d:7d:96:f8:dd  txqueuelen 1000  (Ethernet)
        RX packets 641  bytes 65608 (64.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 502  bytes 88518 (86.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I remember that I had it working correctly at some point, but after a recent update, the system has stopped respecting iftab.

I'm using kernel 3.6.11-1 and netcfg by the way.

Offline

#2 2013-01-04 06:27:43

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: /etc/iftab not being respected

Just use a udev rule. As far as I can tell, netcfg provides a rc.d script for interface renaming but not a systemd unit.

SUBSYSTEM=="net", ATTR{address}=="00:1d:7d:96:f8:dd", NAME="eth0"
SUBSYSTEM=="net", ATTR{address}=="64:70:02:10:55:41", NAME="eth1"

https://wiki.archlinux.org/index.php/Re … on_1:_udev


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#3 2013-01-04 11:05:30

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: /etc/iftab not being respected

Notice that the wiki explicitly doesn't use names like eth0 and eth1 -- attempting to use them will fail.

Offline

#4 2013-01-04 12:11:31

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: /etc/iftab not being respected

solarwind - if you really want to stick with your iftab method, you should make sure ifrename is being called. That's the tool that uses iftab, after all.

Offline

#5 2013-01-04 20:05:09

solarwind
Member
From: Toronto
Registered: 2008-03-18
Posts: 546

Re: /etc/iftab not being respected

Thanks everyone, I'll edit the wiki with this info.

netcfg provides /etc/iftab, but doesn't provide nor depend on ifrename (wireless_tools). Interesting. It provides a script in /etc/rc.d to run ifrename (again, which it doesn't depend on), but doesn't provide any systemd config as far as I know. Seems like netcfg needs some cleanup.

Offline

#6 2013-01-04 20:33:56

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: /etc/iftab not being respected

Try some more careful reading:

$ pacman -Si netcfg
...<snip>...
Optional Deps  : ...<snip>...
                 wireless_tools: for interface renaming through net-rename
...<snip>...

As for cleaning up netcfg, you're probably looking for this. Also, given the upcoming deprecation of wireless_tools in favour of iw, you might want to check what they're doing about ifrename, if anything.

Offline

#7 2013-02-12 03:26:38

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 237

Re: /etc/iftab not being respected

I've created /etc/systemd/system/net-rename.service with the following content:

[Unit]
Description=Rename network interfaces according to /etc/iftab
Before=netcfg.service

[Service]
ExecStart=/usr/sbin/ifrename

[Install]
WantedBy=multi-user.target

and then

% systemctl enable net-rename.service

It works for me.

Offline

Board footer

Powered by FluxBB