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

I'm trying to set up a proxy server on an Ubuntu Box, but my linux-fu is pretty weak and I'm stymied with an iptables issue.

I'm trying to execute this command:

iptables -A INPUT -d xxx.xxx.xxx.xxx -p tcp -m –dport 443 -j ACCEPT

The error I get back is this:

iptables v1.4.4: Couldn't load match `-dport':/lib/xtables/libipt_-dport.so: cannot open shared object file: No such file or directory

Try `iptables -h' or 'iptables --help' for more information.

There is, in fact, no file with that name.

iptables was not installed on my machine, I did:

apt-get install iptables

to install it. Finally, here's my distro info:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04 LTS"

Any idea what's going on? If this is an obvious question, please point me to the relevant documentation; I'm kinda lost on even where to look, and Googling pulls up nothing.

Thanks!

Kevin

share|improve this question
    
Are you sure you typed the command correctly as posted here? The dport option should be written as --dport. –  Khaled Jan 23 '12 at 15:35
    
You're right, I was missing the dash. However, I still get an error. I've updated my error message above. –  scottlabs Jan 23 '12 at 15:41
    
I see that this error can happen when you write the command with missing tcp after -m. –  Khaled Jan 23 '12 at 15:43
    
Hi Khaled, I'm not sure I follow. Can you perhaps paste the command with tcp in the right place? I don't really follow. –  scottlabs Jan 23 '12 at 15:47
    
I think you issued the command as: iptables -A INPUT -d xxx.xxx.xxx.xxx -p tcp -m -dport 443 -j ACCEPT. –  Khaled Jan 23 '12 at 15:52

1 Answer 1

up vote 1 down vote accepted

You should enter the command as follows:

$ sudo iptables -A INPUT -d xxx.xxx.xxx.xxx -p tcp -m tcp --dport 443 -j ACCEPT

Pay attention to the protocol name after -m and double dash before dport. You can also remove -m tcp from the above command as it is useless in your command.

share|improve this answer
    
thanks, that worked! –  scottlabs Jan 23 '12 at 16:20

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.