Thursday, July 12, 2012

Learn fedora - Network interface 's renamed


I was new.... with fedora. When I installed it (fedora 17) in my virtualbox. I found network interface name (p2p1). So I just needed to change it to be "eth0". I tried to finding a lot in /etc/ path. but nothing what I figured out. Then, I read on link. So, I started to fix it by uncomment in  /lib/udev/rules.d/71-biosdevname.rules  file.
[root@fedora ~]# ifconfig
lo: flags=73  mtu 16436
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 0  (Local Loopback)
        RX packets 64  bytes 5952 (5.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 64  bytes 5952 (5.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
p2p1: flags=4163  mtu 1500
        inet 192.168.111.50  netmask 255.255.255.0  broadcast 192.168.111.255
        inet6 fe80::a00:27ff:fead:793d  prefixlen 64  scopeid 0x20
        ether 08:00:27:ad:79:3d  txqueuelen 1000  (Ethernet)
        RX packets 1538  bytes 140302 (137.0 KiB)
        RX errors 0  dropped 3  overruns 0  frame 0
        TX packets 1204  bytes 191575 (187.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
[root@fedora ~]#dmesg | grep p2p1
[   10.731136] udevd[374]: renamed network interface eth0 to p2p1
[root@fedora ~]# cp -a /lib/udev/rules.d/71-biosdevname.rules /tmp/71-biosdevname.rules-orig
[root@fedora ~]# vi /lib/udev/rules.d/71-biosdevname.rules
[root@fedora ~]# diff /tmp/71-biosdevname.rules-orig /lib/udev/rules.d/71-biosdevname.rules
15c15
< # GOTO="netdevicename_end"
---
> GOTO="netdevicename_end"
[root@fedora ~]# reboot 
 Then, I checked it again.
[root@fedora ~]# ifconfig -a
eth0: flags=4163  mtu 1500
        inet 192.168.111.50  netmask 255.255.255.0  broadcast 192.168.111.255
        inet6 fe80::a00:27ff:fead:793d  prefixlen 64  scopeid 0x20
        ether 08:00:27:ad:79:3d  txqueuelen 1000  (Ethernet)
        RX packets 119  bytes 12463 (12.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 111  bytes 16396 (16.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
lo: flags=73  mtu 16436
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 0  (Local Loopback)
        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
I knew this's simple for someone who works with it a long time. But it was something new and funny for me.


3 comments:

Anonymous said...

This worked a treat, thank you very much for documenting this!
Pete

Ákos Szabó said...

You can add biosdevname=0 to the kernel parameter line in grub.conf, or remove biosdevname rpm.

zatmania said...

Another solution is (my network interface named p2p1) :

edit /etc/sysconfig/network-scripts/ifcfg-p6p1 file, then add DEVICE=eth0. Rename file /etc/sysconfig/network-scripts/ifcfg-p6p1 to /etc/sysconfig/network-scripts/ifcfg-eth0, then reboot...

Job's done :)

zatmania