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.
|
|
12-27-2004, 09:27 PM
|
#1
|
LQ Newbie
Registered: Dec 2004
Posts: 3
Rep:
|
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 .
|
|
|
12-27-2004, 10:26 PM
|
#2
|
Member
Registered: Sep 2002
Location: .at
Distribution: SuSE, Knoppix
Posts: 532
Rep:
|
2 NIC on same switch is no problem
- use different IP for each NIC
- ping IP1
- disconnect cable 1
- ping IP2
should work
|
|
|
12-28-2004, 02:09 AM
|
#3
|
LQ Newbie
Registered: Dec 2004
Posts: 3
Original Poster
Rep:
|
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
|
|
|
12-28-2004, 02:43 AM
|
#4
|
Member
Registered: Sep 2004
Location: Long Beach, CA
Distribution: FreeBSD,Ubuntu,Gentoo,MacOS
Posts: 139
Rep:
|
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.
|
|
|
12-29-2004, 03:23 AM
|
#5
|
LQ Newbie
Registered: Dec 2004
Posts: 3
Original Poster
Rep:
|
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 .
|
|
|
01-02-2005, 07:31 AM
|
#6
|
LQ Newbie
Registered: Jan 2003
Location: South Texas
Distribution: RedHat 8.0
Posts: 1
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 01:32 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
|
|