jiahu
2014-May-23 12:02 UTC
Re: [libvirt-users] [netcf] Why netcf can not rename a existing physical interface dynamically by itself?
On 05/23/2014 04:56 PM, Laine Stump wrote:> On 05/23/2014 06:46 AM, Jianwei Hu wrote: >> Hi All, >> >> I have a usage question about netcf. Why netcf can not rename a existing physical interface dynamically by itself? > The name of a physical interface is determined by lower levels of the > operating system, and can't be modified by netcf. the configuration that > is setup by netcf can only reference an *existing* physical device nam[root@rhel6 ~]# ip link set name jiahu eth1 > [root@rhel6 ~]# ifconfig jiahu > jiahu Link encap:Ethernet HWaddr 00:1B:21:27:4E:CE > BROADCAST MULTICAST MTU:1500 Metric:1 > RX packets:0 errors:0 dropped:0 overruns:0 frame:0 > TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) > > [root@rhel6 ~]# ifup jiahu > > Determining IP information for jiahu... done. > e, > it can't rename it.OK, thanks, but I think we can use ip command line to rename existing NIC. [root@rhel6 ~]# ip link set name jiahu eth1 [root@rhel6 ~]# ifconfig jiahu jiahu Link encap:Ethernet HWaddr 00:1B:21:27:4E:CE BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) [root@rhel6 ~]# ifup jiahu Determining IP information for jiahu... done.>> If you have any other method, please share to me, or can we add support for it in netcf? > One source of information is here: > > > http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ > > (although that only completely applies to systems running recent > systemd, e.g. Fedora 20, but not to RHEL6 as you appear to be running) > > There is a reference there of how to change an interface name in a > system that isn't using "predictable network interface names" (or > biosdevname, which was a short-lived alternative attempt at a solution > to the same problem): modify the file > /etc/udev/rules.d/70-persistent-net.rules. You'll need to reboot the > system for this to take effect. >
Laine Stump
2014-May-23 14:31 UTC
Re: [libvirt-users] [netcf] Why netcf can not rename a existing physical interface dynamically by itself?
On 05/23/2014 03:02 PM, jiahu wrote:> > On 05/23/2014 04:56 PM, Laine Stump wrote: >> On 05/23/2014 06:46 AM, Jianwei Hu wrote: >>> Hi All, >>> >>> I have a usage question about netcf. Why netcf can not rename a >>> existing physical interface dynamically by itself? >> The name of a physical interface is determined by lower levels of the >> operating system, and can't be modified by netcf. the configuration that >> is setup by netcf can only reference an *existing* physical device >> nam[root@rhel6 ~]# ip link set name jiahu eth1 >> [root@rhel6 ~]# ifconfig jiahu >> jiahu Link encap:Ethernet HWaddr 00:1B:21:27:4E:CE >> BROADCAST MULTICAST MTU:1500 Metric:1 >> RX packets:0 errors:0 dropped:0 overruns:0 frame:0 >> TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 >> collisions:0 txqueuelen:1000 >> RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) >> >> [root@rhel6 ~]# ifup jiahu >> >> Determining IP information for jiahu... done. >> e, >> it can't rename it. > OK, thanks, but I think we can use ip command line to rename existing > NIC. > > [root@rhel6 ~]# ip link set name jiahu eth1 > [root@rhel6 ~]# ifconfig jiahu > jiahu Link encap:Ethernet HWaddr 00:1B:21:27:4E:CE > BROADCAST MULTICAST MTU:1500 Metric:1 > RX packets:0 errors:0 dropped:0 overruns:0 frame:0 > TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) > > [root@rhel6 ~]# ifup jiahu > > Determining IP information for jiahu... done.Neat! That's probably using the same netlink command that's used to rename it at boot time. However, if you do what you suggest, the name change won't be persistent across a system reboot. I still say this is too low level for netcf to be messing with; it was created to provide a standard way to manipulate the config files, not mess with the hardware. (Note that it's also possible to change the mac address of an ethernet device (ip link set $dev address $addr) , but we don't support that either, and have no plans to do so.)
hujianwei
2014-May-26 02:07 UTC
Re: [libvirt-users] [netcf] Why netcf can not rename a existing physical interface dynamically by itself?
>> OK, thanks, but I think we can use ip command line to rename existing >> NIC. >> >> [root@rhel6 ~]# ip link set name jiahu eth1 >> [root@rhel6 ~]# ifconfig jiahu >> jiahu Link encap:Ethernet HWaddr 00:1B:21:27:4E:CE >> BROADCAST MULTICAST MTU:1500 Metric:1 >> RX packets:0 errors:0 dropped:0 overruns:0 frame:0 >> TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 >> collisions:0 txqueuelen:1000 >> RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) >> >> [root@rhel6 ~]# ifup jiahu >> >> Determining IP information for jiahu... done. > Neat! That's probably using the same netlink command that's used to > rename it at boot time. However, if you do what you suggest, the name > change won't be persistent across a system reboot. > > I still say this is too low level for netcf to be messing with; it was > created to provide a standard way to manipulate the config files, not > mess with the hardware. (Note that it's also possible to change the mac > address of an ethernet device (ip link set $dev address $addr) , but we > don't support that either, and have no plans to do so.)Good conclusion, thanks again, I agree with you.
Reasonably Related Threads
- [netcf] Why netcf can not rename a existing physical interface dynamically by itself?
- Re: [netcf] Why netcf can not rename a existing physical interface dynamically by itself?
- Re: [netcf] Why netcf can not rename a existing physical interface dynamically by itself?
- [netcf]IFF_RUNNING flag on a bridge device
- Re: [netcf]IFF_RUNNING flag on a bridge device