LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-31-2005, 11:07 AM   #1
RIB-EYE
LQ Newbie
 
Registered: May 2005
Posts: 10

Rep: Reputation: 0
Talking Dual Network Cards


Hello all, (No more stupid questions!!)

I am running Slackware 10.2 and have 2 network cards. The first card is plugged into my network and recieves an IP fine. I would like to connect the secound card to a Cisco switch that is configured for port forwarding. Basically I want to run Snort and monitor all traffic in andout of my network. The problem is that when I plug in the cable to that port on the switch, nothing shows up. How do I config that nic to allow it to see the packets that are coming into it?

Thanks in advance.
 
Old 11-01-2005, 03:05 PM   #2
dd12
LQ Newbie
 
Registered: Sep 2005
Posts: 28

Rep: Reputation: 15
Is the interface configured? What does 'ifconfig -a' show?

What does 'netstat -rn' show (routing table)

So many more questions but these are the basic questions.
 
Old 11-01-2005, 03:17 PM   #3
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Yeah, to expand on dd12's response, the kernel only autodetects 1 NIC card. You need to modprobe the right module (if different) then ifconfig it up manually.
 
Old 11-01-2005, 04:27 PM   #4
RIB-EYE
LQ Newbie
 
Registered: May 2005
Posts: 10

Original Poster
Rep: Reputation: 0
Unhappy

Sorry guys........little in-experienced here...

All I had to do was 'ifconfig eth1 up'
and life is good.
 
Old 11-01-2005, 04:42 PM   #5
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Quote:
All I had to do was 'ifconfig eth1 up'
and life is good.
Good stuff. The thing is, this will only work until your next reboot. To make the changes permanent you need to do a little more work still:

You need to tell the kernel to initialize both NICS. I will give you an example from my system. First you need the hardware address of your 2 NICS, so run the following command:
Code:
#  lspci -v | grep -A6 "Ethernet controller"
Sample output from my system:
Code:
0000:01:06.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 32, IRQ 10
        I/O ports at d000 [size=256]
        Memory at ee000000 (32-bit, non-prefetchable) [size=256]
        Capabilities: [50] Power Management version 2

0000:01: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 32, IRQ 11
        I/O ports at d100 [size=256]
        Memory at ee001000 (32-bit, non-prefetchable) [size=256]
        Capabilities: [50] Power Management version 2
What you want is the IRQ and I/O ports address. Now we tell the kernel. I don't know if you use grub or lilo, but you must edit the arguments passed to the kernel (ie: the "kernel" line in grub.conf...) like this example:
Code:
ether=10,0xd000,eth0 ether=11,0xd100,eth1
the argument takes the form of:
Code:
ether={IRQ},{I/O address},{interface name}
and must be repeated for each interface. The interface name is up to you, you can set each NIC as eth0 or eth1 as you wish. Don't forget to add the "0x" in front of the I/O address.

If you need more help just ask....
 
Old 11-01-2005, 05:57 PM   #6
Rex01
LQ Newbie
 
Registered: Oct 2005
Location: Tennessee
Posts: 4

Rep: Reputation: 0
Interesting info, bulliver.

Does anyone happen to know how it is that live CD distros like Knoppix manage to find both NICs and configure them? I've noticed that Knoppix (and derivatives like featherLinux) built on Linux 2.4 don't do this and Knoppix 4.0.2, which is built on Linux 2.6.12 does. The point where the eth0 and eth1 messages are printed is certainly long after lilo has run.

Thanks
 
Old 11-01-2005, 06:16 PM   #7
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Quote:
Does anyone happen to know how it is that live CD distros like Knoppix manage to find both NICs and configure them?
I can only assume that there is some code in the /linuxrc script (part of an initrd) that checks for additional NICs and sets them up automatically.

Quote:
The point where the eth0 and eth1 messages are printed is certainly long after lilo has run.
Well, lilo has nothing to do with the discovery of the NICs, lilo.conf and grub.conf are just an easy way to pass arguments to the kernel (the 'kernel command line') which is the real goal.

Last edited by bulliver; 11-01-2005 at 06:18 PM.
 
Old 11-02-2005, 06:25 AM   #8
dd12
LQ Newbie
 
Registered: Sep 2005
Posts: 28

Rep: Reputation: 15
Different distributions have different startup scripts....you are correct. Under RHEL /etc/sysconfig/network-scripts has most of what you need. If above all you needed to do was an ifconfig then you already had the hardware detected. All you need to find is the proper place to configure on reboot for Slakware.
 
Old 11-03-2005, 05:00 PM   #9
Rex01
LQ Newbie
 
Registered: Oct 2005
Location: Tennessee
Posts: 4

Rep: Reputation: 0
Okay, I'll take a stab at it, then - is it done in hwsetup?

That's Knopper's program for finding hardware; it usually runs from a script like /etc/rcS.d/knoppix-autoconfig. Is that where the NICs are discovered? If so, has Knopper changed hwsetup for Linux 2.6 so that it does a more thorough job or is it just naturally benefiting from some improvements made in 2.6? Should this move to the Knoppix forum :-) ?

Thanks

oops, looks like my problem was the older distros didn't have support for the 3com 3c940 on this mobo - Linux 2.4 version of DSL is definitely finding two NICs just fine. Sorry for the noise.

Last edited by Rex01; 11-03-2005 at 06:56 PM.
 
  


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
dual homed network cards hrmwinn Linux - Networking 1 08-17-2005 01:51 PM
dual network cards and PPPoE .. How to ? cyrus_the_yrus Linux - Networking 11 10-04-2004 05:43 AM
dual network cards and PPPoE .. How to ? cyrus_the_yrus Linux - Wireless Networking 1 10-01-2004 02:47 AM
Dual Network Cards in Red Hat 9.0 linuxeagle Linux - Networking 9 07-27-2004 04:16 AM
network cards and dual OS mkhan Linux - Networking 4 07-04-2001 06:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:24 AM.

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