From: "Ming-Ching Tiew" <mingching.tiew@redtone.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Split access, load balancing AND forwarding: HOW?
Date: Fri, 23 Feb 2007 23:59:53 +0000 [thread overview]
Message-ID: <005001c757a6$b69934f0$02bca8c0@freelance> (raw)
In-Reply-To: <Pine.LNX.4.64.0702211529590.9170@dellareas.intoweb.co.za>
From: "Alex Samad" <alex@samad.com.au>
> hi
>
> sorry missed the previous bits of the thread, could you post the relevant info,
> interested to see how this works and why you would pick it over the multipath
> method
Please note my checking of marked traffic is not ( according to the earlier posts )
> iptables -t mangle .... -m mark --mark ! 0 -j ACCEPT
However, it is :-
> iptables -t mangle .... -m mark ! --mark 0 -j ACCEPT
I leave it to you guys to decide which is the correct syntax.
The code below is taken from part of my bigger code :-
Cheers.
---------------------code-------------------------------------------
LINK1_MARK=5
LINK2_MARK=7
OUTSIDE_DEV_WEIGHT=0.5
INSIDE_DEVICE=eth0
OUTSIDE_DEVICE=eth1
OUTSIDE_DEVICE2=eth2
SAVEMARK="-m mark ! --mark 0 -j CONNMARK --save-mark"
ACCEPTMARK="-m mark ! --mark 0 -j ACCEPT"
SETMARK1="-j MARK --set-mark ${LINK1_MARK}"
SETMARK2="-j MARK --set-mark ${LINK2_MARK}"
#
#first, restore and accept the mark if there is any
iptables -t mangle -A OUTPUT -j CONNMARK --restore-mark
iptables -t mangle -A PREROUTING -j CONNMARK --restore-mark
iptables -t mangle -A PREROUTING ${ACCEPTMARK}
#handle inbound for link1
iptables -t mangle -A PREROUTING -i ${OUTSIDE_DEVICE} ${SETMARK1}
iptables -t mangle -A PREROUTING -i ${OUTSIDE_DEVICE} ${SAVEMARK}
iptables -t mangle -A PREROUTING ${ACCEPTMARK}
#handle inbound for link2
iptables -t mangle -A PREROUTING -i ${OUTSIDE_DEVICE2} ${SETMARK2}
iptables -t mangle -A PREROUTING -i ${OUTSIDE_DEVICE2} ${SAVEMARK}
iptables -t mangle -A PREROUTING ${ACCEPTMARK}
# (other features implementation snipped )
#handle recent outbound
iptables -t mangle -A PREROUTING -i ${INSIDE_DEVICE} -m recent --name link1 \
--update --second 300 ${SETMARK1}
iptables -t mangle -A PREROUTING -i ${INSIDE_DEVICE} -m recent --name link2 \
--update --second 300 ${SETMARK2}
iptables -t mangle -A PREROUTING -i ${INSIDE_DEVICE} ${SAVEMARK}
iptables -t mangle -A PREROUTING ${ACCEPTMARK}
#
#non-recent outbound randomly allocated
#
iptables -t mangle -A PREROUTING -i ${INSIDE_DEVICE} \
-m statistic --mode random --probability ${OUTSIDE_DEV2_WEIGHT} \
-m recent --name link2 --set ${SETMARK2}
iptables -t mangle -A PREROUTING -i ${INSIDE_DEVICE} ${SAVEMARK}
iptables -t mangle -A PREROUTING ${ACCEPTMARK}
iptables -t mangle -A PREROUTING -i ${INSIDE_DEVICE} \
-m recent --name link1 --set ${SETMARK1}
iptables -t mangle -A PREROUTING -i ${INSIDE_DEVICE} ${SAVEMARK}
iptables -t mangle -A PREROUTING ${ACCEPTMARK}
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
prev parent reply other threads:[~2007-02-23 23:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-21 14:10 [LARTC] Split access, load balancing AND forwarding: HOW? Andrew McGill
2007-02-22 2:16 ` Luciano Ruete
2007-02-22 2:58 ` Ming-Ching Tiew
2007-02-22 4:57 ` Ming-Ching Tiew
2007-02-23 2:54 ` Luciano Ruete
2007-02-23 3:06 ` Luciano Ruete
2007-02-23 3:48 ` Roy Orpiano
2007-02-23 7:23 ` Ming-Ching Tiew
2007-02-23 18:40 ` Alex Samad
2007-02-23 23:59 ` Ming-Ching Tiew [this message]
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='005001c757a6$b69934f0$02bca8c0@freelance' \
--to=mingching.tiew@redtone.com \
--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.