PDA

View Full Version : second nic card detected?



ldp
04-14-2004, 01:50 PM
Hello,
Recently, I installed knoppix 3.3 on my second pc hd.
I have two ethernet nic from realtek family physically installed.
Already succeeded to go to the internet through my winxp pc.
But the aim is to use the linux pc as a router/fw
Now I'm confused that my network doesn't work when I use the second nic. I change the rj45 cable to the second nic, then I do a ifdown eth0, ifup eth1 => which failes
In the /etc/network/interfaces file, I have put
*******************
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet dhcp
*******************
If I change the cable back to the first nic and I do a ifup eth0, I get an ip from the winxp dhcp and the network works again.

Then I did a lspci -v and I think both cards are recognized, this is the output:

root@Knoppix:/etc# lspci -v
00:00.0 Host bridge: VIA Technologies, Inc. VT82C598 [Apollo MVP3] (rev 04)
Flags: bus master, medium devsel, latency 16
Memory at e0000000 (32-bit, prefetchable) [size=64M]
Capabilities: [a0] AGP version 1.0

00:01.0 PCI bridge: VIA Technologies, Inc. VT82C598/694x [Apollo MVP3/Pro133x AGP] (prog-if 00 [Normal decode])
Flags: bus master, 66Mhz, medium devsel, latency 0
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
I/O behind bridge: 0000d000-0000dfff
Memory behind bridge: e4000000-e5ffffff
Prefetchable memory behind bridge: e6000000-e7ffffff

00:07.0 ISA bridge: VIA Technologies, Inc. VT82C586/A/B PCI-to-ISA [Apollo VP] (rev 41)
Subsystem: VIA Technologies, Inc. MVP3 ISA Bridge
Flags: bus master, stepping, medium devsel, latency 0

00:07.1 IDE interface: VIA Technologies, Inc. VT82C586/B/686A/B PIPC Bus Master IDE (rev 06) (prog-if 8a [Master SecP PriP])
Flags: bus master, medium devsel, latency 64
I/O ports at e000 [size=16]

00:07.2 USB Controller: VIA Technologies, Inc. USB (rev 02) (prog-if 00 [UHCI])
Subsystem: VIA Technologies, Inc. (Wrong ID) USB Controller
Flags: bus master, medium devsel, latency 64, IRQ 10
I/O ports at e400 [size=32]

00:07.3 Bridge: VIA Technologies, Inc. VT82C586B ACPI (rev 10)
Flags: medium devsel

00:08.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
Subsystem: Realtek Semiconductor Co., Ltd. RT8139
Flags: bus master, medium devsel, latency 64, IRQ 11
I/O ports at e800 [size=256]
Memory at ea001000 (32-bit, non-prefetchable) [size=256]
Expansion ROM at e8000000 [disabled] [size=64K]
Capabilities: [50] Power Management version 2

00:0a.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
Subsystem: Realtek Semiconductor Co., Ltd. RT8139
Flags: bus master, medium devsel, latency 64, IRQ 12
I/O ports at ec00 [size=256]
Memory at ea000000 (32-bit, non-prefetchable) [size=256]
Expansion ROM at e9000000 [disabled] [size=64K]

01:00.0 VGA compatible controller: nVidia Corporation NV5M64 [RIVA TNT2 Model 64/Model 64 Pro] (rev 15) (prog-if 00 [VGA])
Subsystem: Creative Labs: Unknown device 103f
Flags: bus master, 66Mhz, medium devsel, latency 64, IRQ 11
Memory at e4000000 (32-bit, non-prefetchable) [size=16M]
Memory at e6000000 (32-bit, prefetchable) [size=32M]
Expansion ROM at e5000000 [disabled] [size=64K]
Capabilities: [60] Power Management version 1
Capabilities: [44] AGP version 2.0

Anybody sees what I'm missing? As soon as I'm sure that both nic are working fine, I can proceed and try to connect the linux box directly to the internet.

many thanks in advance.

ldp
04-14-2004, 02:05 PM
When I do a ifconfig -a, I get the following result:

eth0 Link encap:Ethernet HWaddr 00:50:BF:97:CB:FA
inet addr:192.168.0.169 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5845 errors:0 dropped:0 overruns:0 frame:0
TX packets:7308 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:603561 (589.4 KiB) TX bytes:757226 (739.4 KiB)
Interrupt:11 Base address:0x1000

eth1 Link encap:Ethernet HWaddr 00:50:FC:A2:84:C7
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:6156 (6.0 KiB)
Interrupt:12 Base address:0x3000

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:69 errors:0 dropped:0 overruns:0 frame:0
TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4235 (4.1 KiB) TX bytes:4235 (4.1 KiB)

