码迷,mamicode.com
首页 > 其他好文 > 详细

Centos 设置iptables端口转发 “Unit iptables.service could not be found”错误

时间:2018-12-24 16:24:28      阅读:3039      评论:0      收藏:0      [点我收藏+]

标签:centos   details   service   端口   centos7   mct   color   设置   rect   

将端口80映射到8080

  • Centos6

iptables -t net -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 net -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

Centos 设置iptables端口转发 “Unit iptables.service could not be found”错误

标签:centos   details   service   端口   centos7   mct   color   设置   rect   

原文地址:https://www.cnblogs.com/jhc888007/p/10168383.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!