A few software are based on a command like ifconfig -a | grep HWaddr .... to get either the mac address or the IP address. In fedora 17, this HWaddr is missing. Even though we can easily replace HWaddr by "ether" to get the mac address when it is our own software, it's hard when it's some one else. And sometimes it's just embedded and we cannot change anything.

Questions:

1) Is there a way to get back the old output. (like if we don't want the new interface name, we can go back to the old eth*)?

Well, if the source is open and the license allows it, you could always customize the program to your own needs.
Whether it is a good idea to let your (own) program(s) depend on the output of a tool like ifconfig is up to you to decide (it is being deprecated by a lot of distros and I believe there are more efficient ways to obtain a mac address programming wise).

The way the interfaces are named has changed because the new way better resembles the actual physical conditions of the machine.
You can read about this over here (and this also points you in the direction on how to revert back to the old way).

A few software are based on a command like ifconfig -a | grep HWaddr .... to get either the mac address or the IP address. In fedora 17, this HWaddr is missing. Even though we can easily replace HWaddr by "ether" to get the mac address when it is our own software, it's hard when it's some one else. And sometimes it's just embedded and we cannot change anything.

Questions:

1) Is there a way to get back the old output. (like if we don't want the new interface name, we can go back to the old eth*)?

2) Why has it been changed?

thanks

Franck

ifconfig is being deprecated and uses deprecated ioctl to obtain information. You should switch to 'ip' for general use. 'ip uses netlink which is the modern way to do this.

It is NOT SMART (tm) to create scripts or programs that depend on the specific format output of commands. That is amateurish. It's OK for a local hack, but does not belong in supported software. The text changed b/c the upstream developer thought the new text was better. The text output of these commands of is meant for humans and WILL change again.

Before we get to the question of HOW a script should get get the IP or MAC address, I think we should ask WHY is your script trying to get these ? Normally unless you are changing the interface you should just use the hostname of the interface and not the numerical IP. The MAC address is an 802.11 station identifier and not all networks use 802.11 - so this may be undesirable.

Sadly there is no good way to access I P& MAC from a script w/o writing some code. Maybe ther eis a perl or tcl libary t ouse netlink.

__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe

To answer the question why we would like to get the MAC address and the IP address, it's because the MAC address is being use to generate a unique ID to be register by a remote server. Is that a good use of it, I don't know but I was able to hack the script and make this part work.
About the IP address. Sometime you don't have a public (externally known) hostname and sometimes, you have 1 hostname for multiple IPs. So no, using the hostname is not always the best option, sometime you just can't.

The question is I guess, what is the best way to get an ip address?
if we can't trust the output of a command, then we cannot use any command, not even ip since the output may change format. I don't see a command that gives me a list of IPs, and even if there were, then the format may change. So what's the way of getting the IP address?