centos 7 配置防火墙 firewalld

centos 7 x64 装了 neo4j 想用其它机器访问,无奈一直被拒绝,后来发现是防火墙启用了。

systemctl status firewalld

可以查看防火墙状态。

现在为 neo4j 添加服务

拷贝一个配置文件作为 neo4j 的服务样例文件,然后进行修改。 如使用ssh.xml

cp /usr/lib/firewalld/services/ssh.xml /usr/lib/firewalld/services/neo4j.xml

然后修改 neo4j.xml

<?xml version="1.0" encoding="utf-8"?>
<service>
  <short>SSH</short>
  <description>Secure Shell (SSH) is a protocol for logging into and executing commands on remote machines. It provides secure encrypted communications. If you plan on accessing your machine remotely via SSH over a firewalled interface, enable this option. You need the openssh-server package installed for this option to be useful.</description>
  <port protocol="tcp" port="22"/>
</service>

改为:

<?xml version="1.0" encoding="utf-8"?>
<service>
  <short>neo4j-web</short>
  <description>neo4j http https</description>
  <port protocol="tcp" port="7474"/>
  <port protocol="tcp" port="7473"/>
</service>

重新加载 firewall 服务配置

firewall-cmd --reload

然后添加服务

firewall-cmd --zone=public --add-service=neo4j

More detail see ref.

[1] https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-firewalld-on-centos-7

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值