Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I am trying to configure port forwarding on my server running Redhat 7.3. The idea is to forward requests to xxxx:8080 to 192.168.3.1:80. (xxxx is the static IP I have.) It works fine if I try to connect to xxxx:8080 from a computer outside of my LAN, but DOESN'T WORK inside my LAN. Of course, I can use 192.168.3.1 to load the page, which means the problem is solely with port forwarding. I definitely need to get this working because I have IP addresses in my HTML and other files, and I can't do testing if xxxx:8080 doesn't work in my LAN.
Anyone else having the same problem with Port Forwarding of requests from $INTIF? Any advice? Did I do something wrong or is it possible to do? Thanks. My port forwarding section of iptables.sh is attached below....
//Accept connections to port 8080
iptables -A INPUT -i $EXTIF -p tcp -d $EXTIP --dport 8080 -j ACCEPT
iptables -A OUTPUT -o $EXTIF -p tcp -s $EXTIP --sport 8080 ! --syn -j ACCEPT
1. You don't need use INPUT and OUTPUT chains. Is it not true you need them for accepting the packet sent to port 8080.
This is the big difference between ipchains & iptables. (with ipchains you need them).
2. Regarding your problem.
In more complex problem there is no way to present the solution seeing only few rules.... but I'll try to decribe the problem you probably met.
I assume you are using the box as router so somewhere you have a rule with SNAT or MASQUERADE target. It makes the packet leaving your system to have $EXTIP as the source address. It is done independently if it is sent to the "world" IP or $EXTIP.
As a result packets sent from internal boxes to $EXTIP port 8080 leaves your router with dest ip = 192.168.3.1 but src ip = $EXTIP.
And there is no rule for forwarding packets which are coming back (they are sent to $EXTIP!)