1

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)

Mr_LinDowsMac
  • 295
  • 1
  • 10
  • 21
  • What are you actually trying to achieve ? – user9517 Oct 08 '12 at 08:18
  • @Iain Something about Masquerading http://www.ibiblio.org/pub/linux/docs/HOWTO/other-formats/html_single/Masquerading-Simple-HOWTO.html#FAQ – Mr_LinDowsMac Oct 08 '12 at 08:19
  • I'm trying to resolve the problem posted here: http://serverfault.com/questions/417729/cant-connect-or-ping-to-internet-from-my-device-using-crossover-ethernet/417735 – Mr_LinDowsMac Oct 08 '12 at 08: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](http://superuser.com) but please [search](http://superuser.com/search) their site for similar questions that may already have the answer you're looking for. It may also be on topic for http://raspberrypi.stackexchange.com/ – user9517 Oct 08 '12 at 08:48
  • Ok, i'll post it there. – Mr_LinDowsMac Oct 08 '12 at 09:32

1 Answers1

1

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

Eddie
  • 46
  • 1