Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: Junus Junarto D junusj@telkom.net
To: lartc@vger.kernel.org
Subject: [LARTC] routing
Date: Fri, 05 Jan 2001 12:25:42 +0000	[thread overview]
Message-ID: <marc-lartc-98373940416822@msgid-missing> (raw)
In-Reply-To: <marc-lartc-98373940416816@msgid-missing>

<PRE>You could do it with kernel 2.2 without port assignment too:
You can keep to use your ordinary maquerade and add two line of commands
below :

Make IP NAT:
- ip rule add from 192.168.0.5/32 nat 194.219.85.4
(to make NAT a subnetwork form 192.168.0.4 - 192.168.0.7 just change prefik
to 30:
- ip rule add from 192.168.0.4/30 nat 194.219.85.4)


Add IP aliasing 194.219.85.4 to interface with real address: (e.g: eth0)
- ifconfig eth0:0 194.219.85.4 netmask 255.255.255.0
( or use IP command:
- ip addr add 194.219.85.4 /24 dev eth0 )

Note: you must active advance networking option at linux kernel
configuration before use ip command.

Regards,
Junus Junarto D


&gt;<i> --__--__--
</I>&gt;<i>
</I>&gt;<i> Date: Wed, 03 Jan 2001 07:37:31 -0500
</I>&gt;<i> From: &quot;David A. Bandel&quot; &lt;<A HREF="mailto:david@pananix.com">david@pananix.com</A>&gt;
</I>&gt;<i> Organization: Pananix, S.A.
</I>&gt;<i> To: Spyros Dimas &lt;<A HREF="mailto:spyros@liaison.gr">spyros@liaison.gr</A>&gt;
</I>&gt;<i> Cc: <A HREF="mailto:lartc@mailman.ds9a.nl">lartc@mailman.ds9a.nl</A>
</I>&gt;<i> Subject: Re: [LARTC] routing
</I>&gt;<i>
</I>&gt;<i> Spyros Dimas wrote:
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; Hello and Happy New Year!
</I>&gt;<i> &gt; We have a LAN with 2 interfaces. One is configured with addresses
</I>&gt;<i> &gt; 192.168.0.x (pseudo-addresses) and other one with real addresses, so we
</I>&gt;<i> &gt; use ip-masquerade. But we would like one of workstation witch has a
</I>&gt;<i> &gt; address 192.168.0.5 to have a real address, such us 194.219.85.4, on the
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; first interface or on the second. Could you tell us how we can do it. Or
</I>&gt;<i> &gt; if you have
</I>&gt;<i> &gt; another idea. Thanks.
</I>&gt;<i>
</I>&gt;<i> This is really an issue for your firewall/masquerade software.  If you
</I>&gt;<i> are masquerading using Linux and either ipchains (2.2.x) or iptables
</I>&gt;<i> (2.4.x) it's easy.
</I>&gt;<i>
</I>&gt;<i> In either case, your firewall/masquerade server needs to have
</I>&gt;<i> 194.219.85.4 aliased on the external interface, then:
</I>&gt;<i>
</I>&gt;<i> 2.2.x:
</I>&gt;<i> get ipmasqadm and set up a portforward from the masq server to the
</I>&gt;<i> workstation. Assuming you want to forward only port 80, the following
</I>&gt;<i> will work:
</I>&gt;<i> ipmasqadm portfw -a -P tcp -L 194.219.85.4 80 -R 192.168.0.5 80
</I>&gt;<i>
</I>&gt;<i> better:
</I>&gt;<i> 2.4.x:
</I>&gt;<i> use iptables and runthe following:
</I>&gt;<i> iptables -t nat -A PREROUTING -d 194.219.85.4 -p tcp --dport 80 -j DNAT
</I>&gt;<i> --to-destination 192.168.0.5:80
</I>&gt;<i>
</I>&gt;<i> With iptables you can easily omit the port stuff so everything passes
</I>&gt;<i> (just like the workstation is on the Internet) or qualify your matches
</I>&gt;<i> with -m multiport and select several individual ports or a range (or
</I>&gt;<i> ranges) of ports.
</I>&gt;<i>
</I>&gt;<i> Ciao,
</I>&gt;<i>
</I>&gt;<i> David A. Bandel
</I>&gt;<i> --
</I>&gt;<i> Focus on the dream, not the competition.
</I>&gt;<i> -- Nemesis Racing Team motto
</I>&gt;<i> *** sent via a Linux 2.4.0-test12 system ***
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> --__--__--
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> LARTC mailing list
</I>&gt;<i> <A HREF="mailto:LARTC@mailman.ds9a.nl">LARTC@mailman.ds9a.nl</A>
</I>&gt;<i> <A HREF="http://mailman.ds9a.nl/mailman/listinfo/lartc">http://mailman.ds9a.nl/mailman/listinfo/lartc</A>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> End of LARTC Digest
</I>



</PRE>

  parent reply	other threads:[~2001-01-05 12:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-03 11:13 [LARTC] routing Spyros
2001-01-03 12:37 ` David
2001-01-05 12:25 ` Junus [this message]
2001-01-05 12:33 ` Junus
2001-07-06 14:03 ` [LARTC] Routing Dave Miller
2001-07-06 15:01 ` Arthur van Leeuwen
2001-07-06 15:18 ` Dave Miller
2001-07-07  6:33 ` Deepak singhal
2001-07-07 18:24 ` Arthur van Leeuwen
2001-07-07 18:33 ` Dave Miller
2001-07-07 18:37 ` Arthur van Leeuwen
2001-12-25  4:58 ` [LARTC] routing Daniel Wittenberg
2001-12-25 12:16 ` bert hubert
2002-10-30 12:57 ` [LARTC] Routing Jose Sebastiao Martins
2002-10-30 15:57 ` Martin A. Brown

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-98373940416822@msgid-missing \
    --to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox