LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Pleas help - Linux with 2 Networkcards (https://www.linuxquestions.org/questions/linux-networking-3/pleas-help-linux-with-2-networkcards-175030/)

liutom 04-27-2004 05:22 AM

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

chris78 04-27-2004 05:29 AM

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

maxut 04-27-2004 05:42 AM

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

chris78 04-27-2004 05:59 AM

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.

liutom 04-27-2004 06:25 AM

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

chris78 04-27-2004 06:39 AM

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 :)

liutom 04-29-2004 04:35 AM

@ 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


All times are GMT -5. The time now is 05:08 PM.