From: George Esperanza <george_esperanza@yahoo.com>
To: netfilter@lists.netfilter.org
Subject: Port Forwarding Problem
Date: Sun, 17 Jul 2005 22:17:37 -0700 (PDT) [thread overview]
Message-ID: <20050718051737.46295.qmail@web31512.mail.mud.yahoo.com> (raw)
Hello everyone!
I have just installed a Slackware Linux 10.1 as my
firewall and my Internet gateway and i have a Web
server inside my private Network. I'm trying to test
if i can forward all incoming http request to my Web
server. I've found a simple script and modified it
to work for my IP settings, but its not working. I've
been searching this for almost 2 days now and still
can't make it to work.
I have Slackware 9.0 with iptables scripts (running at
home) that has forwarding rules which is working
perfectly. I tried that script too in Slackware 10.1
but still not working.
Please help...
George
Here's my script:
#!/bin/sh
IPTPATH="/usr/sbin/iptables"
/sbin/modprobe ip_conntrack
/sbin/modprobe iptable_filter
/sbin/modprobe iptable_mangle
/sbin/modprobe iptable_nat
/sbin/modprobe ipt_MASQUERADE
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ip_conntrack_ftp
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/tcp_syncookies
echo "1" >
/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
echo "0" >
/proc/sys/net/ipv4/conf/all/accept_source_route
echo "1" >
/proc/sys/net/ipv4/conf/all/secure_redirects
echo "1" > /proc/sys/net/ipv4/conf/all/log_martians
$IPT -P INPUT DROP
$IPT -P OUTPUT DROP
$IPT -P FORWARD DROP
$IPT -A INPUT -i lo -j ACCEPT
$IPT -A INPUT -m state --state INVALID -j DROP
$IPT -A OUTPUT -m state --state INVALID -j DROP
$IPT -A FORWARD -m state --state INVALID -j DROP
$IPT -A INPUT -m state --state ESTABLISHED,RELATED -j
ACCEPT
$IPT -A OUTPUT -m state --state ESTABLISHED,RELATED -j
ACCEPT
$IPT -A FORWARD -m state --state ESTABLISHED,RELATED
-j ACCEPT
# eth0 - internal network
# eth1 - external network (with static IP)
$IPT -A OUTPUT -d 0/0 -m state --state NEW -p tcp -m
multiport \
--dport 80,443 -o eth1 -j ACCEPT
$IPT -A FORWARD -d 0/0 -m state --state NEW -p tcp -m
multiport \
--dport 80,443 -o eth1 -i eth0 -j ACCEPT
$IPT -A OUTPUT -o eth1 -j LOG
$IPT -A FORWARD -j LOG
$IPT -t nat -A POSTROUTING -o eth1 -j SNAT --to
X.X.X.X
$IPT -t nat -A PREROUTING -i eth1 -p tcp -d X.X.X.X
--dport 80 -j DNAT \
--to 192.168.0.10:80
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
next reply other threads:[~2005-07-18 5:17 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-18 5:17 George Esperanza [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-10-16 12:53 Port forwarding problem Carlos Mtz-Troncoso
2010-10-16 13:13 ` Pascal Hambourg
2010-10-16 13:19 ` Carlos Mtz-Troncoso
2010-10-16 13:37 ` Pascal Hambourg
2010-10-16 14:01 ` Carlos Mtz-Troncoso
2010-10-16 18:19 ` Pascal Hambourg
2008-04-24 19:17 Port Forwarding Problem Ivan Hernandez
2008-04-25 19:49 ` Grant Taylor
2005-04-15 10:36 Julian Labuschagne
2005-04-15 10:34 Julian Labuschagne
2005-04-15 8:40 ` Samuel Díaz García
2005-04-15 11:23 ` Julian Labuschagne
2005-04-15 14:32 ` Taylor, Grant
2005-04-15 14:40 ` Jason Opperisano
2003-02-25 18:06 Tom Smith
2003-02-25 20:14 ` Willi Dyck
2003-02-25 21:53 ` Tom Smith
2003-02-26 3:20 ` Arnt Karlsen
[not found] ` <3E5C3DEE.70104@openadventures.org>
2003-02-26 14:07 ` Arnt Karlsen
[not found] <001601c2d1fa$669894e0$990da8c0@..153.service>
2003-02-11 19:11 ` Port forwarding problem DarKRaveR
2003-02-11 19:14 ` Rob Sterenborg
2003-02-11 18:21 Danila Octavian
2003-01-29 0:56 port " Ian McBeth
2003-01-28 8:14 oarojo
2003-01-29 1:21 ` Arnt Karlsen
2002-11-14 4:29 Port " Tom Elsesser
2002-11-24 20:40 ` Joel Newkirk
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=20050718051737.46295.qmail@web31512.mail.mud.yahoo.com \
--to=george_esperanza@yahoo.com \
--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