LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-27-2004, 09:27 PM   #1
nhgiang
LQ Newbie
 
Registered: Dec 2004
Posts: 3

Rep: Reputation: 0
Can one linux PC have 2 NIC connect to one Hub ?


Hello,

I have a linux PC with 2 NIC .
I want to test my PC linux work with 2 NIC simultaneously .
I tested each NIC and both NIC worked fine .
I have a hub and I conected 2 NIC to that hub ( 2 NIC was differentiated ip address and same address class ) . But only one NIC worked fine . If I pull out the cable from this NIC( PC still have a cable from other NIC to hub ) , I can not ping from my PC Linux ( although , both NIC was configured and activated ) .

Can any one give me a suggestion ?

Thank in advance !

nhgiang .
 
Old 12-27-2004, 10:26 PM   #2
AltF4
Member
 
Registered: Sep 2002
Location: .at
Distribution: SuSE, Knoppix
Posts: 532

Rep: Reputation: 31
2 NIC on same switch is no problem

- use different IP for each NIC
- ping IP1
- disconnect cable 1
- ping IP2

should work
 
Old 12-28-2004, 02:09 AM   #3
nhgiang
LQ Newbie
 
Registered: Dec 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for your help ,

But it still not worked properly .

I removed configuration of both NIC and reconfigured them .

eth0 : 172.16.1.231 /16
eth1 : 172.16.40.232/16

But when the boot finished , the routing table seem schange :
routing table as follow :

Destination GW Genmask ... F Iface

172.16.0.0 0.0.0.0 255.255.0.0 ... U eth1
172.16.0.0 0.0.0.0 255.255.0.0 ... U eth1
127.0.0.0 0.0.0.0 255.0.0.0 ... U lo
0.0.0.0 172.16.1.97 0.0.0.0 ... UG eth1

I disconected the cable of eth1 and ping as follow :

ping -I 172.16.231 172.16.1.77 ( from eth0 )
ping -I 172.40.232 172.16.1.77 ( from eth1 )

both ping have the result : destination host unreachable

but when I disconected the cable of eth0 and ping same the previous

ping -I 172.16.231 172.16.1.77 ( from eth0 )
ping -I 172.40.232 172.16.1.77 ( from eth1 )

both ping successful

I modified the routing table as follow :

Destination GW Genmask ... F Iface

172.16.0.0 0.0.0.0 255.255.0.0 ... U eth0
172.16.0.0 0.0.0.0 255.255.0.0 ... U eth1
127.0.0.0 0.0.0.0 255.0.0.0 ... U lo
0.0.0.0 172.16.1.97 0.0.0.0 ... UG eth0
0.0.0.0 172.16.1.97 0.0.0.0 ... UG eth1

the results was opposite :

I disconected the cable from eth1 and ping as follow :

ping -I 172.16.231 172.16.1.77 ( from eth0 )
ping -I 172.40.232 172.16.1.77 ( from eth1 )

both ping successful

but when I disconected the cable from eth0 and ping same the previous

ping -I 172.16.231 172.16.1.77 ( from eth0 )
ping -I 172.40.232 172.16.1.77 ( from eth1 )

both ping have the result : destination host unreachable

I restated the computer , routing table returned first case .

Can you help me !

Thank you very much !

nhgiang
 
Old 12-28-2004, 02:43 AM   #4
Ateo
Member
 
Registered: Sep 2004
Location: Long Beach, CA
Distribution: FreeBSD,Ubuntu,Gentoo,MacOS
Posts: 139

Rep: Reputation: 15
Are you plugging the 2 network cards into the same hub? You can't do that. Hubs work by broadcast and require all nodes connected to it to be on the same network in order to communicate. You can't even do that with a dumb switch (layer 2 only switch).

You would need a layer 3 switch (with VLANs) in order to connect both network cards into the same device.

In a nutshell, if you want the 2 network cards to be on 2 different networks, you need something in between them to route. Hubs are nothing more than amplifying bridges.

Last edited by Ateo; 12-28-2004 at 02:44 AM.
 
Old 12-29-2004, 03:23 AM   #5
nhgiang
LQ Newbie
 
Registered: Dec 2004
Posts: 3

Original Poster
Rep: Reputation: 0
I connected a NIC to a hub , and other NIC to other PC and

2 NIC have 2 IP address belong to 2 different address classes and it work fine .

Thank you for help !

nhgiang .
 
Old 01-02-2005, 07:31 AM   #6
roneill
LQ Newbie
 
Registered: Jan 2003
Location: South Texas
Distribution: RedHat 8.0
Posts: 1

Rep: Reputation: 0
2 NIC's

I currently have 2 NIC's in one computer connected to one hub. One is gw1 192.168.1.1 and the other is pc1 at 192.168.2.130. There is a pc2 and pc3. PC3 is another linux machine with the address of 192.168.2.132. Pc2 has a address of 192.168.2.131, it is a windows machine.

PING pc1.homenet (192.168.2.130) 56(84) bytes of data.
64 bytes from pc1.homenet (192.168.2.130): icmp_seq=0 ttl=64 time=0.221 ms
64 bytes from pc1.homenet (192.168.2.130): icmp_seq=1 ttl=64 time=0.139 ms
64 bytes from pc1.homenet (192.168.2.130): icmp_seq=2 ttl=64 time=0.146 ms

--- pc1.homenet ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2011ms
rtt min/avg/max/mdev = 0.139/0.168/0.221/0.040 ms, pipe 2
[root@gw1 root]# ping gw1
PING gw1.homenet (192.168.1.1) 56(84) bytes of data.
64 bytes from gw1.homenet (192.168.1.1): icmp_seq=0 ttl=64 time=0.152 ms
64 bytes from gw1.homenet (192.168.1.1): icmp_seq=1 ttl=64 time=0.130 ms
64 bytes from gw1.homenet (192.168.1.1): icmp_seq=2 ttl=64 time=0.125 ms
64 bytes from gw1.homenet (192.168.1.1): icmp_seq=3 ttl=64 time=0.131 ms

--- gw1.homenet ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3014ms
rtt min/avg/max/mdev = 0.125/0.134/0.152/0.015 ms, pipe 2
[root@gw1 root]# ping pc3
PING pc3.homenet (192.168.2.132) 56(84) bytes of data.
64 bytes from pc3.homenet (192.168.2.132): icmp_seq=0 ttl=64 time=1.02 ms
64 bytes from pc3.homenet (192.168.2.132): icmp_seq=1 ttl=64 time=0.371 ms
64 bytes from pc3.homenet (192.168.2.132): icmp_seq=2 ttl=64 time=0.378 ms
64 bytes from pc3.homenet (192.168.2.132): icmp_seq=3 ttl=64 time=0.402 ms

I currently am having a problem pinging the windows machine but that is another issue.
There is a HowTo on having two NIC's on one machine but do not have the address handy.
If I remember this is not considered the best way to set up a network connecting to the internet but it will work. My thought was that I would have a machine that is connected to the internet ie gw1 and it would help insulate my network pc1,pc2 and pc3.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Scripts for Open Direct Connect Hub Miyamoto Linux - Software 1 01-02-2005 07:57 AM
Netgear (WGR614) as hub can't connect via Browser stardotstar Linux - Networking 1 12-15-2004 12:03 AM
Cannot connect to network via hub calluminsky Linux - Networking 26 07-25-2004 09:18 PM
connect switch to hub? ody1 Linux - Networking 3 04-12-2004 08:42 AM
NIC w/ built-in hub -> cable modem + LAN ? TedMaul Linux - Networking 3 01-21-2004 10:16 AM

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

All times are GMT -5. The time now is 01:32 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