All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben <bench@silentmedia.com>
To: lartc@vger.kernel.org
Subject: RE: [LARTC] masq + nat + port forwarding: can it be done?
Date: Sun, 20 May 2001 18:24:38 +0000	[thread overview]
Message-ID: <marc-lartc-99038312722978@msgid-missing> (raw)
In-Reply-To: <marc-lartc-99032035310133@msgid-missing>

Based on this sentance from a list of 2.4 networking features:

"Built-in PORT Forwarding, which makes IPMASQADM no longer required"
(from http://www.linuxports.com/howto/IP-MASQ/x266.htm)

I would think that ipmasqadm is not the "correct" solution.

On Sat, 19 May 2001, Largo Hellenz wrote:

> hi,
> 
>  i am able to port forward for ext. to int. interfaces using
> IPMASQDM PORTFW.
> 
> you have to get the IPMASQADM code off of the internet.
> 
> ######################################################
> #  here is my example....
> ######################################################
> 
>  #!/bin/sh
> 
> /sbin/depmod -a
> /sbin/modprobe ip_masq_mfw
> /sbin/modprobe ip_masq_user
> /sbin/modprobe ip_masq_autofw
> /sbin/modprobe ip_masq_portfw
> 
> extip="`/sbin/ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | sed -e
> 's/.*://'`"
> 
> ########################################################################
> ########################################################################
> /usr/sbin/ipmasqadm portfw -f
> /usr/sbin/ipmasqadm portfw -a -P tcp -L $extip 21 -R 192.168.1.10 21
> /usr/sbin/ipmasqadm portfw -a -P tcp -L $extip 80 -R 192.168.1.10 80
> #/usr/sbin/ipmasqadm portfw -a -P tcp -L $extip 6000 -R 192.168.1.254 6000
> #/usr/sbin/ipmasqadm portfw -a -P tcp -L $extip 6001 -R 192.168.1.254 6001
> /usr/sbin/ipmasqadm portfw -a -P tcp -L $extip 10001 -R 192.168.1.10 22
> /usr/sbin/ipmasqadm portfw -a -P tcp -L $extip 10002 -R 192.168.1.101 22
> /usr/sbin/ipmasqadm portfw -a -P tcp -L $extip 10003 -R 192.168.1.101 23
> /usr/sbin/ipmasqadm portfw -a -P tcp -L $extip 10004 -R 192.168.1.10 23
> 
> #/usr/sbin/ipmasqadm portfw -a -P udp -L $extip 69 -R 192.168.1.254 69
> #/usr/sbin/ipmasqadm portfw -a -P tcp -L $extip 53 -R 192.168.1.101 53
> #######################################################################
> #######################################################################
> 
> 
> -----Original Message-----
> From: lartc-admin@mailman.ds9a.nl [mailto:lartc-admin@mailman.ds9a.nl]On
> Behalf Of Ben
> Sent: Sunday, May 20, 2001 1:02 AM
> To: lartc@mailman.ds9a.nl
> Subject: [LARTC] masq + nat + port forwarding: can it be done?
> 
> 
> We're having problems getting our 2.4 kernel to do exactly what we need
> it to for our network. In short, we aren't able to do port forwarding for
> a masquarded machine, nor for a NAT'd machine.
> 
> The topology goes like:
> 
> cable -- (eth2)
>            |
>           router - (eth1)
>            |           |
> dsl ---- (eth0)        +-- client1 (10.0.0.1)
>                        +-- client2 (10.0.0.2)
>                        +-- server1 (10.0.0.3)
>                        +-- server2 (10.0.0.4)
> 
> The router's interfaces are:
> eth0    1.1.1.1
> eth0:1  1.1.1.2
> eth1    10.0.0.254
> eth2    2.2.2.2
> 
> 
> server1 (10.0.0.3) is set up for 1:1 NAT with eth0:1... all incoming
> packets to 1.1.1.2 go to server1, and all packets from server1 get
> translated to come from 1.1.1.2.
> 
> client1 and client2 are masquaraded through eth0, unless they
> attempt to initiate an ftp or nntp connection, in which case they are
> masq'd through eth2.
> 
> server2 is always masq'd through eth2.
> 
> What we'd *like* to do is the following:
> 
> 1) If ftp connections come in on eth2, we'd like to forward those requests
> on to server2, and have replies go back out the same interface. It's not
> clear to me if it's even possible to set up port forwarding for an
> interface that's doing masquarading, much less what the iptables syntax.
> 
> 2) If ssh connections come in on eth0:1, we'd like to forward those
> requests on to client2 (instead of server1), and also have client2's
> replies leave through eth0:1... but ONLY if we're talking about ssh
> packets. Basically, this is 1:1 NAT for eth0:1 and server1, except for
> ssh, where we'll want to do 1:1 NAT with a differnt internal IP. The
> problem I'm having with this is how to specify the reverse route? client2
> should be masq'd by eth0, unless it's responding to ssh packets coming
> from eth0:1.
> 
> Help?
> 
> 
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO:
> http://ds9a.nl/2.4Routing/
> 


_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/

      parent reply	other threads:[~2001-05-20 18:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-19 20:17 [LARTC] masq + nat + port forwarding: can it be done? Largo Hellenz
2001-05-20  0:01 ` Ben
2001-05-20 18:24 ` Ben [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=marc-lartc-99038312722978@msgid-missing \
    --to=bench@silentmedia.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.