Difference between revisions of "Rename network interfaces"

From ArchWiki
Jump to: navigation, search
m (Option 1: udev: correction of typo in udev rule)
(restore lost link fragment)
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Hardware detection and troubleshooting]]
+
#REDIRECT [[Network configuration#Network_Interfaces]]
[[Category:Networking]]
+
{{merge|Configuring Network}}
+
 
+
==Prerequisites==
+
* {{Ic|ifrename}} tool which is a part of the {{Ic|wireless_tools}} package.
+
* {{Ic|udev}} package, which is already installed, of course.
+
 
+
==Generic network interfaces==
+
 
+
===Option 1: udev===
+
 
+
Create {{ic|/etc/udev/rules.d/10-network.rules}} file with content like following:
+
 
+
  SUBSYSTEM=="net", ATTR{address}=="00:1e:58:48:33:08", NAME="lan"
+
  SUBSYSTEM=="net", KERNEL=="tap1", NAME="vpn"
+
  SUBSYSTEM=="net", KERNEL=="tap5", NAME="qemu"
+
 
+
{{Note|Make sure to use the lower-case hex values in your udev rules. It doesn't like uppercase.}}
+
 
+
===Option 2: ifrename===
+
Run ifrename directly
+
 
+
  ifrename -i eth0 -n lan
+
 
+
or create config file ({{ic|/etc/iftab}}), for example:
+
 
+
lan mac 00:0C:6E:C6:94:81
+
internet mac 00:0C:6E:C6:94:82
+
 
+
and run
+
 
+
  $ ifrename -c /etc/iftab
+
 
+
==PPP interfaces==
+
Add into {{ic|/etc/ppp/ip-up}} script the following lines:
+
 
+
  IF=$1
+
  /sbin/ifconfig $IF down
+
  /usr/sbin/ifrename -i $IF -n <NEWNAME>
+
  /sbin/ifconfig <NEWNAME> up
+
 
+
where <NEWNAME> is the new name for the ppp interface
+

Latest revision as of 13:50, 18 February 2014