0

How to enable external access to MySQL with rules on ip6tables?

I have tried to the rules below, where after inserted I get access, but when server restart the access remains blocked.

:INPUT DROP [2:144]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 
-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP 
-A INPUT -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -m state --state NEW -j DROP 
-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,SYN,RST,PSH,ACK,URG -j DROP 
-A INPUT -i lo -j ACCEPT 
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT 
-A INPUT -s [static ipv6 here]/128 -p tcp -m tcp --dport 3306 -j ACCEPT 
-A INPUT -s [static ipv6 here]/128 -p ipv6-icmp -j ACCEPT 

IPTables is enabled too.

Thanks!

0

Michael, I really appreciate your suggestion. My new table looks like this:

:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [46:5592]
-A INPUT -m rt --rt-type 0 --rt-segsleft 0 -j DROP 
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 
-A INPUT -p ipv6-icmp -j ACCEPT 
-A INPUT -i lo -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT 
-A INPUT -s [static ipv6 here]/128 -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT 
-A INPUT -j REJECT --reject-with icmp6-port-unreachable 
-A FORWARD -m rt --rt-type 0 --rt-segsleft 0 -j DROP 
-A FORWARD -j REJECT --reject-with icmp6-port-unreachable 
-A OUTPUT -m rt --rt-type 0 --rt-segsleft 0 -j DROP 
COMMIT

Works fine now. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.