Jump to content

Recommended Posts

Posted

Некрасивая ситуация

если я добавляю правило с номером 100 (ipfw add 100 deny udp from any 135-139 to any)

а потом добавляю ещё одно правило с таким же номером (ipfw add 100 deny udp from any 445 to any), то оно почему то добавляется. Или абсолютно одинаковые правила с одинаковым номером дублируются очень много раз.

-------------------------------------------------------------------

ipfw show

00100 0 0 deny udp from any 135-139 to any

00100 0 0 deny udp from any 445 to any

--------------------------------------------------------------------

 

 

Как от этого избавиться? как сделать так что бы при добавлении существующего правила оно либо заменялось либо просто не добавлялось?

Posted (edited)

Никак. Это фича ipfw. Очень, кстати, удобная местами.

Читайте маны, это полезно. :)

 

---кусь---

rule_number

Each rule is associated with a rule_number in the range 1..65535,

with the latter reserved for the default rule. Rules are checked

sequentially by rule number. Multiple rules can have the same

number, in which case they are checked (and listed) according to

the order in which they have been added. If a rule is entered

without specifying a number, the kernel will assign one in such a

way that the rule becomes the last one before the default rule.

Automatic rule numbers are assigned by incrementing the last non-

default rule number by the value of the sysctl variable

net.inet.ip.fw.autoinc_step which defaults to 100. If this is

not possible (e.g. because we would go beyond the maximum allowed

rule number), the number of the last non-default value is used

instead.

---кусь---

Edited by Fizban

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...
На сайте используются файлы cookie и сервисы аналитики для корректной работы форума и улучшения качества обслуживания. Продолжая использовать сайт, вы соглашаетесь с использованием файлов cookie и с Политикой конфиденциальности.