Linux newbie question - How to install ethernet card driver?

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Stealth

Senior member
Oct 25, 2000
782
0
0
<< You can cd to /lib/modules/<your kernel>/net and then do an ls and the 8139 driver is probably already in there >>

I checked, but 8139 wasn't there. What should I do now?

 

Stealth

Senior member
Oct 25, 2000
782
0
0
I tried ifconfig -a, but it gave me the same thing. I tried ifconfig with DHCP and bootp but both came up the same. Any more suggestions?
 

Russ

Lifer
Oct 9, 1999
21,093
3
0
Stealth,

After you set it to DHCP did you tell it to write the changes? Or reboot?

Russ, NCNE
 

Damaged

Diamond Member
Oct 11, 1999
3,020
0
0
Umm, why the via-rhine driver? Your card should be using the 8139 driver. See if you have that in /lib/modules/2.2.15-4mdk/net. You should. If so, then rmmod via-rhine, and then insmod 8139 and see if that works.

I know Russ' cards are using that driver but I don't know if his are the same modle and your system certainly sees this as a Realtek 8139 chipset AND Becker's driver page says that's the right driver for your card.
 

Stealth

Senior member
Oct 25, 2000
782
0
0
I wrote the changes. BTW, what should my 'Primary name + domain' be? Currently, it is localhost.localdomain by default, and so is my host name.
 

Stealth

Senior member
Oct 25, 2000
782
0
0
I wrote the changes. BTW, what should my 'Primary name + domain' be? Currently, it is localhost.localdomain by default, and so is my host name.
 

Stealth

Senior member
Oct 25, 2000
782
0
0
you're right damaged, it should be 8139. However, it wasn't there, but via-rhine.o was.
 

Russ

Lifer
Oct 9, 1999
21,093
3
0
Damaged,

Mine are the DFE-530TX. Now, I just noticed that he has a &quot;+&quot; at the end of the model number he listed and, checking that, I find that his (slightly newer then mine), are indeed Realtek based.

Russ, NCNE
 

Russ

Lifer
Oct 9, 1999
21,093
3
0
Stealth,

The 8139 chipset is new enough that your kernel may not support it, so Mandrake might have just tossed in the closest driver it could find.

Russ, NCNE
 

Damaged

Diamond Member
Oct 11, 1999
3,020
0
0
Wrong driver so that's why you get the delay message. :) You'll need to get the 8139 driver. Argh. Well, time to compile it I guess.

Heh, I grabbed the driver from D-Link's site and they have instructions:The procedure to activate DFE-530TX+ on linux is as follows. You can ignore step 1 since you already have the source file, granted it's just called 8139 though. Hmm, do you have that rtl8139.o file in your /lib/modules/<kernel name>/net directory? If so then substitute that module for the one I said was 8139. Ought to work then.

step 1: ftp the driver from
ftp://cesdis.gsfc.nasa.gov/pub/linux/drivers/rtl8139.c

step 2: compile:
The instruction for compiling the driver is include at the end of
the driver file. (run this instruction at /usr/src/linux)

Use this command to compile the driver.

compile-command: gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c rtl8139.c `[ -f /usr/include/linux/modversions.h ] &amp;&amp; echo -DMODVERSIONS`


step 3: insert the driver as module:
insmod rtl8139.o
parameter can be added by adding options=... behind the istrruction
0x16(bit 4):full duplex
bit 0-3 :Default port
(run 'lsmod' to see if the module is inserted)

step 4: bind your card to an IP address

/sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST}
netmask ${NETMASK}
(run 'netstat -i' to see if there is a interface 'ne0')

step 5: add your card to IP routing table, then add gateway also your card:
/sbin/route add -net ${NETWORK} netmask ${NETMASK} eth0
(should be able to ping local network now)
gateway:
/sbin/route add default gw ${GATEWAY} netmask 0.0.0.0 metric 1

step 6: start inet deamon.
/usr/sbin/inetd
(you are on the network now)

*make sure that your kernel is built with network, fast_ethernet and module
support. Otherwise, you have to rebuild your kernel.
(1:go to /usr/src/linux directory
2:run 'make menuconfig' or 'make config'
3:mark the options list above.
4:exit and rebuild your kernel.
make dep;make clean;make zImage
the file 'zImage' will be at /usr/src/linux/arch/i386/boot/zImage
5:modify /etc/lilo.conf.(this file specify where kernel image is)
6:run 'lilo' )

