Nama device yang di generate biasanya diawali dengan :
- lo untuk loop address atau lokal address
- eth untuk ethernet
- wlan untuk wireless
- vmnet untuk virtual machine network
$ ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:160 errors:0 dropped:0 overruns:0 frame:0
TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:16479 (16.4 KB) TX bytes:16479 (16.4 KB)
eth2 Link encap:Ethernet HWaddr 00:25:b3:6d:09:3a
inet addr:192.168.1.50 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::225:b3ff:fe6d:93a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9194 errors:0 dropped:0 overruns:0 frame:0
TX packets:6711 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3857514 (3.8 MB) TX bytes:1260397 (1.2 MB)
Interrupt:17
vmnet0 Link encap:Ethernet HWaddr 00:50:56:c0:00:00
inet addr:172.16.182.1 Bcast:172.16.182.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan1 Link encap:Ethernet HWaddr 00:22:fa:b8:57:98
inet addr:10.42.43.1 Bcast:10.42.43.255 Mask:255.255.255.0
inet6 addr: fe80::222:faff:feb8:5798/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:3179 (3.1 KB)
- Untuk list diatas adalah list configurasi network dengan 1 adapter
- Nah kita akan merubah nama ethernet eth2 menjadi eth0
$ sudo pico /etc/udev/rules.d/70-persistent-net.rules
# This file maintains persistent names for network interfaces.
# See udev(7) for syntax.
#
# Entries are automatically added by the 75-persistent-net-generator.rules
# file; however you are also free to add your own entries.
# PCI device 0x11ab:0x436c (sky2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:b3:46:ff:da", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x4237 (iwlagn)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:22:fa:cd:c6:46", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
# USB device 0x0bb4:0x0303 (usb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="80:00:60:0f:e8:00", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x11ab:0x436c (sky2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:b3:6d:09:3a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x8086:0x4237 (iwlagn)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:22:fa:b8:57:98", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan1"
- Dari scipt di atas bisa kita rubah eth2 dengan eth0, tapi eth0 sudah ada dan kebetulan tidak dipakai lagi, jadi bisa saja kita menghapus scipt
# PCI device 0x11ab:0x436c (sky2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:b3:46:ff:da", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
- Sesuaikan mac address di scipt dengan mac address adapter sebenarnya
- Bisa juga kita merubah nama eth2 menjadi nama lain misalkan LAN
# PCI device 0x11ab:0x436c (sky2)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:b3:6d:09:3a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="LAN"
- Simpan dengan ctrl+o dan enter
- restart komputer
- Lihat network dengan "ifconfig" tanpa tanda petik dan lihat apakah nama device sudah terganti
0 comments: