zoukankan      html  css  js  c++  java
  • Centos 设置iptables端口转发 “Unit iptables.service could not be found”错误

    将端口80映射到8080(此时监听80端口的服务将无法接收数据,因为80端口的数据被转发到8080端口了)

    • Centos6

    iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080

    service iptables save

    service iptables restart

    • Centos7

    yum install iptables-services

    systemctl enable iptables

    iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080

    service iptables save

    systemctl restart iptables

    参考文献:

    https://blog.csdn.net/nainaiqiuwencun/article/details/80697388

    https://blog.csdn.net/at99ak77/article/details/46739043

    https://blog.csdn.net/c233728461/article/details/52679558

  • 相关阅读:
    day11
    day10
    day9
    day8
    day7
    day6
    day14
    day13
    day12
    day11
  • 原文地址:https://www.cnblogs.com/jhc888007/p/10168383.html
Copyright © 2011-2022 走看看