I don't see the eth1 when typing ifconfig.
rgds.

ldp
04-14-2004, 02:25 PM
This is what I find in dmesg:

....
8139too Fast Ethernet driver 0.9.26
PCI: Assigned IRQ 11 for device 00:08.0
eth0: RealTek RTL8139 Fast Ethernet at 0xc6c21000, 00:50:bf:97:cb:fa, IRQ 11
eth0: Identified 8139 chip type 'RTL-8139C'
PCI: Found IRQ 11 for device 00:0a.0
IRQ routing conflict for 00:0a.0, have irq 12, want irq 11
eth1: RealTek RTL8139 Fast Ethernet at 0xc6c23000, 00:50:fc:a2:84:c7, IRQ 12
eth1: Identified 8139 chip type 'RTL-8139C'
...
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
blk: queue c0334fcc, I/O limit 4095Mb (mask 0xffffffff)
blk: queue c0334b60, I/O limit 4095Mb (mask 0xffffffff)
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
eth1: Setting half-duplex based on auto-negotiated partner ability 0000.
eth1: Setting half-duplex based on auto-negotiated partner ability 0000.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 45e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
eth1: Setting 100mbps full-duplex based on auto-negotiated partner ability 01e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
root@Knoppix:~#

Stephen
04-14-2004, 08:30 PM
Hello,
Recently, I installed knoppix 3.3 on my second pc hd.
I have two ethernet nic from realtek family physically installed.
Already succeeded to go to the internet through my winxp pc.
But the aim is to use the linux pc as a router/fw
Now I'm confused that my network doesn't work when I use the second nic. I change the rj45 cable to the second nic, then I do a ifdown eth0, ifup eth1 => which failes
In the /etc/network/interfaces file, I have put
*******************
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet dhcp
*******************
If I change the cable back to the first nic and I do a ifup eth0, I get an ip from the winxp dhcp and the network works again.

Then I did a lspci -v and I think both cards are recognized, this is the output:



Anybody sees what I'm missing? As soon as I'm sure that both nic are working fine, I can proceed and try to connect the linux box directly to the internet.

many thanks in advance.

Yes you need to install a program like firestarter (apt-get install firestarter) to enable the connection sharing/firewall or a script like Arno's Iptables (http://rocky.eld.leidenuniv.nl/index-org.html). And in the /etc/network/interfaces file you need settings similar to this.



# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

# (network, broadcast and gateway are optional)
auto eth0 eth1

iface eth0 inet dhcp

iface eth1 inet static
address 192.168.0.254
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255


Then the second card's (eth1) cable should go to a hub/switch which the other machines connect into. On the machines inside connecting to the hub/switch you can then use static IP's in the range of 192.168.0.1-253 with their gateway machine being 192.168.0.254 you would set these in the TCP/IP bindings in the windows machines. You would also need to set your nameserver (DNS) in the /etc/resolv.conf in your linux machine you would get this setting from your ISP and you need to set it in your windows machines as well and in the windows machine you should turn off the ICS.

ldp
04-14-2004, 11:24 PM
Thanks but a part of my problem remains.
When I disconnect the cable from eth0, I get the message "network cable disconnected" in winxp. (the current gw)
Then I plug the cable in the eth1 nic and thus I expect the "a network cable is unplugged" msg to disappear but it seems that the xpmachine doesn't see the new nic, the msg remains.
Changing the /etc/network/interfaces file doesn't help. When I try ifup eth1, it gives the msg: "operation failed" (I do this after I bring down the first nic with ifdown eth0)
I was hoping that both nics were able to connect to the other pc. (not together ofcourse)
That"s why I copied the output from lspci -v here. It looks like knoppix finds both nic but the second can't be used.
I'm now going to try to change the network card in a try and error attempt. Don't know what else to try
rgds.

ldp
04-14-2004, 11:35 PM
Is it possible that the following means that my second nic is not working fine due to IRQ problems?
Here's from dmesg:
...
PCI: Assigned IRQ 11 for device 00:08.0
eth0: RealTek RTL8139 Fast Ethernet at 0xc6b96000, 00:50:bf:97:cb:fa, IRQ 11
eth0: Identified 8139 chip type 'RTL-8139C'
PCI: Found IRQ 11 for device 00:0a.0
IRQ routing conflict for 00:0a.0, have irq 12, want irq 11
eth1: RealTek RTL8139 Fast Ethernet at 0xc6b98000, 00:50:fc:a2:84:c7, IRQ 12
eth1: Identified 8139 chip type 'RTL-8139C'
...
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
blk: queue c0334fcc, I/O limit 4095Mb (mask 0xffffffff)
blk: queue c0334b60, I/O limit 4095Mb (mask 0xffffffff)
parport0: PC-style at 0x378 [PCSPP,TRISTATE,EPP]
lp0: using parport0 (polling).
lp0: console ready
eth0: Setting half-duplex based on auto-negotiated partner ability 0000.
eth1: Setting 100mbps full-duplex based on auto-negotiated partner ability 01e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.

