View Single Post
  #3  
Old 21st April 2008, 09:19
jacobhenry jacobhenry is offline
Member
 
Join Date: Feb 2006
Posts: 45
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I am now having difficulties with the iptables discussed on the last page of the tutorial. What I need to do is forward all requests on port 3306 to my sql server. Right now this is what I have in /etc/network/if-up.d/iptables

Code:
#!/bin/sh

### Port Forwarding ###
iptables -A PREROUTING -t nat -p tcp -i eth0 --dport 3306 -j DNAT --to 10.0.0.2:3306
Even with these settings I am not able to connect to my sql server with a client. Here is the output of iptables -L:

Code:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     0    --  api.scratchco.com    anywhere            PHYSDEV match --physdev-in vif1.0 
ACCEPT     udp  --  anywhere             anywhere            PHYSDEV match --physdev-in vif1.0 udp spt:bootpc dpt:bootps 
ACCEPT     0    --  svn.scratchco.com    anywhere            PHYSDEV match --physdev-in vif2.0 
ACCEPT     udp  --  anywhere             anywhere            PHYSDEV match --physdev-in vif2.0 udp spt:bootpc dpt:bootps 
ACCEPT     0    --  mysql.scratchco.com  anywhere            PHYSDEV match --physdev-in vif4.0 
ACCEPT     udp  --  anywhere             anywhere            PHYSDEV match --physdev-in vif4.0 udp spt:bootpc dpt:bootps 
ACCEPT     0    --  hudson.scratchco.com  anywhere            PHYSDEV match --physdev-in vif5.0 
ACCEPT     udp  --  anywhere             anywhere            PHYSDEV match --physdev-in vif5.0 udp spt:bootpc dpt:bootps 

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Any suggestions?
Reply With Quote