"Bad argument" when I try to set a iptables command
14,385
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
Related videos on Youtube
Author by
Mr_LinDowsMac
Updated on September 18, 2022Comments
-
Mr_LinDowsMac over 1 year
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' Try
iptables -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)
-
user9517 over 11 yearsWhat are you actually trying to achieve ?
-
Mr_LinDowsMac over 11 years@Iain Something about Masquerading ibiblio.org/pub/linux/docs/HOWTO/other-formats/html_single/…
-
Mr_LinDowsMac over 11 yearsI'm trying to resolve the problem posted here: serverfault.com/questions/417729/…
-
user9517 over 11 yearsYour 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
-
Mr_LinDowsMac over 11 yearsOk, i'll post it there.
-
-
Mr_LinDowsMac over 11 yearsI applied the rule but didn't fix my problem