All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corey Hickey <bugfood-ml@fatooh.org>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] two link
Date: Fri, 30 Sep 2005 00:53:32 +0000	[thread overview]
Message-ID: <433C8C8C.9030508@fatooh.org> (raw)
In-Reply-To: <12ec503505092910197e23692a@mail.gmail.com>

Fabio Silva wrote:
> hi list, i need help
> i have two links
> 
>                LINK 1
> Internet                    Linux  ---- LAN
>                LINK 2
> 
> 
> i need that the traffic web goes to link 2
> i use squid in the linux with transparent proxy i´ve tried to use
> squid parameter "tcp_outgoing_address" but it doesnt work.

I don't know about squid, but this should do it.

--------BEGIN--------
# this is untested, so be sure to look at it closely

# make a chain for marking packets
iptables -t mangle -N link2
iptables -t mangle -A link2 -j mark --set-mark 0x08  # 8 is arbitrary
iptables -t mangle -A link2 -j ACCEPT

# send http traffic to that chain
iptables -t mangle -A PREROUTING \
    -m multiport -p tcp --dport www,https -j link2

# set a rule for packets marked with "8" to go to table 8
ip rule add fwmark 8 table 8

# set up the default route for table 8
# replace $LINK2_GW with the gateway for link2 (at your ISP)
# replace $LINK2_DEV with the interface of link2 (eth1 or eth2, etc.)
ip route add default via $LINK2_GW dev $LINK2_DEV table 8
--------END--------

You may need to set up SNAT or masquerade separately for link2. If you
need help with that, I'll send a sample.

-Corey
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

  reply	other threads:[~2005-09-30  0:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-29 17:19 [LARTC] two link Fabio Silva
2005-09-30  0:53 ` Corey Hickey [this message]
2005-09-30 20:14 ` Corey Hickey
2005-10-03 20:13 ` Corey Hickey

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=433C8C8C.9030508@fatooh.org \
    --to=bugfood-ml@fatooh.org \
    --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.