Difference between revisions of "Rename network interfaces"

From ArchWiki
Jump to: navigation, search
(Created page with 'Category:HOWTOs_(English) ==Generic network interfaces== ===Option 1: udev=== Create /etc/udev/rules.d/10-network.rules file with content like following: SUBSYSTEM=="ne…')
 
Line 1: Line 1:
 
[[Category:HOWTOs_(English)]]
 
[[Category:HOWTOs_(English)]]
 +
 +
==Prerequisites==
 +
* ifrename tool which is a part of wireless_tools package
 +
* udev package, which is already installed of course
  
 
==Generic network interfaces==
 
==Generic network interfaces==
Line 19: Line 23:
  
 
  lan mac 00:0C:6E:C6:94:81
 
  lan mac 00:0C:6E:C6:94:81
 +
internet mac 00:0C:6E:C6:94:82
  
 
and run
 
and run

Revision as of 16:37, 2 March 2010


Prerequisites

  • ifrename tool which is a part of wireless_tools package
  • udev package, which is already installed of course

Generic network interfaces

Option 1: udev

Create /etc/udev/rules.d/10-network.rules file with content like following:

 SUBSYSTEM=="net", ATTRS{address}=="00:1e:58:48:33:08", NAME="lan"
 SUBSYSTEM=="net", KERNEL=="tap1", NAME="vpn"
 SUBSYSTEM=="net", KERNEL=="tap5", NAME="qemu"

Option 2: ifrename

Run ifrename directly

 ifrename -i eth0 -n lan

or create config file (/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 /etc/ppp/ip-up script following lines:

 IF=$1
 /sbin/ifconfig $IF down
 /usr/sbin/ifrename -i $IF -n <NEWNAME>
 /sbin/ifconfig <NEWNAME> up

where NEWNAME is new name for ppp interface