LinuxQuestions.org
Review your favorite Linux distribution.
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 03-29-2002, 07:15 AM   #1
lfabiani
LQ Newbie
 
Registered: Mar 2002
Posts: 4

Rep: Reputation: 0
Question Port forwarding and remote X11 sessions


Hello!

I have the following situation: I have a DIGITAL WorkStation that runs True64 unix. I have a linux box that is a server to a private LAN (this box is the gateway)

I am trying to setup port forwarding so that clients from the private LAN could run programs from the DIGITAL box (like Fluent, emacs, etc...)


What I did was the following:
I've set up iptables on my linux box, and ip forwarding works fine.
Then I've tried to do a port forwarding of port 6001 to a 192.168.0.3 IP.

then on the .0.3 client I typed
xhost +

Then on my digital box I've typed
DISPLAY=myip:1.0 (where myip is the IP of the gateway)
export DISPLAY

then I ran emacs, but nothing happened....

What should I do??
 
Old 03-29-2002, 04:14 PM   #2
Sixpax
Member
 
Registered: Mar 2002
Distribution: Mandrake 8.1
Posts: 386

Rep: Reputation: 31
You need to somehow verify that the port forwarding is working. What you might want to do is setup some simple service like FTP on the DIGITAL machine and do port forwarding on the Linux gateway to port 21. Then see if that works.
 
Old 03-30-2002, 03:19 PM   #3
lfabiani
LQ Newbie
 
Registered: Mar 2002
Posts: 4

Original Poster
Rep: Reputation: 0
Hi!

Thank you for your answer

OK, I will test it...

But the ports of X sessions are correct? (6000 or up, depending on the DISPLAY=...)
 
Old 03-30-2002, 07:32 PM   #4
Sixpax
Member
 
Registered: Mar 2002
Distribution: Mandrake 8.1
Posts: 386

Rep: Reputation: 31
Yes, 6000+DISPLAY are the ports X listens on.
 
Old 03-31-2002, 07:26 AM   #5
lfabiani
LQ Newbie
 
Registered: Mar 2002
Posts: 4

Original Poster
Rep: Reputation: 0
OK, this is what I found:

Port forwarding is OK (I forwarded port 26 of the gateway to the 23 of the client and was able to telnet the client from other machines)

On the linux gateway I do, after setting up iptables with the rc.firewall script, that I got from a HOW-TO:

/sbin/iptables -A FORWARD -i eth1 -o eth0 -p tcp --dport 6001 -j ACCEPT
/sbin/iptables -A PREROUTING -t nat -p tcp -d linux_gateway_ip --dport 6001 -j DNAT --to 192.168.0.3:6001

On the client machine I do a:

xhost +


On the DIGITAL computer I do a:

DISPLAY=linux_gateway_ip:1.0
export DISPLAY
emacs &


The emacs proccess lasts a minute or so, and I guess it is trying to connect without success... Then it displays a error message:
"Error: Can open display: ..."

Since port forwarding works (I tested it with telnet), and the proccess doesn't die immediatly, I think that I'm missing something....
 
Old 03-31-2002, 11:21 AM   #6
Sixpax
Member
 
Registered: Mar 2002
Distribution: Mandrake 8.1
Posts: 386

Rep: Reputation: 31
Ok, I'm missing a few things in your configuration myself...

First of all, what type of machine is that .0.3 client? and how did you set it up to listen on port 6001? Normally X listens on port 6000 unless you start another X session or do some funkiness.
 
Old 04-01-2002, 06:11 AM   #7
lfabiani
LQ Newbie
 
Registered: Mar 2002
Posts: 4

Original Poster
Rep: Reputation: 0
The 192.168.0.3 is a Red Hat linux.

I didn't set up X to listen to 6001 port.... I thought it would automatically.....

Ok so if I just redirect port 6001 on the gateway to port 6000 to the red hat client, it should be ok ???
 
  


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
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 12:08 PM
Forwarding ONE port to remote machine supertrout Linux - Networking 2 12-14-2004 10:02 PM
Remote Port Forwarding Question juxstapose Linux - Networking 1 08-01-2004 12:32 PM
Remote sessions narkelo Linux - Software 2 04-03-2004 10:33 PM

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

All times are GMT -5. The time now is 04:32 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