LinuxQuestions.org
Help answer threads with 0 replies.
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 06-15-2006, 06:32 AM   #1
hi100nu
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
multi gateway routing problem


hi all,
i wann to create my linux router as a load balancing divice mean i have two isp and i wann both on a singal linux router and masqurade them with my local network, i have three lan card two for wan and one for lan, i have create some rules but it's not working i am showing this all rules below

IF0=eth0
IF1=eth1
IF2=eth2
IP1=192.168.1.2
IP2=61.246.243.86
P1=192.168.1.1
P2=61.246.243.81
P1_NET=192.168.1.0/24
P2_NET=61.246.243.0/28
P0_NET=10.10.0.0/16

p route add $P1_NET dev $IF1 src $IP1 table T1
ip route add default via $P1 table T1
ip route add $P2_NET dev $IF2 src $IP2 table T2
ip route add default via $P2 table T2

ip route add $P1_NET dev $IF1 src $IP1
ip route add $P2_NET dev $IF2 src $IP2

ip route add default via $P1

ip rule add from $IP1 table T1
ip rule add from $IP2 table T2

ip route add $P0_NET dev $IF0 table T1
ip route add $P2_NET dev $IF2 table T1
ip route add 127.0.0.0/8 dev lo table T1
ip route add $P0_NET dev $IF0 table T2
ip route add $P1_NET dev $IF1 table T2
ip route add 127.0.0.0/8 dev lo table T2

ip route add default scope global nexthop via $P1 dev $IF1 weight 1 nexthop via $P2 dev $IF2 weight 1

echo 1 > /proc/sys/net/ipv4/ip_forward

######################## Flust all chains ##################################
/sbin/iptables -F FORWARD
/sbin/iptables -F OUTPUT
/sbin/iptables -F INPUT
/sbin/iptables -F -t nat
/sbin/iptables -F -t mangle

####################### Set the default policy #############################

/sbin/iptables -P INPUT ACCEPT
/sbin/iptables -P OUTPUT ACCEPT
/sbin/iptables -P FORWARD ACCEPT


/sbin/iptables -t nat -A POSTROUTING -j MASQUERADE

when i apply this rules it's only work on gatway one (i.e. 192.168.1.1 on eth1) and i wann to work on both isp on same time with my local network so plz help me out.
 
Old 06-16-2006, 07:00 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
I think bonding is what you are after. Here is one link.
http://www.devco.net/archives/2004/1...et_bonding.php

Brian1
 
Old 06-17-2006, 01:24 PM   #3
vimal
Red Hat India
 
Registered: Nov 2004
Location: Kerala/Pune,india
Distribution: RedHat, Fedora
Posts: 260

Rep: Reputation: 36
Hello hi100nu,

I think you need to do ethernet bonding for combining multiple NICs. Ethernet bonding refers to the process by which the network cards are bonded or tied up virtually by the aid of the OS. It is mainly used for load balancing. If you have the kernel source installed, the documentation will exist under networking section called bonding.txt. You will need to recompile the kernel to include ethernet bonding if it does not support the feature. After that you need to edit the /etc/modules.conf or /et/modprobe.conf (depends on ur distro and add the line 'alias bond0 bonding'. This would load the module on request.
The next part seems the most important.. You need to create a new configuration file for the virtual 'bond' interface. Copy your config: file for the ethernet interface and edit as follows:
DEVICE=bond0
IPADDR=X.X.X.X
NETMASK=X.X.X.X
NETWORK=X.X.X.X
BROADCAST=X.X.X.X
ONBOOT=yes
BOOTPROTO=none
Now as the next step, edit the config: files for your real NICs and add the following config:.
DEVICE=ethX
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

This step has to be done for each and every one of your NIC, replacing ethX with that of your config:. After the config: restart network service or issue the command ' ifup bond0' which would bring the bonding interface up. Issue 'ifconfig' to see whether the interface is up...

Hope this was what you were after.Contact in case of need........

Thanks,,,
 
  


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
Multi Homed Gateway Router Problem conradg Linux - Networking 2 03-30-2006 11:51 PM
how to configure multi-nic routing meping Linux - Networking 20 10-24-2005 01:29 PM
DHCP and gateway routing problems (simple noob problem) michaelsanford Linux - Networking 4 04-13-2005 02:17 PM
Multi homed gateway nukenstien Linux - Networking 4 02-10-2005 10:07 AM
how do multi routing for email server? masroor Linux - Networking 1 12-02-2003 08:37 AM

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

All times are GMT -5. The time now is 12:45 PM.

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