LinuxQuestions.org
Review your favorite Linux distribution.
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 11-04-2003, 06:37 PM   #1
Jimbobbob
LQ Newbie
 
Registered: Mar 2003
Location: Canada
Distribution: Arch Linux 0.7
Posts: 19

Rep: Reputation: 0
Some IPTables help... forwarding if a specific IP


My goal is to get iptables to forward incoming port 80 to 5801, but only if the incoming IP address is a certain one.

My school computers block everything except port 80 and 443 (https), and i want to use the web based vnc client there, but i would like my webserver to be available everywhere else. (i would also like ssh, which i could forward from 443 to 22)

Is this even possible?

or better yet, anything that would forward domain.com/vnc to domain.com:5801 and domain.com/ssh to domain.com:22

Thanks for any help you can provide

(keep in mind i am completely new to iptables)
 
Old 11-04-2003, 10:21 PM   #2
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
The following is a snippet from the http://projectfiles.com/firewall/config.html

Quote:
PORT_FORWARDS - {List} This directive intelligently forwards connections received on a specific port to a specified host and port. If PORT_FWD_ALL below is disabled, the PERMIT option can be used to allow access to a port forwarding definition. If no protocol is specified, then it is assumed that connections of either protocol should be forwarded. If the destination ports are missing, the inbound port number will not be modified.
Format:[<protocol>:]<inbound port or port-range>:<destination host>[:<destination port or port-range>]
Examples:
PORT_FORWARDS="53:192.168.0.11" Forward incoming connections on port 53 to 192.168.0.11
PORT_FORWARDS="tcp:8080-8090:192.168.0.10:80" Forward incoming tcp connections ports 8080 through 8090 to 192.168.0.10 port 80
It is close to what you want but it doesn't seem to have the option to forward by source-host:port to dest-host:port.

Last edited by /bin/bash; 11-04-2003 at 10:23 PM.
 
Old 11-05-2003, 08:44 AM   #3
Jimbobbob
LQ Newbie
 
Registered: Mar 2003
Location: Canada
Distribution: Arch Linux 0.7
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks. i may just have to run both vnc and ssh on ports 80 and 443 entirely. *sigh* forget webserver, unless i want to run that on a diff port...
 
  


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
ssh forwarding : bind to a specific interface flupke Linux - Networking 9 12-09-2011 05:24 PM
forwarding a specific port from eth0 to eth1 zovres Linux - Networking 2 05-02-2006 10:01 PM
drop packets for specific port with iptables ohcarol Linux - Security 1 07-03-2005 10:48 AM
iptables: blocking something.com for specific time farhan Linux - Security 2 06-11-2005 10:15 AM
Allow specific hosts with iptables (jay's firewall) TheOneAndOnlySM Linux - Networking 2 04-04-2004 06:52 PM

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

All times are GMT -5. The time now is 11:45 PM.

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