Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Raymond Leach <raymondl@knowledgefactory.co.za>
To: Netfilter Mailing List <netfilter@lists.netfilter.org>
Subject: Re: Bonding + NAT
Date: 28 Mar 2003 18:15:23 +0200	[thread overview]
Message-ID: <1048868123.17834.90.camel@raylinux.internal> (raw)
In-Reply-To: <20030328145059.2ea1241a.efgonzalez@worldonline.es>

[-- Attachment #1: Type: text/plain, Size: 3132 bytes --]

Maybe SNAT is not the right solution. Have a look at the ROUTE patch in
the netfilter POM.


On Fri, 2003-03-28 at 15:50, Eduardo Fernández González wrote:
> Hello.
> 
> In my university dorm we've got a private net with two subnets: I'll call one of them the servers subnet (10.1.5.0/24) because there are some servers (ftp, web, streaming, etc) and a couple of routers: one is a cisco router which provide us with internet access and the other one is a linux system which acts as a router between this subnet and the other subnet (10.1.7.0/24), which I'll refer as the students subnet, where there are about 250 hosts. 
> 
> The linux router is doing NAT, and it is a dhcp, ddns and pdc (primary domain controller) server too. The traffic between this subnets is very heavy because of the ftp server, so we decided to add two more ethernet cards to the linux router (4 in total) and configure bonding. But only the switches at the students subnet supported bonding, so now we have two cards (eth1 and eth3) showing the same ip (10.1.7.1) with bonding and the other two cards (eth0 and eth2) with two ips (10.1.5.4 and 10.1.5.3). Then, our idea was to force the traffic between the subnets to leave the router over eth2, and to make the rest of the traffic leave the router over eth0. At first, I thought the following nat rules were enough to implement this,
> 
> # iptables -t nat -A POSTROUTING -o eth2 -s 10.1.7.0/24 -d 10.1.5.0/24 -j SNAT --to-source 10.1.5.3
> # iptables -t nat -A POSTROUTING -o eth0 -s 10.1.7.0/24 -d ! 10.1.5.0/24 -j SNAT --to-source 10.1.5.4
> 
> but I was wrong: I was able to ping the internet from the students subnet, and the traffic left the router over the right interface, but I was unable to ping any host at the servers subnet. And the question is, am I wrong? Is it possible to implement what I've said via iptables? 
> 
> As a quick and dirty hack, we're using iproute2 to make all traffic between the students and the ftp leave the router over eth2, but what's bad on iproute2 is that you have to specify single hosts, not a whole network like 10.1.5.0/24. Moreover, you can't use rules of the kind -d ! 10.1.5.0/24, unlike with iptables. Is iptables the right approach to do this? Am i missing something?
> 
> Thank you very much in advance,
> 
> Eduardo Fernández
-- 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(  Raymond Leach                       )
 ) Knowledge Factory                  (
(                                      )
 ) Tel: +27 11 445 8100               (
(  Fax: +27 11 445 8101                )
 )                                    (
(  http://www.knowledgefactory.co.za/  )
 ) http://www.saptg.co.za/            (
(  http://www.mapnet.co.za/            )
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   o                                o
    o                              o
        .--.                  .--.
       | o_o|                |o_o |
       | \_:|                |:_/ |
      / /   \\              //   \ \
     ( |     |)            (|     | )
     /`\_   _/'\          /'\_   _/`\
     \___)=(___/          \___)=(___/


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2003-03-28 16:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-28 13:50 Bonding + NAT Eduardo Fernández González
2003-03-28 16:15 ` Raymond Leach [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=1048868123.17834.90.camel@raylinux.internal \
    --to=raymondl@knowledgefactory.co.za \
    --cc=netfilter@lists.netfilter.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