LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-19-2011, 07:53 AM   #1
TheHT
LQ Newbie
 
Registered: Jan 2011
Posts: 9

Rep: Reputation: 0
Squeeze, Realtek r8169 PCI, and a PCI Identity Crisis


GAHHH!!!!! Alright, now that that's out of the way... Hello Linux Questions. For years this site has saved my ass time and time again all without ever even needing to register. Today is a different story. Quick summary: I run a small record label, music studio, internet radio station, post production and mixing services for artists over the interwebs, and a Worldgroup BBS. Our computer network resembles what the Millennium Falcon must have had on board, that is, a bunch of old beat up gear that all works, just not all at the same time. For years our trusty linux box, a beast of a machine at over 50kg named Jupiter, has keep the whole shebang running.

We're in the middle of implementing a somewhat more sane backup policy and have begun purchasing external drives along with a shiney new 1000baseT network card, an Encore ENLGA-1320. I selected the 1320 mainly because it was less than 10 bucks and included drivers for Linux in the box. Figured that was a good sign. Yesterday, the card was installed along side two 10/100 cards and the instructions provided followed to the letter. This worked GREAT! ...for about 35 seconds. Then the machine stopped sending data. I did an ifdown, and an ifup and froze the SSH session. I did the same locally and froze the tty session. After a few reboots the card came back up and worked again for a few minutes, sending data happily faster than ever. Again, it stopped mid file transfer (over SAMBA. I know, im sorry.) This time, I went straight for the terminal and ifdown/ifupped it and was greeted with another freeze and this time a kernel panic (I assume? The machine actually squeeked. I didn't even know it could do that.) Figuring that our Debian install was just old and beat up, mainly by my own hastily issues apt-get upgrade commands (a la 'eh, whatever, get new stuff, it's gotta be better. New Debian out? Sweet! Switch repositories and update from THERE! Bwahahaha').

I assumed a clean install was the way to go and the machine was backed up and wiped. I installed Debian Squeeze (from a newly burned net install CD) and in this order:
apt-get update, apt-get upgrade (no packaged updated)
apt-get install nano, then downloaded webmin deb package. Ran in to some dependency problems, so I apt-get installed gcc (even tho it's not listen in it's requirements, I find it fixes broken dependencies with perl. I have no idea why.) GCC was installed, along with perl, libnet-ssleay-perl, libauthen-pam-perl, libio-pty-perl, and apt-show-versions. Webmin was then successfully installed without any -f options.

I was about to test the new gigabit network interface when I realized ifconfig -a didn't list it. Oh no. So I started snooping around with lspci and found that it is now reporting something different than it did with Debian lenny installed. Lenny correctly reported Realtek r8169. (I don't have this output as the system was wiped) What? I didn't even know that was possible!

So, I figured I'd do it right this time and come to you guys. After the card was listed incorrectly, I signed up to Linux Questions and haven't issued as much as an LS command yet. Please help. I'd really love for this thing to work and get all these computers back up and backing up. (ooo, wordplay). Without further ado;

TL;DR: Realtek r8169 PCI network card not being detected by Debian Squeeze and being misreported by lspci.

output of lspci:
--------------------------------
00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 03)
00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 02)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.2 USB Controller: Intel Corporation 82371AB/EB/MB PIIX4 USB (rev 01)
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 02)
00:10.0 Ethernet controller: Hynix Semiconductor Device 8169 (rev 10)
00:12.0 Ethernet controller: National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller
00:13.0 Ethernet controller: Accton Technology Corporation SMC2-1211TX (rev 10)
01:00.0 VGA compatible controller: nVidia Corporation NV6 [Vanta/Vanta LT] (rev 15)
--------------------------------

output of uname -r:
--------------------------------
2.6.32-5-686
--------------------------------

trimmed output of lspci -vv (formerly read Realtek 8169):
--------------------------------
00:10.0 Ethernet controller: Hynix Semiconductor Device 8169 (rev 10)
Subsystem: Hynix Semiconductor Device 8169
Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 0
Region 0: I/O ports at e800 [disabled] [size=256]
Region 1: Memory at febfff00 (32-bit, non-prefetchable) [disabled] [size=256]
[virtual] Expansion ROM at 40000000 [disabled] [size=128K]

--------------------------------

A few quick answers to possible 'Why the hell did you....'
Three cards because I'd like to finally get rid of this consumer broadband router and replace it with the linux machine. I'd like to offer wireless at the many events we host here but don't want random joe public to be able to do funny things to files in the studio.

Nuked and paved because the lenny install was limping along due to my own incompetence, and after installing another hard drive for incomming FTP files, I wanted to do away with the /media mount point and mount the big drive as /home

This post is so long because you guys are awesome and deserve some entertainment after all the years of fixing this machine and not even knowing it. Thanks!
 
Old 01-20-2011, 01:03 AM   #2
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 988
Blog Entries: 4

Rep: Reputation: 254Reputation: 254Reputation: 254
Greetingz!

First off, great post! I can't believe no one's replied to you yet....

Okay, the Realtek chipsets have given me a fair shake of heartburn over the years. So let me first part with some sage advice;

a) Some Realtek hipsets don't play nice-nice when there's more than one card in there.
If you want three NICs, you *literally* have to have three different cards in there.

b) Some times this isn't the fault of the Realtek chipsets on the NICs, but the driver your Linux distro is using.
Quite honestly, some of the NIC drivers are just implementations of the reference PCI NIC driver. Heck, the code is sometimes line-by-line the same.
The driver for the Realtek you have should be compiled as a module, so you might have to "modprobe" it. If you're curious about the code, here's the gist of it;
http://www.cs.fsu.edu/~baker/devices...rs/net/r8169.c

c) With a little patience (or maybe a lot, not sure how much compiling you've done in your time), you can get the Realtek drivers from Realtek *themselves* to work.
Here's the page on their website I'm talking about. They have support for the following cards in the "UNIX" section (scroll down a bit).

Now, if you really want to know if it's a problem with the Realtek, or a problem with your Linux Distribution (or it's System Administrator ;P), grab a KNOPPIX Live CD and boot off of that. In my experience, if KNOPPIX don't find it, it's a hardware problem.


Good luck, and may the Penguin be with you!
 
Old 01-20-2011, 01:21 AM   #3
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Did you add non-free to sources.list?
Firmware is usually non-free.
 
Old 01-20-2011, 01:27 AM   #4
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
It's also available thru synaptic, if you have selected non-free
 
Old 01-20-2011, 10:28 PM   #5
TheHT
LQ Newbie
 
Registered: Jan 2011
Posts: 9

Original Poster
Rep: Reputation: 0
First, thanks for the replies! Quick update! Still working on this machine. I got drivers from Realtek to compile (after some digging around in order to get the linux headers installed), modprobed them in to the kernel and verified that lsmod showed the 8169 driver, and still, nothing. Damn dirty bastard machine. Then, I'll assume the machine heard all the cursing and insults flying around the house and retaliated. ...power supply went. Sweet baby jesus. Right in the middle of copying all the web data back to it no less (about 20gb of client mp3 and wav files). I'm now waiting for a power supply to arrive. Also considering on upgrading the processors while I'm at it. Currently installed: Dual PIII Xeons, 500mhz, slot 1. Fancy! That is, if I can find some super el-cheapo like.

@xeleema: It's very likely the admin. He's a jerk. Also, I might try removing the other cards and see how that works out, then perhaps add one by one.

Will post back when I get the machine booting again. Can anyone recommend an inexpensive gigabit pci network card?

quick link to newegg network cards/10/100/1000/sorted by price, ascending:
http://www.newegg.com/Product/Produc...CE&PageSize=20

Thanks everybody!

Last edited by TheHT; 01-20-2011 at 10:30 PM.
 
Old 01-21-2011, 04:50 AM   #6
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
You should check /etc/apt sources.list to see if "non-free contrib" are included it'll make your job easier.
 
Old 01-21-2011, 09:06 AM   #7
TheHT
LQ Newbie
 
Registered: Jan 2011
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by EDDY1 View Post
You should check /etc/apt sources.list to see if "non-free contrib" are included it'll make your job easier.
I will certainly do that. Can you give a quick explanation as to why that will help? Does it have something to do with Debian and them not making certain packages available due to licensing? I don't fully understand why they do that, or what packages I can expect to have trouble with.

Hardware update, seems 500mhz is about as quick as it's gonna get on the Tyan Tiger 100 main board. (550 max, but extra 50mhz x2 is not worth the time required to track down legacy processors, install them, and risk breaking more crap in my opinion)
 
Old 01-21-2011, 11:52 AM   #8
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
You can get some firmware for instance the wireless driver without compiling, letting synaptic package manager do the work.
 
Old 01-22-2011, 07:44 PM   #9
TheHT
LQ Newbie
 
Registered: Jan 2011
Posts: 9

Original Poster
Rep: Reputation: 0
The saga continues! New power supply, mainboard, processor, and NIC. Take THAT, r8169, jerk. Got the machine up and running again after loads of hardware swapping, new copy of squeeze installed and all three NICs happily sending and receiving data, so I got bold and did away with our crappy consumer broadband router (and in the process, saw our max download speed increase from 1.1mB to 3.2mB!). Now it's an epic battle with iptables. I'll be starting another post here soon, but figured I'd start here as you guys awesome.

The long short of it is; eth0 is our LAN (the new gigabit card), eth1 is the interwebs, and eth2 will be public WIFI. I need the machine to accept connections on 21, 22, and 80, and forward 23 to another internal address.

Through sheer persistence and manual reading, I've got NAT working (I think at least, I'm posing this from another internal machine...as for the whole masquerading bit, well.. read below), nasty traffic being blocked, and I think I'm even keeping the angry Russian script kiddies at bay with a neat SSH chain.

