LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-16-2005, 05:54 PM   #1
cutejai
LQ Newbie
 
Registered: Aug 2003
Posts: 23

Rep: Reputation: 15
a little help needed for adding nat rule


hi all.
i've got everything running now. and i want to port forward 3389 to my windows. so that i can remote access it. so how do you add this rule??

this is what i have, but it doesn't work.
----------------------------
EXTIP is my wan ip
10.0.10.2 is my windows server's ip

iptables -t nat -A PREROUTING -d $EXTIP -p TCP --dport 3389 -j DNAT --to-destination 10.0.10.2:3389

iptables -t nat -A POSTROUTING -s 10.0.10.2 -p TCP --sport 3389 -j SNAT --to-source $EXTIP
----------------------------

here is my set up
1 debian box with 2 nics acting as gateway/firewall
- nat is working fine for my whole network.
so the only problem i have is to port forward 3389 to my windows.

please help
 
Old 12-16-2005, 06:14 PM   #2
cutejai
LQ Newbie
 
Registered: Aug 2003
Posts: 23

Original Poster
Rep: Reputation: 15
don't worry about it guys. it's working fine now. my silly mistake. i just post my solution as well, in case someone having similar problem.
----------------
coz i set my default forwarding policy to drop. so ofcourse the traffic can't travel across my network.
so i just need to add
iptables -A FORWARD -p tcp -i $WAN -d 10.0.10.2 --dport 3389 -j ACCEPT

it works perfectly fine now. =)
---------------------
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Custom FDI Rule Needed - Any Help Much Appreciated rrrssssss Mandriva 0 12-03-2005 03:51 AM
NAT Rule for FTP failing raja_lucky22 Linux - Security 2 07-04-2005 10:31 PM
Issues with adding a udev rule... Ateo Linux - General 1 03-04-2005 08:02 PM
No rule to make target `/mkspecs/default/qmake.conf', needed by `Makefile'. Stop Julianus Linux - General 0 12-21-2003 07:17 AM
Verify this rule please. Iptables help needed.. Pcghost Linux - Networking 4 02-18-2003 02:46 PM


All times are GMT -5. The time now is 04:54 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration