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 have been trying to get a computer behind my NAT linux box to become a 'DMZ' node (DMZ as in a node that is virtually associated to the internet source ip; all incoming requests are forwarded to the DMZ computer from the NAT box). Linksys routers have this setting (that is where I adopted the DMZ term).
If you've followed me so far, I accomplished this easily with the following IPTABLES entry:
$IPTABLES -t nat -A PREROUTING -i eth0 -p tcp -j DNAT --to [DMZ local ip addr]
This works in terms of forwarding all requests to the DMZ node, but then I realized that it will prevent me from connecting to services on the NAT box! I then replaced the above IPTABLES entry with this:
$IPTABLES -t nat -A PREROUTING -i eth0 -p tcp --dport ! 3784 -j DNAT --to[DMZ ip]
This checks for the destination port, and if it is 3784 (one of my services on the nat box) then it does not forward it to the dmz.
Well, it works fine and everything is great but then I realized what this setup entails. I will need to write additional IPTABLES entries for every service that I want to run on the nat box so that they are not mistakenly forwarded to the dmz. (i don't plan on moving the services to the dmz).
Also, I realized that if I have two services, one on the dmz and one on the nat box, that are listening on the same ports, my current IPTABLES entries will not work. However, the linkysys routers have the ability to accept port 80 connections (for the web-configuration utility) and also send port 80 requests to a dmz if it ALSO has a port 80 web server!! How is this possible?
I am curious if anyone knows of a better IPTABLES configuration that would solve all this. In case you havn't figured out already, I am using masquerading, etc for the NAT functionality. Is there an easier way to have two nodes share "outside" access of the internet IP? Any suggestions would be appreciated. I am a very big newbie when it comes to IPTABLES in the first place, so don't assume I know the advanced configurations. Let me know what's up! Thanks!