Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
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.
i have 2 server that sitting under the same subnet (in the hosting) and i have for both private IP and public IP.
the etc0 using for public IP and etc1 for private IP.
of-course, the servers can interact (via SSH etc.) each-other with the private IP.
now, i need the following settings on my firewall/ipatables:
server 1:
1. port 80, open for private and public.
2. port 22, open for private and public.
server 2:
1. port 22, open for private and public. 2. port 3306, open for private only.
the server 1 already configured and work fine, my problem is with server 2.
if tried to use the "system-config-securelevel" for setting the firewall to do those rules but i can't separate between the interfaces (etc0 and etc1), mean, if i'm checking the both interfaces and then checking port 22 + custom port 3306:tcp, once i did it the port 3306 will open to public also, and if i'm checking the etc0 only, the port 22 will be close to public.
how can i make the 22 port open to public and port 3306 open to private only?
do i need to edit manually the file /etc/sysconfig/iptables? if i need to do that, what settings shall be there? can someone write me those rules please?
i read the CentOs5 document about iptables but i can't figure out how to do that and if I'll have some mistake i can lock my-self out from the server and start deal with the hosting.. etc.. etc..
i have 2 server that sitting under the same subnet (in the hosting) and i have for both private IP and public IP.
the etc0 using for public IP and etc1 for private IP.
of-course, the servers can interact (via SSH etc.) each-other with the private IP.
now, i need the following settings on my firewall/ipatables:
server 1:
1. port 80, open for private and public.
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
2. port 22, open for private and public.
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
server 2:
1. port 22, open for private and public.
iptables -I INPUT -p tcp --dport 22 -j ACCEPT
2. port 3306, open for private only.
iptables -I INPUT -p tcp -i eth1 --dport -j ACCEPT
Quote:
Originally Posted by shlomi.s
the server 1 already configured and work fine, my problem is with server 2.
if tried to use the "system-config-securelevel" for setting the firewall to do those rules but i can't separate between the interfaces (etc0 and etc1), mean, if i'm checking the both interfaces and then checking port 22 + custom port 3306:tcp, once i did it the port 3306 will open to public also, and if i'm checking the etc0 only, the port 22 will be close to public.
how can i make the 22 port open to public and port 3306 open to private only?
do i need to edit manually the file /etc/sysconfig/iptables? if i need to do that, what settings shall be there? can someone write me those rules please?
you can do it this way, but this is an easy way to break iptables.
Quote:
Originally Posted by shlomi.s
i read the CentOs5 document about iptables but i can't figure out how to do that and if I'll have some mistake i can lock my-self out from the server and start deal with the hosting.. etc.. etc..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.