Problem whit iptables configuration policy drop (Debian 7.2.0 x64)
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.
Problem whit iptables configuration policy drop (Debian 7.2.0 x64)
Hi, I'm new here
I'm setting up an virtual mysql server whit dropbox (whit a Bridge network configuration)
since it is a database server, I decide to set the firewall settings on policy drop, here are the settings, I'm not sure if the mysql rule is ok (i won't that only the 192.168.1.0/ network can communicate whit the database) but I'm pretty sure I've written well the ssh and http rule, but can't access (for example) at apt, or use ssh and also i can't ping the localhost, and I don't understand why since I've defined that the connection on lo are acepted
Code:
#!/bin/sh
iptables -X
iptables -F
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -A INPUT -i lo -j ACCEPT
###http
iptables -A INPUT -p tcp --dport 80 --sport 80 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 80 --sport 80 -j ACCEPT
iptables -A INPUT -p udp --dport 80 --sport 80 -j ACCEPT
iptables -A OUTPUT -p udp --dport 80 --sport 80 -j ACCEPT
###ssh
iptables -A INPUT -p tcp --dport 22 --sport 22 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 22 --sport 22 -j ACCEPT
###mysql
iptables -A INPUT -p tcp --dport 3306 --sport 3306 -d 192.168.1.0/24 -s 192.168.1.0/24 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 3306 --sport 3306 -d 192.168.1.0/24 -s 192.168.1.0/24 -j ACCEPT
I desire to block also the output connection beacouse it would be possible that i can allow to access at the server also some ssh user, so I want set also the OUTPUT policy as DROP.
an other question is how can I set also for the output the interface lo?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.