Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hi all, I am very close to finishing a little router/firewall project I am running, but just need a little help.
I have set up a RH 9 machine with two NIC's one configured on our public "real-ip" network and one on our secure netork.
Now, I have configured a DHCP server for the private network...that is fine.......I found a post describing how to set up iptables to route all traffic through from the secure network out onto the internet, but it is wide open. What I want to know is how do I set up iptables to allow users on the secure network to access the web (ristricted access if possible) and lock down the linux machine with the possible execption of the SSH and HTTP ports (for example).
iptables allows you to block ports and track connection.
First of all, you should set the FORWARD chain to drop
Code:
iptables -P FORWARD DROP
and use the following rules to allow related connection.
Code:
iptables -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
Also, you should not use Lokkit (RedHat's GUI tool), it is not very good.
Instead, you can learn more about iptables from the documentation and tutorials from netfilter. http://www.netfilter.org/
No offence dude but I gringe when I see the default policy's of aceppt as so many here probably do too.
Mathieu gave you a setup for masquerading which can be added to already dubious rules and ppuru gave you a hint towards access control. Everyone one would love to help you and in the blink of an eye could give you the exact procedures to do what you want to do, but you'll only be back five minutes later asking something else becauses you don't know why what you did works.
As we can see it starts off with how can I share a connection, someone says how to, cool that works, next question how do I open ports etc. and so on....
The old adage Rome wasn't built in a day rings true, no personal slight to you but I've observed so many people demanding without any effort on their own part - relax which so many people forget to do, take one task at a time and before you know it you'll be telling people how to do this and that. The best way to do something right is to do it wrong in the first place.
It's no personal observation on yourself particularly, just a general one, so please don't take offence
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.