Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My goal is to allow access to port 11211 (memcache) from mydomain.com by changing the existing iptable.

I used the line: iptables -I INPUT -p tcp -s xx.xx.xx.xx --dport 11211 -j ACCEPT to add the first line in the iptable (xx.xx.xx.xx is the ip of my domain):

Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     tcp  --  mydomain.com      anywhere            tcp dpt:11211
ACCEPT     tcp  --  localhost            anywhere            tcp dpt:11211
ACCEPT     tcp  --  domU-12-31-39-01-BC-21.compute-1.internal  anywhere   tcp dpt:11211
DROP       tcp  --  anywhere             anywhere            tcp dpt:11211
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:www

Still when I try to access port 11211 it seems to be blocked (in aws security groups it is open, so thats not the reason)

Whats wrong with this setting ?

share|improve this question
1  
Can you try adding COUNT in the line accepting traffic from mydomain.com, then see if it's incrementing as you try? This would at least verify that your traffic is originating from the place you think it is. –  Matt Simmons May 18 '11 at 14:57
1  
Also, dumb question, but you do have memcached bound to the external IP, right? –  Matt Simmons May 18 '11 at 14:58
1  
To see the packet count use iptables -nvL. –  Eduardo Ivanec May 18 '11 at 15:10
    
In addition to the above, it's not clear from your question if your firewall on the same box as memcache. If it isn't, you need the FORWARD chain, not the INPUT one. –  SmallClanger May 18 '11 at 16:58
    
Did you ever slove this ? If so can you please provide an answer - thanks. –  Iain Dec 12 '11 at 21:08

1 Answer 1

up vote 1 down vote accepted

I'm not sure what the problem was but the line

iptables -I INPUT -p tcp --dport 11211 -j ACCEPT 

Works for opening the port

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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