Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Dimitri Yioulos <dyioulos@onpointfc.com>
To: "netfilter@vger.kernel.org" <netfilter@vger.kernel.org>
Subject: Re: Dual WAN set-up
Date: Thu, 12 Jan 2012 18:19:43 -0500	[thread overview]
Message-ID: <201201121819.43409.dyioulos@onpointfc.com> (raw)
In-Reply-To: <op.v7zujutux1lyi3@debiandesk2.net>

On Thursday 12 January 2012 6:08:08 pm Lloyd Standish wrote:
> On Thu, 12 Jan 2012 15:51:18 -0600, Dimitri Yioulos 
<dyioulos@onpointfc.com> wrote:
> > I currently have an iptables/Netfilter firewall router
> > configured thusly:
> >                               WAN
> >
> >  (192.168.x.x) LAN --  fw -- DMZ (10.x.x.x)
> > OK, pretty basic.  And, it has worked well for a long time.
> > Now, I need to add a second WAN (provided by a second
> > provider). I need it to serve specific boxes in the DMZ, both
> > inbound and outbound.  Currently, all boxes in the DMZ are
> > served by the single WAN connection.  I'm not sure what other
> > information I need to provide you, but I'm hoping you all can
> > help with very specific instructions or a very detailed
> > how-to so I can get this accomplished.  And, of course, I
> > need to get this done yesterday.
>
> Hi,
>
> I am not highly experienced compared to most other posters
> here, but I'll try to help :)
>
> Shouldn't your diagram indicate that the fw is connected to the
> WAN (not to the DMZ)?  I will proceed under that assumption. 
> If you have a netfilters firewall installed, I think all
> interfaces would go "through" it.
>
>
> Adding a second (or more) uplink to a netfilters firewall is
> easy.  I suggest the following:
>
> 1. You could follow the basic information explained here, to
> set up split access:
> http://lartc.org/howto/lartc.rpdb.multiple-links.html  After
> reading this and understanding about using multiple routing
> tables to route traffic through different interfaces (uplinks),
> you can proceed.
>
> 2. You would set up a custom routing table for the special DMZ
> traffic.  Use the info in the above link to do that.  Suppose
> it is called "DMZSPECIAL".  You will set up routing to the new
> DMZ interface using the MYDMZ table, something like this:
>
> 	ip route add 10.x.x.x/8 dev ${DMZinterface} src ${wan} table
> DMZSPECIAL ip route add default via ${gateway} dev ${interface}
> table DMZSPECIAL
>
> (You will also keep your regular routing table to your old
> interface.  Also of course you keep your SNAT over your
> existing interface, only for LAN hosts of course.)
>
> 2. You might create a custom chain for the new interface, which
> is supposed to serve the special DMZ hosts.  This is to mark
> packets for subsequent decision on routing:
>
> 	iptables -t mangle -N CONNMARK1
> 	iptables -t mangle -A CONNMARK1 -j MARK --set-mark 1
> 	iptables -t mangle -A CONNMARK1 -j CONNMARK --save-mark
> 	iptables -t mangle -A CONNMARK1 -j ACCEPT
>
> 3. You would NEW mark all packets from the special DMZ hosts
> with fwmark 1, like this (repeat for each source IP or subnet
> to use the new interface):
>
> 	iptables -t mangle -A PREROUTING -m state --state NEW -s
> 10.x.x.x -j CONNMARK1 etc.
>
>
> 4. You would restore the connection mark to the packet mark
> with a rule like this: iptables -t mangle -A PREROUTING -i
> ${dmz_if} -m state --state ESTABLISHED,RELATED -j CONNMARK
> --restore-mark
>
> Then add a policy routing rule, directing all traffic with the
> "1" mark to the new DMZ uplink:
>
> 	ip rule add fwmark 1 table MYDMZ
>
> That should do it.  Post back if you have any trouble.
> --
> Lloyd
> --
> To unsubscribe from this list: send the line "unsubscribe
> netfilter" in the body of a message to
> majordomo@vger.kernel.org
> More majordomo info at 
> http://vger.kernel.org/majordomo-info.html


Lloyd,

Our fw/router routes traffic to both our LAN and our DMZ.  That's 
how it was set up a long time ago and, again, it works very well.  
Given that, do your instructions (btw, did I say I'm grateful for 
your help) still work?

Dimitri

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


  parent reply	other threads:[~2012-01-12 23:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-12 21:51 Dual WAN set-up Dimitri Yioulos
2012-01-12 22:28 ` Andrew Beverley
2012-01-12 22:48   ` Dimitri Yioulos
2012-01-13  7:18     ` Andrew Beverley
2012-01-12 23:08 ` Lloyd Standish
2012-01-12 23:12   ` Lloyd Standish
2012-01-12 23:22     ` Dimitri Yioulos
2012-01-12 23:19   ` Dimitri Yioulos [this message]
2012-01-13  0:52   ` Lloyd Standish
2012-01-13  7:25   ` Andrew Beverley
2012-01-13 11:47     ` Dimitri Yioulos
2012-01-13 14:17     ` Lloyd Standish
2012-01-13 15:17       ` Dimitri Yioulos
2012-01-13 15:22         ` Dimitri Yioulos
2012-01-14  2:27           ` Lloyd Standish
     [not found]           ` <201201160956.23955.dyioulos@onpointfc.com>
2012-01-16 20:28             ` Lloyd Standish
2012-01-13 20:00         ` Lloyd Standish
2012-01-13 20:04           ` Dimitri Yioulos
  -- strict thread matches above, loose matches on Subject: below --
2012-01-16 21:43 Dimitri Yioulos

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=201201121819.43409.dyioulos@onpointfc.com \
    --to=dyioulos@onpointfc.com \
    --cc=netfilter@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox