// View firewalld [root @ wode006sysconfig] # systemctlstatusfirewalld. servicefirewalld. service-firewalld-dynamicfirewalldaemonLoaded: loaded (/usr/lib/systemd/syst
// View firewalld
[Root @ wode006 sysconfig] # systemctl status firewalld. service
Firewalld. service-firewalld-dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld. service; enabled)
Active: active (running) since 4 15:19:05 CST; 1 day 10 h ago
Main PID: 901 (firewalld)
CGroup:/system. slice/firewalld. service
Capacity-901/usr/bin/python-Es/usr/sbin/firewalld -- nofork -- nopid
July 02 15:19:04 wode006 systemd [1]: Starting firewalld-dynamic firewall .....
July 02 15:19:05 wode006 systemd [1]: Started firewalld-dynamic firewall d... n.
Hint: Some lines were ellipsized, use-l to show in full.
[Root @ wode006 sysconfig] #
// Disable firewalld
[Root @ wode006 sysconfig] # systemctl stop firewalld. service
[Root @ wode006 sysconfig] # systemctl status firewalld. service
Firewalld. service-firewalld-dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld. service; enabled)
Active: inactive (dead) since six 01:29:24 CST; 2 s ago
Main PID: 901 (code = exited, status = 0/SUCCESS)
July 02 15:19:04 wode006 systemd [1]: Starting firewalld-dynamic firewall .....
July 02 15:19:05 wode006 systemd [1]: Started firewalld-dynamic firewall d... n.
July 04 01:29:23 wode006 systemd [1]: Stopping firewalld-dynamic firewall .....
July 04 01:29:24 wode006 systemd [1]: Stopped firewalld-dynamic firewall d... n.
Hint: Some lines were ellipsized, use-l to show in full.
[Root @ wode006 sysconfig] #
// Disable firewalld startup
[Root @ wode006 sysconfig] # systemctl disable firewalld. service
Rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
Rm '/etc/systemd/system/basic.tar get. wants/firewalld. service'
[Root @ wode006 sysconfig] # systemctl status firewalld. service
Firewalld. service-firewalld-dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld. service; disabled)
Active: inactive (dead)
July 02 15:19:04 wode006 systemd [1]: Starting firewalld-dynamic firewall .....
July 02 15:19:05 wode006 systemd [1]: Started firewalld-dynamic firewall d... n.
July 04 01:29:23 wode006 systemd [1]: Stopping firewalld-dynamic firewall .....
July 04 01:29:24 wode006 systemd [1]: Stopped firewalld-dynamic firewall d... n.
Hint: Some lines were ellipsized, use-l to show in full.
[Root @ wode006 sysconfig] #
// Install iptables
[Root @ wode006 sysconfig] # yum install iptables-services
Loaded plug-ins: fastestmirror, langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Resolving dependency
--> Checking the transaction
---> The package iptables-services.x86_64.0.1.4.21-13.el7 will be installed
--> Dependency resolved
// Configure iptables
[Root @ wode006 sysconfig] # vi/etc/sysconfig/iptables
[Root @ wode006 sysconfig] #
# Allowed ssh
-A input-p tcp-m state -- state NEW-m tcp -- dport 22-j ACCEPT
// Restart the firewall
[Root @ wode006 sysconfig] # service iptables restart
Redirecting to/bin/systemctl restart iptables. service
[Root @ wode006 sysconfig] # systemctl restart iptables. service
[Root @ wode006 sysconfig] #