All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] multiple uplinks example script
@ 2005-02-01  6:00 Tóth Nándor
  0 siblings, 0 replies; only message in thread
From: Tóth Nándor @ 2005-02-01  6:00 UTC (permalink / raw)
  To: lartc

Hi!

I had two uplinks till today. We stopped one of them today, so i thought 
i could share my experience. (it is maybe useful for somebody)

I hadn't managed to configure it using a LARTC howto, but the Nano-howto 
(http://www.ssi.bg/~ja/nano.txt) and julian's kernel patches.

I had some problems with icq connections, because it is a two step 
connection (It is just theory).
1. Client --> Main server
2. Main Server --> Client ; Main server -> small server
3. Client -> small server

The problem is, when connection 1. use different uplink then connection 2.

Those icq related rules below corrected the problem.

My script:
IF0=eth2
IF1=eth1
IF2=eth3
IF3=eth0
P0_NET\x192.168.1.0/24
P1_NET=public1
P2_NET=public2

IP0\x192.168.1.254
IP1=publicip1
IP2=publicip1

#gateway
P1=publicgw1
P2=publicgw2

#table
T1!1
T2!2
T3"2

IP=/sbin/ip

# Delete everything
#$IP route flush cache
$IP route flush all
$IP route flush all table $T1
$IP route flush all table $T2
$IP route flush all table $T3

#icq rules
$IP rule delete prio 48 to 205.188.0.0/16 table $T1
$IP rule delete prio 49 to 64.12.161.153 table $T1
$IP rule delete prio 49 to 64.12.0.0/16 table $T1

$IP rule delete prio 50 table main
$IP rule delete prio $T3 table $T3
$IP rule delete prio $T1 from $P1_NET table $T1
$IP rule delete prio $T2 from $P2_NET table $T2


# The default table
$IP route add $P0_NET dev $IF0 src $IP0
$IP route add $P1_NET dev $IF1 src $IP1
$IP route add $P2_NET dev $IF2 src $IP2

# For stable icq connections
$IP rule add prio 48 to 205.188.0.0/16 table $T1
#$IP rule add prio 49 to 64.12.161.153 table $T1
$IP rule add prio 49 to 64.12.0.0/16 table $T1
$IP rule add prio 50 table main
$IP route del default table main

$IP rule add prio $T3 table $T3
$IP route add default table $T3 proto static \
     nexthop via $P1 dev $IF1 weight 1 \
     nexthop via $P2 dev $IF2 weight 3

$IP rule add prio $T1 from $P1_NET table $T1
$IP route add default via $P1 dev $IF1 src $IP1 proto static table $T1
$IP route append prohibit default table $T1 metric 1 proto static

$IP rule add prio $T2 from $P2_NET table $T2
$IP route add default via $P2 dev $IF2 src $IP2 proto static table $T2
$IP route append prohibit default table $T2 metric 1 proto static

$IP route flush cache

-- 
Udv,
   Nandor
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-02-01  6:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-01  6:00 [LARTC] multiple uplinks example script Tóth Nándor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.