/sbn/ifconfig or /sbin/ip

Live forum: /viewtopic.php?t=36

chad

12-10-2004 23:40:43

I've always used the /sbin/ifconfig command to list the configuration of my network interfaces. Recently I've upgraded a couple of RedHat 7.3 servers to SuSE 9.1 Pro. There are a couple virtual IP addresses (aliases) bound on this box and when I use the /sbin/ifconfig command it only shows eth0 and the "primary" address.

theword:~ # /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:8B:C5:D2:E0
inet addr:1.1.1.1 Bcast:1.1.255.255 Mask:255.255.0.0
inet6 addr: fe80::250:8bff:fec5:d2e0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:79100820 errors:0 dropped:4 overruns:4 frame:0
TX packets:73860649 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3606724465 (3439.6 Mb) TX bytes:3651299255 (3482.1 Mb)


On RedHat it would show both eth0 and eth0:1 and the virtual IP bound to each. Now with the "/sbin/ip addr" command on the SuSE box I can see the virtual IPs.

theword:~ # /sbin/ip addr
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
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
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:50:8b:c5:d2:e0 brd ff:ff:ff:ff:ff:ff
inet 1.1.1.1/16 brd 1.1.255.255 scope global eth0
inet 1.1.1.2/16 brd 1.1.255.255 scope global secondary eth0
inet6 fe80::250:8bff:fec5:d2e0/64 scope link
valid_lft forever preferred_lft forever
3: sit0: <NOARP> mtu 1480 qdisc noqueue
link/sit 0.0.0.0 brd 0.0.0.0


So now the questions. What command does eveybody use, "ipconfig" or "ip"? Are there any other distros that exhibit this behavior?

Colleen

13-10-2004 00:06:26

So now the questions. What command does eveybody use, "ipconfig" or "ip"? Are there any other distros that exhibit this behavior?

On my Debian machines there is no "ip" command. /sbin/ifconfig spits out info for all of the IPs on my router's WAN interface (they're aliased in the eth0:x form like yours).

Good to know about Suse though, thanks ;-)

- Colleen

wolfie

13-10-2004 07:41:46

Chad,

What does ifconfig -a show?

chad

13-10-2004 09:24:45

What does ifconfig -a show?

Yea, I remeber that from the work I've done on some OpenBSD boxes. Let's see what it looks like on my SuSE box...

theword:~ # ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:50:8B:C5:D2:E0
inet addr:1.1.1.1 Bcast:1.1.255.255 Mask:255.255.0.0
inet6 addr: fe80::250:8bff:fec5:d2e0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:80811730 errors:0 dropped:4 overruns:4 frame:0
TX packets:75453546 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3938732087 (3756.2 Mb) TX bytes:4204993913 (4010.1 Mb)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:6700809 errors:0 dropped:0 overruns:0 frame:0
TX packets:6700809 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:826189551 (787.9 Mb) TX bytes:826189551 (787.9 Mb)

sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 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:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

wolfie

13-10-2004 09:32:31

I believe that ifconfig only will show interfaces that are configured and up. If not you have to use "-a" to see all interfaces. There might have been an alias set on ifconfig so that it always had the -a but I am not sure. :)

Colleen

13-10-2004 12:03:40

I believe that ifconfig only will show interfaces that are configured and up. If not you have to use "-a" to see all interfaces. There might have been an alias set on ifconfig so that it always had the -a but I am not sure. :)

The thing that strikes me as odd about what Chad's seeing is that he's not seeing the loopback interface with just "ifconfig" - it appears to be configured and up, right?

chad

13-10-2004 13:37:57

About the loopback interface. It seems that I didn't quite get that pasted into my "code" example.

Using "ifconfig -a" does show the loopback interface. However, it does NOT show the aliased or virtual IP. Oh well, guess this is one of those "SuSEisms" I've heard about. :?

Despite

13-10-2004 13:45:35

maybe you'll get lucky and have multiple SuSEisms.

wolfjb

13-10-2004 15:56:51

About the loopback interface. It seems that I didn't quite get that pasted into my "code" example.

Using "ifconfig -a" does show the loopback interface. However, it does NOT show the aliased or virtual IP. Oh well, guess this is one of those "SuSEisms" I've heard about. :?


you could always switch to Debian.... :idea:

Colleen

13-10-2004 16:41:47


you could always switch to Debian.... :idea:


Excellent idea! :D

chad

13-10-2004 18:17:51

I was waiting for a remark such as that. Actually, I figured it would come from wolfie first, with Gentoo. :)

wolfjb

13-10-2004 22:48:51

Woo Hoo!! I win!

I'll help you with the switch! :lol:

Despite

14-10-2004 07:31:49

you could always switch to Debian.... :idea:

I've got two words for you: 2.2 kernel

;)

chad

14-10-2004 09:37:02

And so let the games begin!

Colleen

14-10-2004 10:15:06

you could always switch to Debian.... :idea:

I've got two words for you: 2.2 kernel

;)


You've been able to install Debian with a 2.4 kernel since Woody was released - just give "bf24" as a parameter at the installer boot prompt. The Sarge installers (currently at pre-rc2) default to 2.4.27, but you can give "linux26" at the installer boot prompt to install 2.6.8. :P

Despite

14-10-2004 10:37:44

heh heh, just trying to stir something up. this can't be a "real" linux users forum until it's got at least one distro war under its belt! but no need to jack this thread, I guess...