"CentOS 7.1" configuration firewall

Source: Internet
Author: User

View Firewalld

[Email protected] sysconfig]# systemctl status Firewalld.service

firewalld.service-firewalld-dynamic Firewall daemon

Loaded:loaded (/usr/lib/systemd/system/firewalld.service; enabled)

Active: Active (running) since quad 2015-07-02 15:19:05 CST; 1 Day 10h ago

Main pid:901 (FIREWALLD)

CGroup:/system.slice/firewalld.service

└─901/usr/bin/python-es/usr/sbin/firewalld--nofork--nopid


July 15:19:04 wode006 systemd[1]: Starting firewalld-dynamic firewall .....

July 15:19:05 wode006 systemd[1]: Started firewalld-dynamic firewall D...N.

Hint:some lines were ellipsized, use-l to show on full.

[Email protected] sysconfig]#


Close Firewalld

[Email protected] sysconfig]# Systemctl stop Firewalld.service

[Email protected] 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 2015-07-04 01:29:24 CST; 2s ago

Main pid:901 (code=exited, status=0/success)


July 15:19:04 wode006 systemd[1]: Starting firewalld-dynamic firewall .....

July 15:19:05 wode006 systemd[1]: Started firewalld-dynamic firewall D...N.

July 01:29:23 wode006 systemd[1]: Stopping firewalld-dynamic firewall .....

July 01:29:24 wode006 systemd[1]: Stopped firewalld-dynamic firewall D...N.

Hint:some lines were ellipsized, use-l to show on full.

[Email protected] sysconfig]#


Disable Boot Firewalld

[Email protected] sysconfig]# systemctl disable Firewalld.service

RM '/etc/systemd/system/dbus-org.fedoraproject.firewalld1.service '

RM '/etc/systemd/system/basic.target.wants/firewalld.service '

[Email protected] sysconfig]# systemctl status Firewalld.service

firewalld.service-firewalld-dynamic Firewall daemon

loaded:loaded (/usr/lib/systemd/system/firewalld.service; disabled)

Active:inactive (Dead)


July 15:19:04 wode006 systemd[1]: Starting firewalld-dynamic firewall .....

July 15:19:05 wode006 systemd[1]: Started firewalld-dynamic firewall D...N.

July 01:29:23 wode006 systemd[1]: Stopping firewalld-dynamic firewall .....

July 01:29:24 wode006 systemd[1]: Stopped firewalld-dynamic firewall D...N.

Hint:some lines were ellipsized, use-l to show on full.

[Email protected] sysconfig]#


Installing Iptables

[email protected] sysconfig]# Yum install iptables-services

Loaded plugins: 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 dependencies

--Checking transactions

---> Package iptables-services.x86_64.0.1.4.21-13.el7 will be installed

--Resolve dependency completion


Configure Iptables

[Email protected] sysconfig]# Vi/etc/sysconfig/iptables

[Email protected] sysconfig]#

# allowed SSH

-A input-p tcp-m state--state new-m TCP--dport 22-j ACCEPT



Restarting the firewall

[Email protected] sysconfig]# service iptables restart

Redirecting To/bin/systemctl restart Iptables.service

[Email protected] sysconfig]# systemctl restart Iptables.service

[Email protected] sysconfig]#



"CentOS 7.1" configuration firewall

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.