LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-18-2002, 08:45 PM   #1
68javelin
LQ Newbie
 
Registered: Nov 2002
Location: US of A
Posts: 2

Rep: Reputation: 0
Unhappy port forwarding


Hi everyone. I posted this same message to the Software forum but never gotten any suggestions. Maybe Networking, this forum, is more suitable.

I have a web server behind a linux firewall. I can't get to it from the internet. When I enter my URL, say www.foo.com, it returns an error "The page cannot be displayed"

Following is a simple diagram(might not display correctly) of what I'm trying to do:
............
.Internet.
............
|
| 24.111.111.111
_____|_________
| firewall | 80 |
|-----------------------|
| HTTP | 8099 |
-----------|------------
| 192.168.1.1
|
--------|-------|-------
|
| 192.168.1.2
------|-----
| WWW | (my webserver)
------------

Following is my port forwarding rule:
Proto: TCP
Source Port: 80
Destination IP: 192.168.1.2
Destination Port: 80

If I run an ipchains -C (to test rules), with corresponding IP source/destination and port 80, it says "accepted". This means that my network is open for incoming(internet) request through port 80.

From my firewall, I'm able to ping say, yahoo.com, and to my 24.111.111.111 from the internet.

From my 192.168.1.1 network, I'm able to get to my webserver either through its IP address or FQDN. But when I'm in the internet, I can't get to my webserver.

What am I doing wrong? I'm kinda new with linux and setting up webservers.

Any suggestion or comments are welcome.

Thanks,
Angel
 
Old 11-19-2002, 11:49 AM   #2
Syncrm
Member
 
Registered: Aug 2001
Location: Lansing, Michigan
Distribution: slackware8+
Posts: 472

Rep: Reputation: 30
i use iptables rather than ipchains (and i'd suggest you do the same, since ipchains will probably become less popular in the future), but here's how i setup port forwarding in my firewall script for my webserver (which operates on port 81 rather than 80 - thank you SOOO much comcast :-P)

/sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 81 -j DNAT --to 192.168.1.2:81

you'll have to enable IP MASQ, which it looks like you've already done. so with any luck setting up the port forwarding should be your final step. :-)
 
  


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 11:07 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