Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Ip Tables Help!, Port Forwarding
gcm
post Apr 18 2005, 11:13 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 1
Joined: 18-April 05
Member No.: 4,891



Hi,
I have a linux router setup and I want to forward all requests on 3389 (terminal server) to an internal IP address.

This is what i have so far, but it doesn't work, I get the "Client cound not connect to the remote computer" when I try.
******************************************************************************

$IPTABLES -A INPUT -i $EXTIF -p tcp --sport 3389 -j ACCEPT
$IPTABLES -A OUTPUT -o $INTIF -p tcp --sport 3389 -j ACCEPT
$IPTABLES -t nat -A PREROUTING -p tcp -i $EXTIF -d $EXTIF --dport 3389 -j DNAT --to 192.168.0.194:3389
$IPTABLES -A FORWARD -p tcp -i $EXTIF -d 192.168.0.194 --dport 3389 -j ACCEPT


******************************************************************************
$EXTIF = External Interface
$INTIF = Internal Interface (192.168.0.1)
Target computer for Terminal Server = 192.168.0.194

Can someone please tell me what I need to do to get this working?
Go to the top of the page
 
+Quote Post
Robert83
post Apr 19 2005, 02:34 AM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Hi,

this is how mine looks like, I'm allowing a remote client to use ultravnc to connect to one of my internal servers....

xxx.xxx.xxx.xxx = remote public ip address
yyy.yyy.yyy.yyy = firewall internal ip address
192.168.2.10 = server running ultravnc on port 5900

iptables -A FORWARD -i eth1 -s xxx.xxx.xxx.xxx -d yyy.yyy.yyy.yyy -p tcp --dport 5900 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -d yyy.yyy.yyy.yyy --dport 5900 -j DNAT --to 192.168.2.10:5900

I hope this helps, and I hope that I wrote this down correctly smile.gif

Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd October 2017 - 07:48 PM