GNU/Linux >> Linux Esercitazione >  >> Cent OS

CentOS / RHEL 7:come aprire una porta nel firewall con firewall-cmd?

Domanda:come aprire una porta in RHEL 7 utilizzando il comando firewall-cmd?

Soluzione:

Per cominciare controlla lo stato del firewalld usando il comando systemctl :

# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2016-10-29 21:47:04 IST; 1 weeks 4 days ago
 Main PID: 1055 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─1055 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Oct 29 21:46:50 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Oct 29 21:47:04 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.

Esegui questi comandi per aggiungere una porta al firewall:
Il comando seguente aprirà la porta con effetto immediato, ma non persisterà tra i riavvii:

# firewall-cmd --add-port=[YOUR PORT]/tcp

Ad esempio, per aprire la porta TCP 2222 :

# firewall-cmd --add-port=2222/tcp

Il comando seguente creerà una regola persistente, ma non verrà applicata immediatamente:

# firewall-cmd --permanent --add-port=[YOUR PORT]/tcp

Ad esempio, per aprire la porta TCP 2222 :

# firewall-cmd --permanent --add-port=2222/tcp
CentOS / RHEL 7:come aprire la porta Firewall per il server Samba utilizzando FirewallD


Cent OS
  1. Configura Firewall con FirewallD su CentOS 7

  2. Come configurare il firewall utilizzando FirewallD su CentOS 8

  3. Come configurare Firewall con Firewalld su CentOS 8

  4. Come ricostruire "initramfs" con Multipath in CentOS/RHEL 6 e 7

  5. CentOS/RHEL:come trovare il pacchetto con un file mancante utilizzando YUM

RHEL 8 / CentOS 8 apre la porta FTP 21 con firewalld

Come arrestare/avviare il firewall su RHEL 8 / CentOS 8

Come aprire e chiudere le porte su RHEL 8 / CentOS 8 Linux

Come configurare un firewall con FirewallD su CentOS 7

Come configurare e gestire il firewall su CentOS 8

Come aprire la porta per un indirizzo IP specifico in Firewalld