Two problems; The machine will not forward incoming connections to another internal machine, and;
I'm able to remove a line from our NAT section without any noticeable effect. Does that mean the iptables are badly configured and im inviting disaster? Here is the script I'm using for IP table setup:
#!/bin/bash
# eth0 LAN, eth1 Internet, eth2 public wireless

# Flush all current rules from iptables
iptables -F

# Set default policies for INPUT, FORWARD and OUTPUT chains
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

# Set access for localhost and LAN
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i eth0 -j ACCEPT

# Accept packets belonging to established and related connections
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Open ports for public services
iptables -A INPUT -i eth1 -p tcp --dport ftp -j ACCEPT
iptables -A INPUT -i eth1 -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -i eth1 -p tcp --dport ssh -j ACCEPT

# Limit SSH attempts
iptables -N SSH_CHECK
iptables -A INPUT -p tcp --dport 22 -m state --state NEW -j SSH_CHECK
iptables -A SSH_CHECK -m recent --set --name SSH
iptables -A SSH_CHECK -m recent --update --seconds 300 --hitcount 4 --name SSH -j DROP

# Open ports for other machines. (Forwarding)
iptables -t nat -A PREROUTING --in-interface eth1 -p tcp --dport 23 -j DNAT --to-destination 192.168.1.60:23
iptables -A FORWARD -p tcp --destination 192.168.1.60 --dport 23 -j ACCEPT


# Network Address Translation
iptables -A POSTROUTING -t nat -o eth1 -j MASQUERADE
iptables -A FORWARD -t filter -o eth1 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -t filter -i eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT

# Logging

# Save settings with /sbin/service iptables save
# List iptables chains with 'iptables -L -v'
/sbin/iptables-save
#Display config
iptables -L -v



And the iptables -L output:


Chain INPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- lo any anywhere anywhere
2 80 ACCEPT all -- eth0 any anywhere anywhere
0 0 ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED
0 0 ACCEPT tcp -- eth1 any anywhere anywhere tcp dpt:ftp
0 0 ACCEPT tcp -- eth1 any anywhere anywhere tcp dpt:www
0 0 ACCEPT tcp -- eth1 any anywhere anywhere tcp dpt:ssh
0 0 SSH_CHECK tcp -- any any anywhere anywhere tcp dpt:ssh state NEW

Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT tcp -- any any anywhere 192.168.1.60 tcp dpt:telnet
0 0 ACCEPT all -- any eth1 anywhere anywhere state NEW,RELATED,ESTABLISHED
0 0 ACCEPT all -- eth1 any anywhere anywhere state RELATED,ESTABLISHED

Chain OUTPUT (policy ACCEPT 4 packets, 4328 bytes)
pkts bytes target prot opt in out source destination

Chain SSH_CHECK (1 references)
pkts bytes target prot opt in out source destination
0 0 all -- any any anywhere anywhere recent: SET name: SSH side: source
0 0 DROP all -- any any anywhere anywhere recent: UPDATE seconds: 300 hit_count: 4 name: SSH side: source


The line I can pull from the script is:
iptables -A POSTROUTING -t nat -o eth1 -j MASQUERADE

What does that line do, or do not do? Why do things work without it?

Also:
root@jupiter:~# cat /proc/sys/net/ipv4/ip_forward
1
 
Old 01-22-2011, 08:11 PM   #10
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
I can't give any advice other than, is the other machine configure to accept new connection?
 
Old 01-22-2011, 08:33 PM   #11
TheHT
LQ Newbie
 
Registered: Jan 2011
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by EDDY1 View Post
I can't give any advice other than, is the other machine configure to accept new connection?
The plot thickens. I can connect to the internal server from the gateway and also from an external machine, but connection requests form the LAN are ignored.

('Auto-sensing...' = good connection. And nostalga inducing awesomeness for any old dudes in here.)

From the gateway via IP:
telnet 192.168.1.60 23
Trying 192.168.1.60...
Connected to 192.168.1.60.
Escape character is '^]'.
Auto-sensing...

From our vps@remote dc:
telnet bbs.empulserecords.com 23
Trying 184.91.47.188...
Connected to bbs.empulserecords.com.
Escape character is '^]'.
Auto-sensing...


From our vps using via IP:
telnet 184.91.47.188 23
Trying 184.91.47.188...
Connected to 184.91.47.188.
Escape character is '^]'.
Auto-sensing...

But from the gateway using domain name;
telnet bbs.empulserecords.com 23
Trying 184.91.47.188...
telnet: Unable to connect to remote host: Connection refused

This has provided more entertainment than most video games do.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Linux and its identity crisis LXer Syndicated Linux News 0 09-24-2007 01:12 AM
Realtek PCI-E Gigabit driver Serene32 Linux - Networking 6 01-30-2007 08:17 AM
keyboard having identity crisis in gtk Disco cat Linux - Software 0 10-07-2005 03:07 PM
identity crisis spedsta Linux - Networking 2 06-18-2004 11:20 AM
Realtek 8139 pci network card and RH 7.3 d4u Linux - Networking 6 09-06-2002 09:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 09:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration