[UPDATED:] Re: confusion on /sbin/ifconfig on F16

Paul Allen Newell pnewell at cs.cmu.edu
Wed May 23 03:22:00 UTC 2012


[updated, keeping original post and adding new info at bottom]

On 5/22/2012 8:12 PM, Paul Allen Newell wrote:
> Hello:
>
> As I continue dealing with iptables, another issue has come up that I 
> can't tell is a mis-understanding on my part or a potential problem
>
> I have three F16 machines, one x86_64 and two i383/686. If I run 
> /sbin/ifconfig on them, I get (short summary of):
>
> x86_64: eth0
> i686: em1
>
> Looking in /etc/sysconfig/network-scripts, I can see only ifcfg-em1 
> and no ifcfg-eth0 on all the machines (x86_64 and i686).
>
> The closest bugzilla I can see if 784314 but it looks like it hints 
> that ifconfig is old-school and the right way to do things (and its 
> F17 not F16).
>
> Does anyone know what I am either doing wrong or if this looks like a 
> problem/bug. Plus, if there is a better way, I'd love to know.
>
> What I want to do is have is a bash way to get the static ip address 
> of the machine which I can see in eth0/em1. I've been using something 
> I found online which assumes everything is eth0 (as in I think it was 
> for older Fedora):
> +++
> /sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'
> +++
>
> Its too clever for me to have come up with on my own (smile).
>
> I tried expanding the grep to be 'inet addr:192.168.2' but that failed 
> on the laptop which has an entry for wireless which is dhcp (I cannot 
> assume wireless will be 192.168.2.*).
>
> Any suggestions appreciated,
> Thanks,
> Paul

Okay, so I managed to figure out that 'ip' is the new command. I'd 
looked at it earlier to try to find a way around this, but couldn't 
figure it out. Just spotted the 'obsolete, use ip' in man page of 
ifconfig. As usual, there is always something discovered right after I 
make the post.

Should I assume that even if ifconfig is giving a problem, its academic 
and I should just focus on ip. And, if so, how the heck does one get the 
ip addr. If I use "ip addr show", I still get eth0 on the x86_64 and em1 
on the i686?

Thanks,
Paul



More information about the users mailing list