Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to run the following command:

sudo /usr/sbin/iptables -A INPUT -m state --state NEW -i ! wlan0 -j ACCEPT

But i got this error:

Bad argument wlan0' Tryiptables -h' or 'iptables --help' for more information.

I don't know what is wrong, the man says that you have to put a "!" before the conection adapter (in this case is wlan0)

share|improve this question

closed as off topic by Iain Oct 8 '12 at 8:47

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

What are you actually trying to achieve ? – Iain Oct 8 '12 at 8:18
@Iain Something about Masquerading… – Mr_LinDowsMac Oct 8 '12 at 8:19
I'm trying to resolve the problem posted here:… – Mr_LinDowsMac Oct 8 '12 at 8:24
Your question is off topic for Serverfault because it doesn't appear to relate to servers/networking or desktop infrastructure in a professional environment. It may be on topic for Superuser but please search their site for similar questions that may already have the answer you're looking for. It may also be on topic for – Iain Oct 8 '12 at 8:48
Ok, i'll post it there. – Mr_LinDowsMac Oct 8 '12 at 9:32
up vote 1 down vote accepted

You should try this command in this form:

sudo /usr/sbin/iptables -A INPUT -m state --state NEW ! -i wlan0 -j ACCEPT

But be sure, that interface wlan0 is up:

sudo ifconfig wlan0 up

share|improve this answer
I applied the rule but didn't fix my problem – Mr_LinDowsMac Oct 8 '12 at 9:28

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