tag:blogger.com,1999:blog-6017612340379304686.post5261034431725645460..comments2024-03-11T19:05:45.518+01:00Comments on Everything about nothing: Implementing IF, AND, OR, etc. in iptables...Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-6017612340379304686.post-9521492573542112832019-09-25T16:48:09.438+02:002019-09-25T16:48:09.438+02:00Your article is unique on the internet. Therefore ...Your article is unique on the internet. Therefore it is a must. It is not clear to me how the AND operator works. I would appreciate an update. Example in my case: I want to block two strings located in different places. So I need a rule that if it matches the first one that checks the second one and if both match, then DROP. How can I use these operators to make it work. None of the examples AlejCalerohttps://www.blogger.com/profile/02041715110092144453noreply@blogger.comtag:blogger.com,1999:blog-6017612340379304686.post-25090070221930849602013-02-14T12:48:20.074+01:002013-02-14T12:48:20.074+01:00OR is easier, if you want:
iptables condA OR cond...OR is easier, if you want:<br /><br />iptables condA OR condB target<br /><br />you can write it as:<br /><br />iptables condA target<br />iptables condB target<br /><br />AND is trickier because iptables doesn't support AND operator in specifiers. But, you can do it using custom chain. Say you want:<br /><br />iptables condA AND condB target<br /><br />you can write it as:<br /><br />Stjepan Groš (sgros)https://www.blogger.com/profile/05055647296141032967noreply@blogger.comtag:blogger.com,1999:blog-6017612340379304686.post-4881539200201274702013-02-14T11:29:24.643+01:002013-02-14T11:29:24.643+01:00How would one add an AND or OR operator for THE SA...How would one add an AND or OR operator for THE SAME constant into one rule?<br /><br />I need to say -d ! 192.168.18.0/24 AND -d ! 192.168.19.0/24 as an example? Anonymoushttps://www.blogger.com/profile/14278849616715556309noreply@blogger.com