LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-06-2006, 05:16 AM   #1
gugabaga
Member
 
Registered: Jan 2006
Distribution: Fedora
Posts: 61

Rep: Reputation: 15
SNAT and DNAT on same firewall machine not working


I shared my internet connection by -

iptables -F
iptables -t nat -F
iptables --delete-chain
iptables --table nat --delete-chain

iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT

Where eth0 is the internet connected nic and eth1 is the LAN nic.
Internet connection sharing is working fine.

Now I want to use DNAT on my static ip and redirect all trafic on port 1433 (ms-sql-s) to 192.168.127.1

I tried the following iptables statement -

iptables -t nat -A PREROUTING --dst XXX.XXX.XXX.XXX -p tcp --dport 1433 -j DNAT --to-destination 192.168.127.1

But it is not working.

Can anyone help.
 
Old 02-06-2006, 06:08 AM   #2
okmyx
Member
 
Registered: May 2004
Location: Cornwall, UK
Distribution: Ubuntu 8.04
Posts: 464

Rep: Reputation: 31
Not working as in the destination translation is'nt working or not working as in the attempt to connection from a client failed.

If the client failed to connect then you might need to open port 1434 UDP as well (not sure but found it on a website somewhere).
 
Old 02-06-2006, 06:25 AM   #3
gugabaga
Member
 
Registered: Jan 2006
Distribution: Fedora
Posts: 61

Original Poster
Rep: Reputation: 15
Thanks for your reply.

The package that access the MS SQL DB is Matrix. It is unable to connect to the database located in 192.168.127.1 while being routed through our firewall which has a static ip address.

I used the iptables statement as given above.

I might point out again that my internet connection through this static ip address which is shared through my internal lan card is working just fine.

Only when I try from outside my local area network that the sql connection error stating so and so database could not be located is encountered.

Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPTABLES DNAT SNAT Re-Addressing jccurtis Linux - Networking 1 01-03-2006 04:41 PM
MASQUERADE vs. DNAT/SNAT Palula Linux - Networking 9 08-12-2005 10:23 AM
IPTables: DNAT, SNAT and Masquerading tarballed Linux - Security 3 12-10-2004 03:45 PM
[MS Direct Play DNAT SNAT] MrGreg Linux - Networking 2 06-09-2002 06:58 PM
IPTables - DNAT, SNAT, port forwarding FunkFlex Linux - Security 2 01-15-2002 07:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration