zoukankan      html  css  js  c++  java
  • 「Linux学习」之防火墙服务设置

    设置永久生效主机名:
    方式一:
    hostnamectl set-hostname master
    hostname master
    vim /etc/hostname --- >> 有则编辑更改, 没有则可以新增主机名
     
    查看防火墙默认设置:
    firewall-cmd --get-default-zone
    查看当前默认配置下已有服务:
    firewall-cmd --zone=public --list-all
    firewall-cmd --zone=public --add- 双击table键,选择要添加的服务类型
    添加服务:
    firewall-cmd --zone=public --add-service=ftp
    firewall-cmd --zone=public --add-service=http
    mster访问客户机slave成功
     
    添加完成后查看:
    public (active)
    target: default
    icmp-block-inversion: no
    interfaces: ens33
    sources:
    services: ssh dhcpv6-client http ftp
    ports:
    protocols:
    masquerade: no
    forward-ports:
    source-ports:
    icmp-blocks:
    rich rules:
     
    注意问题: slave不要开设任何端口号, 否则当前设置http设置无效, 由于笔者的master机修改过端口号http端口号888,
    导致笔者slave机无法正常访问master机的http服务, 这里需要在防火墙里添加修改过的端口号,这里介绍一种直接了当的方式, 
    编辑
    vim /etc/httpd/conf/httpd.conf  --- >> 端口改回80, systemctl restart httpd  --- >> 重启服务刷新页面, slave 正常访问master的http服务
     
     

    最后, 使策略永久生效:

    firewall-cmd --permanent --zone=public --add-service=http
    firewall-cmd --permanent --zone=public --add-service=ftp

    查看
    [root@master ~]# firewall-cmd --zone=public --list-all
    public (active)
    target: default
    icmp-block-inversion: no
    interfaces: ens33
    sources:
    services: ssh dhcpv6-client http ftp
    ports:
    protocols:
    masquerade: no
    forward-ports:
    source-ports:
    icmp-blocks:
    rich rules:

  • 相关阅读:
    BeautifulSoup中的select方法
    BeautifulSoup中的find,find_all
    python中sys.stdout、sys.stdin
    python sort、sorted
    Numpy常用操作
    pandas (loc、iloc、ix)的区别
    小波变化库——Pywalvets学习笔记
    python filter()函数
    Redis数据库总结
    高逼格企业级MySQL数据库备份方案,原来是这样....
  • 原文地址:https://www.cnblogs.com/mixiu26/p/10697338.html
Copyright © 2011-2022 走看看