strange ifconfig behaviour



Hi,

I am trying to understand how i can make linux kernel automatically load my network card modules at boot up time. I read somewhere that i can create a /etc/modules file and put all the modules i want the kernel to load there but that doesn;t work. Wondering anyone has any pointers on this issue ??

There is something strange I observed while trying to use ifconfig cmd.

One a particuler system running RHEL4 U2 2.6.9 kernel this is what I observed.

0 # cat /etc/modules.conf
alias eth0 tg3
alias eth1 tg3
0 # uname -r
2.6.9-22.EL
0 # lsmod
Module Size Used by
i2c_dev 11329 0
i2c_core 22081 1 i2c_dev
microcode 6881 0
ata_piix 9413 9
libata 44957 1 ata_piix
sd_mod 17217 10
scsi_mod 121293 2 libata,sd_mod
ext3 116809 6
jbd 71385 1 ext3
0 # cat /etc/modules.conf
alias eth0 tg3
alias eth1 tg3
0 # ifconfig eth0 up
eth0: unknown interface: No such device
255 #

Ifconfig fails because the NIC module tg3 is not loaded.

Now, On a different system running a 2.4.21 kernel.

127 # lsmod
Module Size Used by Not tainted
iptable_filter 2412 1 (autoclean)
ip_tables 15776 1 [iptable_filter]
ext3 85800 6
jbd 50924 6 [ext3]
ata_piix 5352 9
scsi_dump_register 2048 0 [ata_piix]
libata 45276 0 [ata_piix]
sd_mod 13936 18
scsi_mod 106924 2 [ata_piix libata sd_mod]

[ NOTE : No NIC module is loaded right now]

0 # uname -r
2.4.21-37.EL
0 # cat /etc/modules.conf
alias eth0 e1000
alias eth1 e1000
alias scsi_hostadapter ata_piix
0 # ifconfig eth0 up <<<<<<<<<<<<< used ifconfig cmd
0 # lsmod
Module Size Used by Not tainted
e1000 93020 1 (autoclean)<<<<< NIC module got loaded
iptable_filter 2412 1 (autoclean)
ip_tables 15776 1 [iptable_filter]
ext3 85800 6
jbd 50924 6 [ext3]
ata_piix 5352 9
scsi_dump_register 2048 0 [ata_piix]
libata 45276 0 [ata_piix]
sd_mod 13936 18
scsi_mod 106924 2 [ata_piix libata sd_mod]

Now I am wondering how come on 2.4.21 ifconfig is causing the NIC module e1000 to load ??

And as if this was not strange enough.


0 # ifconfig eth0 down
0 # rmmod e1000 << unload the module.
0 # ./strace ifconfig eth0 up << use strace on ifconfig
execve("/sbin/ifconfig", ["ifconfig", "eth0", "up"], [/* 47 vars */]) = 0
.......... [<<<<<<<<<<<<<< lines removed]
ccess("/proc/net/appletalk", R_OK) = -1 ENOENT (No such file or directory)
access("/proc/sys/net/econet", R_OK) = -1 ENOENT (No such file or directory)
access("/proc/sys/net/ash", R_OK) = -1 ENOENT (No such file or directory)
access("/proc/net/x25", R_OK) = -1 ENOENT (No such file or directory)
ioctl(4, SIOCGIFFLAGS, 0xbfff87a0) = -1 ENODEV (No such device)
write(2, "eth0: unknown interface: No such"..., 40eth0: unknown interface: No such device
) = 40
exit_group(-1) = ? << Got an erro Unknown intrface same as I got in case of 2.6.9.

0 # lsmod
Module Size Used by Not tainted
iptable_filter 2412 1 (autoclean)
ip_tables 15776 1 [iptable_filter]
ext3 85800 6
jbd 50924 6 [ext3]
ata_piix 5352 9
scsi_dump_register 2048 0 [ata_piix]
libata 45276 0 [ata_piix]
sd_mod 13936 18
scsi_mod 106924 2 [ata_piix libata sd_mod]
[e1000 module not loaded this time]


I use to think strace is a non-intrusive utility but it seems that in this case it is chaning the end result of the execution of ifconfig command.

Any idea why this could be happening ??

Thanks

Amit.
.



Relevant Pages

  • Strange ifconfig behaviour
    ... I read somewhere that i can create a /etc/modules file and put all the modules i want the kernel to load there but that doesn;t work. ... There is something strange I observed while trying to use ifconfig cmd. ... alias eth0 tg3 ...
    (alt.os.linux)
  • freeswan kernel module - syslog a disaster
    ... Aug 20 03:53:28 noc kernel: JEDEC: Found no ICH2 rom device at location zero ... # alias net-pf-4 off # IPX ... alias cipher-2 des ...
    (Debian-User)
  • Problem with amixer on Debian 3.0 + AC97 soundcard (Realtek ALC650 CODEC) intergrated on GA-8PE667 m
    ... Finally I made it all work by compiling custom kernel with alsa ... alias parport_lowlevel parport_pc ... alias sound-slot-0 snd-card-0 ... I loaded using modconf all the kernel modules in the 'alsa' category: ...
    (comp.os.linux.setup)
  • Re: Problem with NON-Wireless network card
    ... Since I updated the kernel on my Dell Inspiron 8600 notebook running FC6 ... If b44 isn't in the lsmod result, ... alias snd-card-0 snd-intel8x0 ... Now I only have one NIC on each of my two machines, but perhaps you can set options lines also if you have multiple network cards. ...
    (Fedora)
  • Re: [TCPIP V5.4] IFCONFIG vs. SET/SHOW INTERFACE
    ... Since V5.0, if you create IP alias addresses with 'ifconfig', these do not ... show up using TCPIP SHOW INTER. ... "Peter 'EPLAN' LANGSTOEGER" wrote in message ...
    (comp.os.vms)