Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-31-2005, 11:07 AM
|
#1
|
LQ Newbie
Registered: May 2005
Posts: 10
Rep:
|
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.
|
|
|
11-01-2005, 03:05 PM
|
#2
|
LQ Newbie
Registered: Sep 2005
Posts: 28
Rep:
|
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.
|
|
|
11-01-2005, 03:17 PM
|
#3
|
Senior Member
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Rep:
|
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.
|
|
|
11-01-2005, 04:27 PM
|
#4
|
LQ Newbie
Registered: May 2005
Posts: 10
Original Poster
Rep:
|
Sorry guys........little in-experienced here...
All I had to do was 'ifconfig eth1 up'
and life is good.
|
|
|
11-01-2005, 04:42 PM
|
#5
|
Senior Member
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Rep:
|
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....
|
|
|
11-01-2005, 05:57 PM
|
#6
|
LQ Newbie
Registered: Oct 2005
Location: Tennessee
Posts: 4
Rep:
|
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
|
|
|
11-01-2005, 06:16 PM
|
#7
|
Senior Member
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Rep:
|
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.
|
|
|
11-02-2005, 06:25 AM
|
#8
|
LQ Newbie
Registered: Sep 2005
Posts: 28
Rep:
|
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.
|
|
|
11-03-2005, 05:00 PM
|
#9
|
LQ Newbie
Registered: Oct 2005
Location: Tennessee
Posts: 4
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 02:38 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|