You cna run 'netconfig' which will do step 4,5,6 for you. This will create
'/etc/rc.d/inet1' and 'inet2' files. These two files will run at boot time.
Then just add a line at the beginning of 'inet1'.
'insmod /your driver'path/rtl8139.o'

then your driver will work every time you boot.


[edit]Ignore the first part of this post cause you have the driver.[/edit]
 

Damaged

Diamond Member
Oct 11, 1999
3,020
0
0
Look back and try the ifconfig command I stated earlier. And I'm the dumbass cause I told you it was 8139 when in fact it was rtl8139. Sorry. :)
 

Damaged

Diamond Member
Oct 11, 1999
3,020
0
0
Actually the command format will be:

sbin/ifconfig eth0 IPADDR broadcast BROADCAST netmask NETMASK

So, if your IPADDR is 192.168.0.2 and your mask is 255.255.255.0 then the command will look like:

sbin/ifconfig eth0 192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0 up
 

Stealth

Senior member
Oct 25, 2000
782
0
0
When I reboot I don't get the error messages regarding the eth0 anymore. When I did ifconfig -a this time, I get:

eth0 Link encap:Ethernet HWaddr 00:50:BA:84:05:C2
inet addr:192.168.123.175 Bcast:192.168.123.255 Mask:255.255.255.0
BROADCAST RUNNING MULTICAST MTU:1500 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:100
Base address:0x6300

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 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

I'm still not able to get on the net though. At the rate we're going, I think we're gonna top the Gateway 6400 server thread!
 

Damaged

Diamond Member
Oct 11, 1999
3,020
0
0
Yeah! Your card is up. :) Now for routing and DNS.

Do the routing thing like it says but substitute whatever your default gateway is for $GATEWAY (tip for you, these are how we refer to variables, so get used to it :) ). Then choose your favorite editor and open /etc/resolv.conf and add entries like so:

nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx

where the xxx.xxx.xxx.xxx are the IPs of your name servers. Then ping something by name and by IP and you should be a surfing fool.
 

Stealth

Senior member
Oct 25, 2000
782
0
0
Thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you!

I'll configure it right now. I'd better let you guys go to sleep now! Thanks alot!

Happy Independence Day!
 

Stealth

Senior member
Oct 25, 2000
782
0
0
Doh! Bringing the thread back to life. When I type in: /sbin/ifconfig eth0 192.168.123.152 broadcast 192.68.123.255 netmask 255.255.255.0

I get the following message:
SIOCSIFFLAGS: Resource temporarily unavailable.

 

Damaged

Diamond Member
Oct 11, 1999
3,020
0
0
Because it's already configured and in use. You have to take it down, configure it, then bring it back up again. Besides the card itself is already configured. Now you need to do something like:

/sbin/route add -net 192.168.123.0 netmask 255.255.255.0 eth0
/sbin route add default gw <192.168.123.X> 0.0.0.0 metric 1

Then edit your /etc/resolv.conf file as I stated before.

That should do it.
 

Blundar

Golden Member
Oct 19, 2000
1,144
0
0
to troubleshoot:
1. try to ping yourself (ping 192.168.123.175)
2. try to ping your SMC barriccade's IP (192.168.123.x)
3. try to run a traceroute -n 129.137.10.36 see how far it goes.
4. try to ping www.yahoo.com If it can't ping this and the rest of the tests have worked ok look at /etc/resolv.conf

Good luck!
to check and see if your NIC loaded right, you can type cat /proc/net/dev and it should have lo eth0 etc listed.
 

Stealth

Senior member
Oct 25, 2000
782
0
0

<< /sbin/route add -net 192.168.123.0 netmask 255.255.255.0 eth0
/sbin route add default gw <192.168.123.X> 0.0.0.0 metric 1 >>


Damaged, is that the correct format? I typed it in and changed the IP addy, netmask, and default gateway, but it gave me a form error.

Thanks Blundar for the advice. I'll try it out.

 

Damaged

Diamond Member
Oct 11, 1999
3,020
0
0
The first command is correct. For the second one you can try just:

/sbin/route add default gw <192.168.123.X>