Or is this all ok? And can I manually assign IRQ channels to pci cards?
thanks in advance.

Stephen
04-15-2004, 02:20 AM
Is it possible that the following means that my second nic is not working fine due to IRQ problems?
Here's from dmesg:
...
PCI: Assigned IRQ 11 for device 00:08.0
eth0: RealTek RTL8139 Fast Ethernet at 0xc6b96000, 00:50:bf:97:cb:fa, IRQ 11
eth0: Identified 8139 chip type 'RTL-8139C'
PCI: Found IRQ 11 for device 00:0a.0
IRQ routing conflict for 00:0a.0, have irq 12, want irq 11
eth1: RealTek RTL8139 Fast Ethernet at 0xc6b98000, 00:50:fc:a2:84:c7, IRQ 12
eth1: Identified 8139 chip type 'RTL-8139C'
...
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
blk: queue c0334fcc, I/O limit 4095Mb (mask 0xffffffff)
blk: queue c0334b60, I/O limit 4095Mb (mask 0xffffffff)
parport0: PC-style at 0x378 [PCSPP,TRISTATE,EPP]
lp0: using parport0 (polling).
lp0: console ready
eth0: Setting half-duplex based on auto-negotiated partner ability 0000.
eth1: Setting 100mbps full-duplex based on auto-negotiated partner ability 01e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.
eth0: Setting 100mbps full-duplex based on auto-negotiated partner ability 41e1.

Or is this all ok? And can I manually assign IRQ channels to pci cards?
thanks in advance.

That looks like it get set up properly.

Stephen
04-15-2004, 02:33 AM
Thanks but a part of my problem remains.
When I disconnect the cable from eth0, I get the message "network cable disconnected" in winxp. (the current gw)
Then I plug the cable in the eth1 nic and thus I expect the "a network cable is unplugged" msg to disappear but it seems that the xpmachine doesn't see the new nic, the msg remains.
Changing the /etc/network/interfaces file doesn't help. When I try ifup eth1, it gives the msg: "operation failed" (I do this after I bring down the first nic with ifdown eth0)
I was hoping that both nics were able to connect to the other pc. (not together ofcourse)
That"s why I copied the output from lspci -v here. It looks like knoppix finds both nic but the second can't be used.
I'm now going to try to change the network card in a try and error attempt. Don't know what else to try
rgds.

Now here I do not have a clue what you are trying to do. To share the connection you need settings similar to what I posted above and the software/script running to share. The general idea is you get your gateway machine's eth0 connected to the internet and working. Then you change the interfaces file to add eth1 and /etc/init.d/networking restart to restart with the new settings then ifconfig -a to confirm the IPs of the cards in the machine and maybe ping -c 5 192.168.0.254 to make sure you can ping the interface. Now you would install the cable from the eth1 to the hub/switch and plug in the other machines on the inside network to it and set their IPs and if you want ping them. Now you install the software/script on the gateway machine with the proper settings and you should be able to connect to the internet through the hub/switch to the eth1 on the gateway which then forwards the packets to the proper place.

ldp
04-15-2004, 10:59 AM
Hello, thanks, it's working now.
1) I had to move the nic physically one place up on my mobo to get it to work. (lan cnx to winxp pc)
2) Also had to change the nic which was connected to the internet via telenet from my xp pc to my linux machine (from which I'm working now) and it worked right away. It seems that the telenet cable modem keeps track of the mac address of the nic it's connected to and only wants to work with that particular nic. (I tried with the other nic and adapted the config and it didn't work, Also tried to connect the telenet modem to one of the remaining nic in the winxp machine but.. no internet)
Now I only have to set this linux pc up to act as a gateway to the net for the xp pc.
thanks.
Lieven

ldp
04-15-2004, 02:51 PM
Ok, everything's fine now. Have the knoppix machine working as a router/firewal without too much trouble. Never expected it to work out that easily thanks to the howto from David Ranch and Ambrose Au. (http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/IP-Masquerade-HOWTO.html)
nice work