Jump to content

Como Ativar E Configurar Ipfirewall


tierrilopes
 Share

Recommended Posts

1- Fazer login no servidor

2- Utilizar o gerador de firewall (link em baixo) e colocar o ficheiro ipfw.rules gerado na seguinte localização:

/usr/local/etc/ipfw.rules

Ficheiro em anexo.

3- Correr os seguintes comandos para ativar a firewall e as regras:

sysrc 'firewall_enable="YES"'
sysrc 'firewall_script="/usr/local/etc/ipfw.rules"'
service ipfw start

 

Link: Gerador de firewall

 

Link to comment
Share on other sites

  • 10 months later...
  • 2 months later...

 

Ao ativar o firewall o navicat nem o apache24 funciona mais, alguém sabe me dizer?

 

$IPF 680 allow tcp from any to any PortaNavicat in #3306

$IPF 690 allow tcp from any to any PortaNavicat out #3306

$IPF 700 allow udp from any to any PortaNavicat in #3306

$IPF 710 allow udp from any to any PortaNavicat out #3306

 

Não tenho a certeza se é preciso dar permissões tcp/udp ou somente tcp mas pelo sim e pelo não deixo ai os dois, fazer a mesma coisa para a porta 80 para o apache poder funcionar.

$IPF 680 allow tcp from any to any 80 in
$IPF 690 allow tcp from any to any 80 out
$IPF 700 allow udp from any to any 80 in
$IPF 710 allow udp from any to any 80 out

Link to comment
Share on other sites

  • 2 weeks later...
O que é que isto vai realmente possibilitar ao servidor , qual as principais funções onde se deve utilizar este tutorial ?

- Firewall é usado para segurança do sistema, você pode configura-lo para filtrar tráfego e assim 'bloquear' ataques, aonde você cria 'regras', dá para fazer bastante coisas, e aumentar a performance e segurança usando-o, desde que use corretamente. Mais info

Link to comment
Share on other sites

  • 7 months later...
  • 2 months later...
  • 1 month later...

Nota, caso estejas a colocar numa vps que tenha firewall por painel web (por exemplo na Hetzner), a instalação da ipfw pode não funcionar pois a mesma está alterada para ser controlada por esse mesmo painel.

Caso continue a dar esses erros, ao invés de fazer download, copia tudo e cria tu o ficheiro, tendo em atenção se os fins de linha estão em UNIX e não em modo WINDOWS (notepad++, Editar, Conversão EOL)

Link to comment
Share on other sites

  • 1 month later...

I just suggest to NEVER push firewall_enable="YES" before you have test that rules are OK.

So...on /etc/conf add

firewall_enable="NO"
firewall_type="open"
firewall_script="/etc/ipfw.rules"
firewall_logging="YES"

After start the firewall

service ipfw onestart

Now test if ALL is ok. If not, just reboot the machine... if ALL is ok, you can switch firewall_enable="NO" to "YES".

Link to comment
Share on other sites

  • 5 weeks later...
Em 14/03/2018 em 13:40, Sil3nce disse:

I just suggest to NEVER push firewall_enable="YES" before you have test that rules are OK.

So...on /etc/conf add

firewall_enable="NO"
firewall_type="open"
firewall_script="/etc/ipfw.rules"
firewall_logging="YES"

After start the firewall

service ipfw onestart

Now test if ALL is ok. If not, just reboot the machine... if ALL is ok, you can switch firewall_enable="NO" to "YES".

Agree but, you can also user " service ipfw onestart && sleep 60 && service ipfw onestop " to test if ipfw.rules is ok, and if is not, it will be unnecessary to restart the machine, because starting this way will activate the firewall rules for only 60 seconds and then disconnect the ipwf rules after that, thx for your comment!

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...