1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
#MAC address of the Ethernet device ifconfig -a | grep -i --color hwaddr #Sample outputs: > eth0 Link encap:Ethernet HWaddr ku:ta:yz:or:lu:.c lan0 Link encap:Ethernet HWaddr 1a:c1:00:ed:5d:99 wlan0 Link encap:Ethernet HWaddr 00:21:6a:ca:9b:33 # !!!Step #1: Find out the MAC address of the Ethernet device Type the following command: # ifconfig -a | grep -i --color hwaddr Sample outputs: eth0 Link encap:Ethernet HWaddr b8:ac:6f:65:31:e5 lan0 Link encap:Ethernet HWaddr 4a:71:40:ed:5d:99 wlan0 Link encap:Ethernet HWaddr 00:21:6a:ca:9b:10 Note down the MAC address. # >> change the name eth0 as wan0 # To rename eth0 as wan0, edit a file called 70-persistent-net.rules in /etc/udev/rules.d/ directory, enter: # vi /etc/udev/rules.d/70-persistent-net.rules The names of the Ethernet devices are listed in this file as follows: # PCI device 0x14e4:0x1680 (tg3) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="ku:ta:yz:or:lu:co", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" Locate and identify the line with the NIC from step 1 (look for the MAC address). It may look like above. In this example, the interface eth0 will be renamed to wan0 (change NAME="eth0" to NAME="wan0"): # PCI device 0x14e4:0x1680 (tg3) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="ku:ta:yz:or:lu:co", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="wan0" Save and close the file. Reboot the system to test changes: # reboot #! Rename eth0 as wan0 # >> change NAME="eth0" to NAME="wan0"): # Save and close the file. Reboot the system to test changes: reboot # Checking # ifconfig -a # ifconfig wan0 # ifconfig -a | less # ip addr show |