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.

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
    
What are you actually trying to achieve ? –  Iain Oct 8 '12 at 8:18
    
@Iain Something about Masquerading ibiblio.org/pub/linux/docs/HOWTO/other-formats/html_single/… –  Mr_LinDowsMac Oct 8 '12 at 8:19
    
I'm trying to resolve the problem posted here: serverfault.com/questions/417729/… –  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 raspberrypi.stackexchange.com –  Iain Oct 8 '12 at 8:48
    
Ok, i'll post it there. –  Mr_LinDowsMac Oct 8 '12 at 9:32
add comment

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

Questions on Server Fault are expected to relate to professional 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.

1 Answer

up vote 0 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
add comment

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