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 03-28-2004, 12:13 AM   #1
d0ugb
LQ Newbie
 
Registered: Sep 2002
Posts: 9

Rep: Reputation: 0
Question Port Forwarding Help


Okay, i have asked this questions before and gotten a few answers but for some reason i can never get this to work, and im sure its just something very small and stupid im leaving out but if someone could let me know what to do i would really be grateful.

I have a linux box running suse 9.1 pro, im using a basic firewall to route the internet around my home, i run a webcam server on one of my pc's on port 8080. This program posts the video in a webserver type environment when ever u access the server, i would like people to be able to access it by opening up thier web browser and typing whatever.com:8080. This is what my firewall consists of...

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth0 -j ACCEPT

Now in previous posts i have gotten these two options as a solution, but it doesnt seem to work. BTW, im using dhcpd as a dhcp server, however my windows box with the webcam serevr is running a static ip. Here is the advice i recieved in a previous post
-------------------
iptables -A FORWARD -p tcp -i ethX -d your.int.ip.addy --dport 8080 -j ACCEPT

iptables -t nat -A PREROUTING -p tcp -i ethX --dport 1256 -j DNAT --to-destination your.int.ip.addy:8080

Replace ethX with your external/public device and your.int.ip.addy with the address of your windows box.
--------------------

If anyone can see what im doing wrong it would be very helpful.
 
Old 09-15-2004, 12:27 PM   #2
maze_fire
LQ Newbie
 
Registered: Feb 2004
Location: B'ham, AL
Distribution: RH9 - Shrike
Posts: 25

Rep: Reputation: 15
i ran across your post, even though it was posted a few months ago, if you haven't found a solution, here's what worked for me... i have the basic port forwarding iptables arguments as follows (btw, eth0 is internet nic);

iptables -F -t nat

iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE

echo 1 > /proc/sys/net/ipv4/ip_forward


now for port forwarding i am using;

iptables -t nat -A PREROUTING -p TCP --dport 5901 -j DNAT --to-destination 10.0.0.100:5901


ofcourse, change the type of protocol you're using to either tcp or udp, the port number to be forwarded and the ip address local to your lan:local port number.... i am using rh9 box as router/dhcp server (no squid) and everything works perfect for me...hopefully this will help you out...

Last edited by maze_fire; 09-15-2004 at 12:28 PM.
 
  


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
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
Port 80 forwarding to port 22 with iptables zahoo Linux - Networking 3 02-22-2005 07:22 AM
port forwarding and packet forwarding syrtsardo Linux - Newbie 2 07-03-2003 10:37 AM
How to do ip port forwarding cmardhekar Linux - General 0 08-28-2001 12:49 AM

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

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