From: "Mark E. Donaldson" <markee@bandwidthco.com>
To: 'adburne' <adburne@asocmedrosario.com.ar>, netfilter@lists.netfilter.org
Subject: RE: NAT & MySQL
Date: Tue, 25 Nov 2003 11:23:48 -0800 [thread overview]
Message-ID: <200311251923.hAPJNpiu001203@server5.bandwidthco.com> (raw)
In-Reply-To: <3FC3485C.000009.00204@adburne>
[-- Attachment #1.1: Type: text/plain, Size: 3018 bytes --]
The ACK packets you see in your dump are probably being dropped at the
firewall because a state table entry does not exist. So you need to add a
NEW rule to do this:
iptables -A FORWARD -i ppp0 -o eth0 -m state --state NEW -j ACCEPT
this rule will then allow your ESTABLISHED,RELATED rule to work and permit
those ACK packets to pass.
_____
From: netfilter-admin@lists.netfilter.org
[mailto:netfilter-admin@lists.netfilter.org] On Behalf Of adburne
Sent: Tuesday, November 25, 2003 4:18 AM
To: netfilter@lists.netfilter.org
Subject: NAT & MySQL
Someone can make NAT with mysql? I've tried for a long time without make it
work.
My natural language is spanish, sorry by mistakes writing in english.
This is the situation:
I've have a linux box as gateway between my lan and internet routing paquets
without problems, I need access from internet another linux box running
apache and mysql on my private lan.
To do this work I try to use nat; with apache all works ok, but with mysql
can't connect. I'll be looking on different network devices using tcpdump to
find what's wrong.
This is what tcpdump show on device eth0 on my mysql server (inside the
lan), there is a petition from 200.10.10.1 (internet client) to 192.168.0.80
(mysql lan server), this reply with ack, but internet client don't
reply. Any clue? =)
200.10.10.1.56405 > 192.168.0.80.3306: S 2205542765:2205542765(0) win 5840
<mss
1412,sackOK,timestamp 620645629 0,nop,wscale 0> (DF)
192.168.0.80.3306 > 200.10.10.1.56405: S 2497023396:2497023396(0) ack
2205542766
win 5792 <mss 1460,sackOK,timestamp 95764658 620645629,nop,wscale 0> (DF)
200.10.10.1.56405 > 192.168.0.80.3306: R 2205542766:2205542766(0) win 0 (DF)
200.10.10.1.56405 > 192.168.0.80.3306: S 2205542765:2205542765(0) win 5840
<mss
1412,sackOK,timestamp 620648701 0,nop,wscale 0> (DF)
192.168.0.80.3306 > 200.10.10.1.56405: S 2503023731:2503023731(0) ack
2205542766
win 5792 <mss 1460,sackOK,timestamp 95765258 620648701,nop,wscale 0> (DF)
200.10.10.1.56405 > 192.168.0.80.3306: R 2205542766:2205542766(0) win 0 (DF)
The forward rules on the gateway are:
# "Accept forward all connections to port 3306 on ppp0"
iptables -A FORWARD -p tcp -i ppp0 --dport 3306 -o eth0 -j ACCEPT
# "All stablished connections are ok"
iptables -A FORWARD -i ppp0 -o eth0 -m state --state ESTABLISHED,RELATED -j
ACCEPT
# "All connection from inside to outside are accepted"
iptables -A FORWARD -i eth0 -o ppp0 -j ACCEPT
# "Rest go away"
iptables -A FORWARD -j REJECT
NAT rule:
iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 3306 -j DNAT --to
192.168.0.80 -s 200.10.10.1
If someone can make the light turn on, thanks!!!!
Alejandro
_________________________________________________________________
<http://www.incredimail.com/redir.asp?ad_id=310&lang=10> IncrediMail - El
E-mail ha evolucionado finalmente -
<http://www.incredimail.com/redir.asp?ad_id=310&lang=10> Haga clic aquí
[-- Attachment #1.2: Type: text/html, Size: 6130 bytes --]
[-- Attachment #2: IMSTP.gif --]
[-- Type: image/gif, Size: 494 bytes --]
next prev parent reply other threads:[~2003-11-25 19:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-25 12:17 NAT & MySQL adburne
2003-11-25 17:19 ` Jeffrey Laramie
2003-11-25 19:23 ` Mark E. Donaldson [this message]
2003-11-25 21:24 ` Jeffrey Laramie
2003-11-26 2:56 ` Mark E. Donaldson
2003-11-26 3:38 ` Jeffrey Laramie
2003-11-27 14:50 ` adburne
[not found] <3FC4EDAA.6080009@Loudoun-Fairfax.com>
2003-11-27 12:22 ` Alejandro D. Burne
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=200311251923.hAPJNpiu001203@server5.bandwidthco.com \
--to=markee@bandwidthco.com \
--cc=adburne@asocmedrosario.com.ar \
--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 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.