Я новичок в ipfw, пытаюсь изучить его и тестирую его команды на сервере с FreeBSD. Каждый раз, когда я запускаю команду ipfw через SSH с синтаксической ошибкой / опечаткой, а затем перезапускаю службу ipfw, сервер блокируется для меня, и я не могу работать с ним через SSH. Даже если нет правила ipfw, запрещающего трафик на мой компьютер. И я вынужден попросить главного администратора разблокировать мой сервер.
Есть ли способ протестировать ipfw без такой блокировки сервера / SSH? Или, если я установлю / разверну сервер локально на своем компьютере, смогу ли я самостоятельно разблокировать сервер в случае ошибки ipfw?
Есть очень удобный скрипт:
/usr/share/examples/ipfw/change_rules.sh
Он работает именно так, как вы хотите:
# Invoke this script to edit ${firewall_script}. It will call ${EDITOR},
# or vi(1) if the environment variable is not set, for you to edit
# ${firewall_script}, ask for confirmation, and then run
# ${firewall_script}. You can then examine the output of ipfw list and
# confirm whether you want the new version or not.
#
# If no answer is received in 30 seconds, the previous
# ${firewall_script} is run, restoring the old rules (this assumes ipfw
# flush is present in it).
#
# If the new rules are confirmed, they'll replace ${firewall_script} and
# the previous ones will be copied to ${firewall_script}.{date}. Mail
# will also be sent to root with a unified diff of the rule change.
#
# Unapproved rules are kept in ${firewall_script}.new, and you are
# offered the option of changing them instead of the present rules when
# you call this script.