Link to home
Start Free TrialLog in
Avatar of keepwalking
keepwalking

asked on

One box with two modems and three network cards

I have two modems assigned one on eth0 81.125.25.a and one on eth1 81.125.25.b , the 1st and 2nd modem have gateway 81.125.25.x. the internal network 192.168.0.1 on eth2, and the clients from 192.168.0.10-40 The problem is at 'route' when i do:

route -n add default gw 81.125.25.x
route -n add default gw 81.125.25.x dev eth1 (because first is on eth0)

or

route -n add default gw 81.125.25.x
route -n add -host 81.125.25.b gw 81.125.25.x dev eth1

this doesn't work too. In the first case I have net only on eth1 and not on eth0 and in the second on nothing. If I put only the 1st modem or the 2nd and add the default route it works, but I want both to work. I don't want load balancing because on the first modem I will put 5-6 persons and on second 20+ because the second line is more powerfull. (this will be via iptables SNAT : iptables -t nat -A POSTRUTING etc..)
Can somebody tell me what can i do to make the both modems work in the same time ? If you could give me the script it will be wonderful :)
Avatar of joju
joju

make two sub networks in your lan.
connect 6 systems to one sub-net
connect 20 systems to second sbu-net
both subnet has ur linux system with modems as gateway
in gateway system add 1st subnet gw as  81.125.25.a
add 2nd subnet gw as  81.125.25.b
                   

Thanx,
Joju.
you need routing.

iproute2 can handle this problem creating two different routing tables: one for eth0 and other for eth1.

check in

http://lartc.org/

in the howto comes several examples about how to do what you want.
Avatar of keepwalking

ASKER

Can u post the script for doing this ? I don't understand what is there I mean what is $P2_NET and in my case is only 1 provider but 2 modems and the same gateway as I  said upper in the question, I want the clients from 192.168.0.5-10 be on modem 1 and that from 192.168.0.15-40 on the other. I'm newbie in routings and this is why I asked here because all the answers of this question are read..read...and read howto's. Thanks
ASKER CERTIFIED SOLUTION
Avatar of lhboi
lhboi
Flag of Viet Nam image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I got the following error  :

RTNETLINK answers: Invalid argument
Works now..thank lhboi