This is a discussion on require shell script within the Shell scripting forums, part of the Development/Scripting category; Dear All. I need a shell script for Linux. The scenrio is .... I have one Linux Box with two ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
Dear All.
I need a shell script for Linux. The scenrio is .... I have one Linux Box with two NIC on that on is configure for private IP and second is configure for public IP. What I want is I have one another server on LAN which is Window Server and client are connect through RDP, I need a shell script which forward ( anyone configure the Public IP they get the RDP of Windows Server ). Pls help me. Thanks. Puppen |
| Sponsored Links | ||
|
|
|
|||
|
Dear Tom.
Thanks fot reply. The sceniro ia that some remote users are connected to WIndows Server using RDP , using private leased line. If this line goes down they are not able to connect to server. I have internet connection , what i wan t is Users connect to RDP server via internet using Linux Box between them, I can not give live IP to Win Server. They must come through Linux, for that I require shell script. Win RDP uses Port 3389, but How I configure port forwarding using Linux . Quote:
|
|
||||
|
Ok so you wanna have a Windows server on your internal network that you want make available externally, you can use the -j DNAT target of the PREROUTING chain in NAT to specify a destination IP address and port where incoming packets requesting a connection to your internal service can be forwarded. For example, if you wanted to forward incoming UDP 3389 requests to your dedicated Windows Server server system at 172.31.0.5, run the following command at shell prompt (or add to your iptables script):
Enable ip forward, type following command at shell prompt: Code:
sysctl -w net.ipv4.ip_forward=1 Code:
iptables -A FORWARD -i eth1 -j ACCEPT iptables -A FORWARD -o eth1 -j ACCEPT iptables -t nat -A PREROUTING -i eth0 -p udp --dport 3389 -j DNAT --to 172.31.0.5:3389 iptables -A FORWARD -i eth0 -p udp --dport 3389 -d 172.31.0.5 -j ACCEPT Code:
Public IP -->Linux Box/Router --> Windows box 3389 --> forward to --> internal windows box 172.31.0.5 eth1 ==> assuming the firewall/gateway is assigned an internal IP address on eth1
__________________
Rocky Jr. You may have my body & soul, but you will never touch my pride! If you have knowledge, let others light their candles at it. Certified to work on HP-UX / Sun Solaris / RedHat |
|
|||
|
Dear Rocky.
Thank you very much for your reply. I am very greateful to you. The script which you have given, is bit incomplete but what ever you given is right. I added one line in that script and script is working fine. Anyway thank you very much for your support. Quote:
|
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| shell script for ftp the file | vishal_titre | Shell scripting | 3 | 12-10-2007 08:40 AM |
| writing a shell script to find out my shell name | jaymob123 | Shell scripting | 1 | 10-08-2007 12:36 AM |
| Require Shell Script Which sends all server info on mail | puppen | Linux software | 3 | 10-25-2006 08:07 PM |
| Require shell script using rsync | puppen | Shell scripting | 4 | 04-23-2006 12:52 AM |
| Shell Script dought | Mahesh | Shell scripting | 3 | 02-16-2005 12:13 PM |