Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using suse sp1. I found there are difference between the output of comamnd "ip a" and "ifconfig", like:

nssh# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
    inet 127.0.0.2/8 brd 127.255.255.255 scope host secondary lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:21:28:f7:fc:70 brd ff:ff:ff:ff:ff:ff
    inet 10.175.140.214/25 brd 10.175.140.255 scope global eth0
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 00:21:28:f7:fc:71 brd ff:ff:ff:ff:ff:ff
4: eth7: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 90:e2:ba:0b:5e:68 brd ff:ff:ff:ff:ff:ff
5: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 00:21:28:f7:fc:72 brd ff:ff:ff:ff:ff:ff
6: eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 00:21:28:f7:fc:73 brd ff:ff:ff:ff:ff:ff
7: eth6: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 90:e2:ba:0b:5e:69 brd ff:ff:ff:ff:ff:ff

nssh# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:21:28:F7:FC:70  
          inet addr:10.175.140.214  Bcast:10.175.140.255  Mask:255.255.255.128
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:262033 errors:0 dropped:0 overruns:0 frame:0
          TX packets:61525 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:34290673 (32.7 Mb)  TX bytes:22269413 (21.2 Mb)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:7855586 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7855586 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:743730481 (709.2 Mb)  TX bytes:743730481 (709.2 Mb)

and in my case, the ifconfig gives the right result. since I've removed ifcfg-eth[1,2,3,6,7],under /etc/sysconfig/network. so my question is 1) why does ip a give out of date info? 2) how to flush the ip a somehow and let it give the up to date interface info?

share|improve this question
add comment

2 Answers

Don't think you can flush those out but you can delete:

ip link delete dev eth5

Not sure why they are showing different in your case... however, did you restart your network service afterwards? If not, you probably just deleted the files when the interfaces are still registered.

Another example would be when you say ifconfig eth0 down at that point the interface is administratively down but if you did ip addr you would still see it because ip addr shows interfaces that are not only not connected but those that are "administratively down".

share|improve this answer
add comment

ifconfig gets its information from /proc/net/dev and calls to ioctl. ip a (iproute2 addr) gets its information from the kernel via the Netlink API. My assumption would have been that this means ip a is likely to be more up-to-date if anything. You shouldn't need to (can't?) manually update iproute2

Does ifconfig -a still show the interfaces? Perhaps they are still present but currently inactive. ifconfig by default shows only currently-active interfaces.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.