[FUG-BR] Duvida na utilização dos scripts rc.d
Nilton Jose Rizzo
rizzo em i805.com.br
Terça Março 13 23:17:00 BRT 2012
Boa noite,
Ja a muito tempo sempre ignorei o sript de firewall do free
e fazia o meu próprio.
Como montei uma máquina nova (FreeBSD 9.0) fui utilizar
a opção do rc.conf para colocar o meu script para rodar,e para minha
surpresa o negocio não inicializa corretamente, dá erros em um echo ou no
próprio /sbin/ipfw
vejam:
firewall_enable="YES" # Set to YES to enable firewall functionality
firewall_script="/etc/rc.firewall" # Which script to run to set up the firewall
firewall_type="/etc/rc.personalfw" # Firewall type (see /etc/rc.firewall)
firewall_quiet="NO" # Set to YES to suppress rule display
firewall_logging="YES" # Set to YES to enable events logging
firewall_flags="" # Flags passed to ipfw when type is a file
Meu script é apenas simplificado (rc.personalfw
#!/bin/sh
echo 'Firewall version 1.0'
echo '===================='
/sbin/ipfw add 65000 allow all from any to any
/sbin/ipfw add 10000 deny log logamount 0 ip from any to me via re0 setup
Quando executo na mão (/etc/rc.personalfw) roda ok
Quando executoi via rc.firewall ou ipfw start
home# sh /etc/rc.firewall
Flushed all rules.
00100 allow ip from any to any via lo0
00200 deny ip from any to 127.0.0.0/8
00300 deny ip from 127.0.0.0/8 to any
00400 deny ip from any to ::1
00500 deny ip from ::1 to any
00600 allow ipv6-icmp from :: to ff02::/16
00700 allow ipv6-icmp from fe80::/10 to fe80::/10
00800 allow ipv6-icmp from fe80::/10 to ff02::/16
00900 allow ipv6-icmp from any to any ip6 icmp6types 1
01000 allow ipv6-icmp from any to any ip6 icmp6types 2,135,136
Line 3: bad command `echo'
ou
home# /etc/rc.d/ipfw start
Flushed all rules.
00100 allow ip from any to any via lo0
00200 deny ip from any to 127.0.0.0/8
00300 deny ip from 127.0.0.0/8 to any
00400 deny ip from any to ::1
00500 deny ip from ::1 to any
00600 allow ipv6-icmp from :: to ff02::/16
00700 allow ipv6-icmp from fe80::/10 to fe80::/10
00800 allow ipv6-icmp from fe80::/10 to ff02::/16
00900 allow ipv6-icmp from any to any ip6 icmp6types 1
01000 allow ipv6-icmp from any to any ip6 icmp6types 2,135,136
Line 3: bad command `echo'
Firewall rules loaded.
Firewall logging enabled.
Já olhei, já vasculhei o manual na rede e não achei nada de útil que
resolva o meu problema. Alguem tem alguma luz????
--
Nilton José Rizzo
805 Informatica
Disseminando tecnologias
021 2413 9786
---
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
http://en.wikipedia.org/wiki/Posting_style
Mais detalhes sobre a lista de discussão freebsd