All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brad Lay <brad@coombabah.net>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Multi-Link Machine
Date: Mon, 10 Mar 2003 09:27:48 +0000	[thread overview]
Message-ID: <marc-lartc-104728852211316@msgid-missing> (raw)
In-Reply-To: <marc-lartc-104717218710987@msgid-missing>

On Sun, 9 Mar 2003, paolopoletti wrote:

> It's possible (i've done it for one of my customers two days ago, using
> the Martin manual below).
>
> It is explained in very simple way here :
> http://www.linux-ip.net/html/adv-multi-internet.html#adv-multi-internet-outbound

This really helped, but it still didn't achieve what I wanted. I ended up
having all traffic route via the "table 4", instead of just the traffic I
fwmark'd.

Currently its setup backwards to how I'd like it setup, but reversing it
shouldn't be too hard once I have it working.

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use  Iface
203.166.87.135  0.0.0.0         255.255.255.255 UH    0      0        0  ppp0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0  eth1
203.45.180.0    0.0.0.0         255.255.254.0   U     0      0        0  eth0
0.0.0.0         203.45.180.1    0.0.0.0         UG    0      0        0  eth0

traceroute before I run this script

 1  10.224.40.1 (10.224.40.1)  7.413 ms  7.148 ms  5.993 ms
 2  CPE-61-9-209-7.qld.bigpond.net.au (61.9.209.7)  7.527 ms  7.579 ms  8.155 ms
 3  GigabitEthernet4-2.cha23.telstra.net (139.130.193.117)  212.405 ms  214.032 ms  196.079 ms
 4  GigabitEthernet1-2.woo-core1.Brisbane.telstra.net (203.50.50.129)  8.220 ms  8.770 ms  8.499 ms
 5  Pos5-0.ken-core4.Sydney.telstra.net (203.50.6.221)  18.455 ms  20.626 ms  19.562 ms

[what I used below]

eth0 ip = 203.45.180.34 gateway = 203.45.180.1
ppp0 ip = 203.217.13.226 gateway = 203.166.87.135

#!/bin/bash
ip route flush table 4
ip route show table main | grep -Ev ^default \
| while read ROUTE ; do
ip route add table 4 $ROUTE
done

ip route add table 4 default via 203.166.87.135
iptables -t mangle -A PREROUTING -p tcp --dport 22 -j MARK --set-mark 4
iptables -t mangle -A PREROUTING -s 192.168.0.5 -j MARK --set-mark 4

iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 203.45.180.34
iptables -t nat -A POSTROUTING -o ppp0 -j SNAT --to-source 203.217.13.226

ip rule add fwmark 4 table 4
ip route flush cache

And traceroute after I run it.

[07:25 PM][root@genuis][~]$ traceroute syd1.samford.net
traceroute to syd1.samford.net (202.155.174.85), 30 hops max, 38 byte packets
 1  203.166.87.135 (203.166.87.135)  25.317 ms  27.793 ms  25.888 ms
 2  107.ATM2-0-0.GW2.BNE1.ALTER.NET (203.166.90.249)  41.877 ms  27.741 ms  25.901 ms
 3  422.AT-6-0-0.XR1.BNE1.ALTER.NET (210.80.32.53)  27.930 ms  31.898 ms  31.840 ms
 4  So-0-0-0.XR1.SYD2.ALTER.NET (210.80.33.1)  37.854 ms  43.755 ms


Anybody got any ideas.. I don't really understand fwmark too much, im just
winging it so far. :)

Thanks again.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

  parent reply	other threads:[~2003-03-10  9:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-09  1:08 [LARTC] Multi-Link Machine Brad Lay
2003-03-09  4:41 ` Martin A. Brown
2003-03-09 11:09 ` paolopoletti
2003-03-10  9:27 ` Brad Lay [this message]
2003-03-10 14:55 ` Martin A. Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-lartc-104728852211316@msgid-missing \
    --to=brad@coombabah.net \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.