the use /sbin/route to make sure those routes took.

Like Blundar says, you should be able to ping the cards address. If the route statements take then you should be able to ping anything on the internet by IP number or by name if you do the /etc/resolv.conf thang.
 

Stealth

Senior member
Oct 25, 2000
782
0
0

Here's what happened when I typed in: /sbin/route add -net 192.168.123.0 netmask
--------------------------------------------------------------------------------
[root@localhost /root]# /sbin/route add -net 192.168.123.0 netmask
255.255.255.0 eth0 SIOCADDRT: Network is down

When I typed in: /sbin/route add default gw 192.168.123.254
-----------------------------------------------------------
[root@localhost /root]# /sbin/route add default gw 192.168.123.254
SIOCADDRT: Network is unreachable

Results from pinging:
--------------------

Pinging my IP (192.168.123.152)
-------------------------------
[root@localhost /root]# ping 192.168.123.152
PING 192.168.123.152 (192.168.123.152): 56 data bytes
64 bytes from 192.168.123.152: icmp_seq=0 ttl=255 time=0.3 ms
64 bytes from 192.168.123.152: icmp_seq=1 ttl=255 time=0.2 ms
64 bytes from 192.168.123.152: icmp_seq=2 ttl=255 time=0.2 ms
64 bytes from 192.168.123.152: icmp_seq=3 ttl=255 time=0.2 ms
64 bytes from 192.168.123.152: icmp_seq=4 ttl=255 time=0.2 ms
64 bytes from 192.168.123.152: icmp_seq=5 ttl=255 time=0.2 ms

--- 192.168.123.152 ping statistics ---
6 packets transmitted, 6 packets received, 0% packet loss
round-trip min/avg/max = 0.2/0.2/0.3 ms

Pinging the SMC barricade IP (192.168.123.254 ????)
---------------------------------------------------
[root@localhost /root]# ping 192.168.123.254
PING 192.168.123.254 (192.168.123.254): 56 data bytes
ping: sendto: Network is unreachable
ping: wrote 192.168.123.254 64 chars, ret=-1
ping: sendto: Network is unreachable
ping: wrote 192.168.123.254 64 chars, ret=-1
ping: sendto: Network is unreachable
ping: wrote 192.168.123.254 64 chars, ret=-1
ping: sendto: Network is unreachable
ping: wrote 192.168.123.254 64 chars, ret=-1

--- 192.168.123.254 ping statistics ---
4 packets transmitted, 0 packets received, 100% packet loss

Performing a: traceroute -n 129.137.10.36
-----------------------------------------
[root@localhost /root]# traceroute -n 129.137.10.36
traceroute: Can't find any network interfaces
 

Damaged

Diamond Member
Oct 11, 1999
3,020
0
0
Hmm, do an /sbin/route and post the output. Also do and ifconfig and post that as well please. Thanks.

BTW, the interface itself is definitely up. That's good.

Oh, your cabled up right? And the cabling is good correct? Might try changing that if you have one that is know to work.

What's the rest of the setup here? I mean what goes to what. Thanks.
 

Stealth

Senior member
Oct 25, 2000
782
0
0
/sbin/route
-----------
[root@localhost /root]# /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
127.0.0.0 * 255.0.0.0 U 0 0 0 lo

ifconfig
--------
[root@localhost /root]# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:56 errors:0 dropped:0 overruns:0 frame:0
TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0

ifconfig -a
------------
[root@localhost /root]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:50:BA:84:05:C2
inet addr:192.168.123.152 Bcast:192.168.123.255 Mask:255.255.255.0
BROADCAST RUNNING MULTICAST MTU:1500 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:100
Base address:0x6300

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:56 errors:0 dropped:0 overruns:0 frame:0
TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0

I changed the cable from a PC which his already hooked up to the net, but I'm still getting the same error messages. I have three machines (2 PCs, and 1 Linux box I'm working on right now) hooked up to my SMC Barricade router, which is connected to Road Runner service.
 

Damaged

Diamond Member
Oct 11, 1999
3,020
0
0
WTF! No host entry for eth0. Hmm, okay, try doing /sbin/route add 192.168.123.152 dev eth0 I think that's correct. You rarely have to do that, but sometimes you do. Then see if there's a route for it. If there is, then use the other commands.