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 04-27-2004, 05:22 AM   #1
liutom
LQ Newbie
 
Registered: Oct 2003
Posts: 24

Rep: Reputation: 15
Pleas help - Linux with 2 Networkcards


Hello !

My Problem is this:
My Linux Box has 2 Networkcards:

eth0 = Intel on Board
eth1 = realtek

i want connect from this PC to
a) one Windows XP (IP 192.168.0.1)
B) to another linux Box (IP 192.168.0.100)


but always only one connetction is working (depending which networkcable is connected (so every line by itself works!!!)

if i connect both networkcabels then only one of them is working, but i can not "ping" on the other line!!!!

please help me to set up my linux box rhight !!!


Thank you a lot !!!

Liu
 
Old 04-27-2004, 05:29 AM   #2
chris78
LQ Newbie
 
Registered: Mar 2004
Location: germany
Distribution: Slackware & RedHat
Posts: 28

Rep: Reputation: 15
You have a routing problem at this point.
Quote:
a) one Windows XP (IP 192.168.0.1)
B) to another linux Box (IP 192.168.0.100)
Standard network masks for these networks are 255.255.255.0.
That means that your first card gets all addresses from within 192.168.0.1 until 192.168.0.254.

If you can you should change one network to another address space.
For example:

a) one Windows XP (IP 192.168.0.1)
B) to another linux Box (IP 192.168.1.100)

If you want to use both network cards on the same subnet i am not sure how you could manage this cleanly.
But if there are just a few fixed addresses behind each card you can setup host routes. However that would need you to change the routes each time the network structure changes.

Chris

Last edited by chris78; 04-27-2004 at 05:53 AM.
 
Old 04-27-2004, 05:42 AM   #3
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
if u change routing table u will reach other computer. but chris78 is right. 2 of network card are in same network. so linux will try to access computers on eth0. but eth0 is not connected both of computers. so u can only reach one of them.

u may try this:

if eth0 is connected to pc1 (192.168.0.100) and eth1 is connected to pc2(192.168.0.1):
/sbin/route add -host 192.168.0.1 dev eth1

if eth0 is connected to pc2 (192.168.0.1)
/sbin/route add -host 192.168.0.100 dev eth1
 
Old 04-27-2004, 05:59 AM   #4
chris78
LQ Newbie
 
Registered: Mar 2004
Location: germany
Distribution: Slackware & RedHat
Posts: 28

Rep: Reputation: 15
Quote:
Originally posted by maxut
if eth0 is connected to pc1 (192.168.0.100) and eth1 is connected to pc2(192.168.0.1):
/sbin/route add -host 192.168.0.1 dev eth1

if eth0 is connected to pc2 (192.168.0.1)
/sbin/route add -host 192.168.0.100 dev eth1
However then you need to delete the network routes first.
Code:
/sbin/route del -net 192.168.0.0 netmask 255.255.255.0 eth0
/sbin/route del -net 192.168.0.0 netmask 255.255.255.0 eth1
I think like this. "route" can be a bit picky sometimes so you might want to look into "man route" and change the options a bit.
One of them might fail. Since one of the routes might have been deleted by the network-script which also automatically inserted them when you connect a cable i guess.
 
Old 04-27-2004, 06:25 AM   #5
liutom
LQ Newbie
 
Registered: Oct 2003
Posts: 24

Original Poster
Rep: Reputation: 15
Hey - Thank you very much for your fast response!!!!

For me itīs not important which IP every PC has..

so pleas can you tell me if iīve had everthing understood:

PC "A" = WindowsXP
IP: 192.168.0.1 (because it will forward the Internet ...)
Subnet: 255.255.255.0

Linux PC (Mandrake (but if i get it to work -> SLACKWARE
1st Networkcard (connected to PC "A")
IP: 192.168.0.100
Subnet:255.255.255.0

2nd Networkcard (connected to PC "B")
IP: 192.168.1.100
Subnet: 255.255.255.0

PC "B" = Slackware
IP: 192.168.1.1
Subnet:255.255.255.0


Would this be right????
Thank you verry much for your verry good help!!!

Liu
 
Old 04-27-2004, 06:39 AM   #6
chris78
LQ Newbie
 
Registered: Mar 2004
Location: germany
Distribution: Slackware & RedHat
Posts: 28

Rep: Reputation: 15
Yes. As far as i can see you got the point.

-network A (192.168.0.0 / 255.255.255.0)

-network B (192.168.1.0 / 255.255.255.0)

Quote:
Thank you verry much for your verry good help!!!
Thats what we are here for
 
Old 04-29-2004, 04:35 AM   #7
liutom
LQ Newbie
 
Registered: Oct 2003
Posts: 24

Original Poster
Rep: Reputation: 15
@ chris78


Thank you a lot!

I just wanted to give a result of the things i changed!
Now i use 2 different subnetīs

every thing works fine yet !!!


Bye Liu
 
  


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
hi guys i am new to linux can i play my *.dat files i.e mpeg file if so pleas help me sripathi_venky Linux - Software 1 11-16-2005 09:43 AM
pleas can you help me....i need you ALaa Cabo Linux - Software 2 08-15-2005 07:54 PM
Help help pleas phil75 Linux - General 9 06-18-2005 03:58 AM
Two Networkcards Steffen.Stein Linux - Networking 1 03-28-2005 04:26 AM
Pleas help! henkas Linux - Networking 13 11-04-2003 06:34 AM

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

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