🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.linux
Article #193

IPTables forwarding rule

#193
From: Harry Phillips
Date: Wed, 21 Jul 2004 09:20
28 lines
2240 bytes
I have a client with a firewall device that has a limited interface to 
iptables (I cannot ssh into it either). All you can do is forward a port 
to another IP address, you can't restrict it to a certain source IP.

I have set it up to forward port 22 to my Linux box, that then has 
IPTables to accept anything local and drop everything else except my 
ADSL modem IP.

Now I want to do a similar thing except forward the packets to another 
internal host. I have no idea where to start and what rules to use. The 
setup is:

                  _____________________
                 |  (firewall device)  |     |---> |192.168.1.50|
internet <----> |ext_ip  192.168.1.254| <---|---> |192.168.1.1 |
                 |_____________________|     |---> |192.168.1.x |


I want the Linux box (192.168.1.1) to forward port x to 192.168.1.50, 
but only if the source is my ADSL modem IP.

Do I use the NAT and PREROUTING, POSTROUTING, FORWARD? I have examples 
from the Internet if the Linux box and the host it is forwarding to are 
on different networks but not when they are on the same network.

-- 
Regards,
Harry Phillips
Technical Details
Message-ID: <i7p1t1-n1u.ln1@free.teranews.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!cyclone1.gnilink.net!gnilink.net!chi1.usenetserver.com!news.usenetserver.com!newsfeed-east.nntpserver.com!nntpserver.com!cyclops.nntpserver.com.POSTED!afbe4e3b!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 100c5f,366e92497eb0b79a,start
X-Google-Thread: faa64,366e92497eb0b79a,start
X-Google-Thread: f9382,366e92497eb0b79a,start
X-Google-Thread: 102983,366e92497eb0b79a,start
X-Google-Attributes: gid100c5f,gidfaa64,gidf9382,gid102983,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!cyclone1.gnilink.net!gnilink.net!chi1.usenetserver.com!news.usenetserver.com!newsfeed-east.nntpserver.com!nntpserver.com!cyclops.nntpserver.com.POSTED!afbe4e3b!not-for-mail
From: Harry Phillips <harry@hkjsfh.com>
User-Agent: Mozilla Thunderbird 0.7.1 (X11/20040629)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: alt.linux,alt.os.linux,comp.os.linux,aus.computers.linux
Subject: IPTables forwarding rule
X-Enigmail-Version: 0.84.2.0
X-Enigmail-Supports: pgp-inline, pgp-mime
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <i7p1t1-n1u.ln1@free.teranews.com>
Lines: 28
NNTP-Posting-Date: Wed, 21 Jul 2004 04:58:56 EST
Date: Wed, 21 Jul 2004 19:20:34 +1000