centos7 no longer uses iptables
to operate, but uses firewalld
command to open ports
But recently, I found that I always reported an error:
Modify the python point in the /usr/bin/firewall-cmd
directory. Since the firewall
command only supports python2, we need to change it to the local environment of python2, because I upgraded the python environment of centos7 before. For the sake of python3.6. As a result, the command does not work properly now.
I can execute vi /usr/bin/firewall-cmd
here to modify the python point of the first line,
Modified from the previous
#!/usr/bin/python
to:
#!/usr/bin/python2
There is one more place: /usr/sbin/firewalld
, which is also the python pointer to modify the first line.