LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-05-2013, 03:05 AM   #1
monkinsane
LQ Newbie
 
Registered: Oct 2007
Location: Pretoria - South Africa
Distribution: Ubuntu 8.10
Posts: 12

Rep: Reputation: 0
IPTables Question


Hi there,

I have been trying to set up a FW, and ran into a snag.

I set up my script with rules, and it ran through perfectly the first time. I then rebooted and ran it again and I get the following errors when it tries to apply this rules:


Quote:
iptables -A INPUT -i enp0s3 --src ! 192.168.123.0/24 -j LOG --log-prefix "SPOOFED PKT "
Quote:
iptables -A INPUT -i enp0s3 --src ! 192.168.123.0/24 -j DROP
The error is:

Quote:
Bad argument `192.168.123.0/24'
Try `iptables -h' or 'iptables --help' for more information.
Any help would be appriciated.
 
Old 11-05-2013, 03:39 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Hmm, not sure quite what happened when, but it seems the syntax has changed at some point, so "-s ! 1.2.3.4" should now be "! -s 1.2.3.4"
 
1 members found this post helpful.
Old 11-05-2013, 03:50 AM   #3
monkinsane
LQ Newbie
 
Registered: Oct 2007
Location: Pretoria - South Africa
Distribution: Ubuntu 8.10
Posts: 12

Original Poster
Rep: Reputation: 0
Never mind,

Book I am using is a bit out of dat it would seem.

Syntax has changed, rule should be:

Quote:
iptables -A INPUT -i enp0s3 ! --src 192.168.123.0/24 -j LOG --log-prefix "SPOOFED PKT "
 
Old 11-05-2013, 03:52 AM   #4
monkinsane
LQ Newbie
 
Registered: Oct 2007
Location: Pretoria - South Africa
Distribution: Ubuntu 8.10
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
Hmm, not sure quite what happened when, but it seems the syntax has changed at some point, so "-s ! 1.2.3.4" should now be "! -s 1.2.3.4"
Thanx, yeah figured out that the syntax has changed.

Bit retarded to change syntax imho.

thanx for the assist.
 
Old 11-05-2013, 03:54 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
I *think* I can see a grammatical reason to change it, as it makes the inversion at a higher conceptual level in the rule logic, but yeah it seems pretty petty to me.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] iptables question. bluewire Linux - Security 15 11-09-2011 01:21 PM
question in iptables Rasees Linux - Networking 1 03-20-2009 11:01 PM
iptables Question wh1terabb1t Linux - Networking 1 05-16-2008 07:03 PM
IPTABLES question WWMPCDD Linux - Newbie 1 10-26-2004 04:20 AM
Question about iptables tontod Linux - Networking 3 06-10-2002 06:03 PM


All times are GMT -5. The time now is 08:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration