You are not logged in.

#1 2007-08-13 21:43:49

ADT
Member
Registered: 2007-04-02
Posts: 13

[***SOLVED***] Simple Linux Router Help

I have a computer with two network interface cards.
One card is connected to a computer called server.
the other card is connected to another computer called client.

This is the way its setup


server computer                                    router computer                                       client computer
eth0  <--------------------------> eth0                                          eth1 <----------------------> eth0
192.168.1.50                          192.168.1.25          192.168.1.200                         192.168.1.100


From the client
I can ping 192.168.1.25 and 192.168.1.200 but I can't ping 192.168.1.50

From the server
I can ping 192.168.1.25 and 192.168.1.200 but I can't ping 192.168.1.100

My question is how can I ping the server computer from the client computer and vice versa.


My previous solution was not the best, its as follows:
I got communication between the client and server computers working through the router computer before by using the following:

The libpcap packet capture libraries to capture packets from the server on the router's eth0.
Then my code injects the captured packet on to the router's eth1 to send it to the client.

The libpcap packet capture libraries to capture packets from the client on the router's eth1.
Then my code injects the captured packet on to the router's eth0 to send it to the server.

The problem with this solution is that it really, really kills the network speed. For example all the network interface cards are 100/10 Mbps speed and do about 45 - 60 Mbps between server and router, router and client but when I use the libpcap code to connect the server and client the max speed between the server and client is 410Kbps.

Last edited by ADT (2007-08-15 08:56:34)

Offline

#2 2007-08-14 12:48:35

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,966

Re: [***SOLVED***] Simple Linux Router Help

simple solution : get a switch and connect all pc's to the switch.

Alternative : use iptables to change your router computer into a real router.

This wiki page might help.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2007-08-14 15:07:38

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [***SOLVED***] Simple Linux Router Help

Assuming netmask 255.255.255.0 everywhere, you're using the same subnet on both sides, so you need bridging, not routing. Find a linux bridging howto and take it from there.

Alternatively, change one of the subnets, and go for the routing option (overkill for this setup, IMO, but it's your choice). AFAIR there's a wiki page about setting up an Arch based router.

Lone_Wolf's switch suggestion is by far the best idea, though. smile

Offline

#4 2007-08-14 18:02:52

ADT
Member
Registered: 2007-04-02
Posts: 13

Re: [***SOLVED***] Simple Linux Router Help

Thanks for pointing me in the right direction.

Offline

Board footer

Powered by FluxBB