Centos 设置iptables端口转发 “Unit iptables.service could not be found”错误
Posted jhc888007
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos 设置iptables端口转发 “Unit iptables.service could not be found”错误相关的知识,希望对你有一定的参考价值。
将端口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”错误的主要内容,如果未能解决你的问题,请参考以下文章
centos7 && centos6.5部KVM使用NAT联网并为虚拟机配置firewalld && iptables防火墙端口转发