LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-05-2005, 02:57 AM   #1
gontarski
LQ Newbie
 
Registered: Mar 2005
Posts: 5

Rep: Reputation: 0
iptables and remote desktop


I need to get access to remote desktop (port 3389) on an xp machine which is behind a linux iptables firewall. The two rules I used:

iptables -A FORWARD -i eth1 -o eth0 -p tcp --dport 3389 -d 192.168.1.251 -j ACCEPT

iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 3389 -j DNAT --to 192.168.1.251:3389

and ip_forward is enabled
cat /proc/sys/net/ipv4/ip_forward
1

But I had no sucess. Can someone please help me.

Bellow I am sending iptables -vnL and iptables -t nat -vnL (to make everyhing easier the above stated two rules are the only ones I entered into iptables)

iptables -vnL
Chain INPUT (policy ACCEPT 111 packets, 10247 bytes)
pkts bytes target prot opt in out source destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT tcp -- eth1 eth0 0.0.0.0/0 192.168.1.251 tcp dpt:3389

Chain OUTPUT (policy ACCEPT 115 packets, 9888 bytes)
pkts bytes target prot opt in out source destination

iptables -t nat -vnL
Chain PREROUTING (policy ACCEPT 4 packets, 634 bytes)
pkts bytes target prot opt in out source destination
0 0 DNAT tcp -- eth1 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:3389 to:192.168.1.251:3389

Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
 
Old 04-05-2005, 07:59 AM   #2
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Does the WinXP machine uses the Linux box as its default gateway?
 
Old 04-05-2005, 11:28 AM   #3
SirGertrude
Member
 
Registered: May 2004
Location: Missouri
Distribution: Gentoo
Posts: 59

Rep: Reputation: 15
Try this:

Code:
iptables -A FORWARD -j ACCEPT -p tcp --dport 3389
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 3389 -j DNAT --to 192.168.1.251
 
Old 04-05-2005, 06:15 PM   #4
angrybeaver
Member
 
Registered: Aug 2004
Location: .au
Distribution: debian, BSD
Posts: 104

Rep: Reputation: 17
What's your default FORWARD policy? If its DROP, you will need a forward rules like so :

iptables -A FORWARD -j ACCEPT -p tcp --dport 3389
iptables -A FORWARD -j ACCEPT -p tcp --sport 3389

However, if you've implemented a state match forwarding rule ...

iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT

then you will only need the ---dport 3389 FORWARD and PREROUTING rules as SirGertrude mentioned. You can always run up tcpdump or tethereal on your ethernet adapters to see how the packets are flowing betwen interfaces if you get stuck.
 
  


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
Remote desktop software to control desktop GUI? Phaethar Linux - Software 3 06-27-2008 09:30 AM
iptables and remote desktop in fedora 3 lucas4ever Linux - Security 3 01-06-2005 02:37 AM
fordwarding remote desktop through iptables dlm4444 Linux - Security 4 01-04-2005 09:30 PM
how to remote using iptables from outside dadi Linux - Networking 3 07-10-2004 10:58 AM
Iptables Need It To Route To A Windows Machine For Remote Desktop sal_paradise42 Linux - General 2 11-11-2003 08:20 PM

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

All times are GMT -5. The time now is 10:20 AM.

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