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

centos7 firewall 一些用法

时间:2020-03-27 09:16:05      阅读:77      评论:0      收藏:0      [点我收藏+]

标签:work   intern   reload   lte   one   ade   ipv4   centos   another   

[5]For exmaple, Configure that outgoing packets through the Server from Internal network(10.0.0.0/24) are allowed and forwarded to External side.

# set masquerading to internal zone
[root@dlp ~]# firewall-cmd --zone=internal --add-masquerade --permanent
success
[root@dlp ~]# firewall-cmd --reload
success
[root@dlp ~]# firewall-cmd --direct --add-rule ipv4 nat POSTROUTING 0 -o eth1 -j MASQUERADE
[root@dlp ~]# firewall-cmd --direct --add-rule ipv4 filter FORWARD 0 -i eth0 -o eth1 -j ACCEPT
[root@dlp ~]# firewall-cmd --direct --add-rule ipv4 filter FORWARD 0 -i eth1 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT

For example, Configure that incoming packets come to 22 port of External zone are forwarded to another Host(192.168.0.31) of 22 port

firewall-cmd --zone=external --add-forward-port=port=22:proto=tcp:toport=22:toaddr=192.168.0.31

 

centos7 firewall 一些用法

标签:work   intern   reload   lte   one   ade   ipv4   centos   another   

原文地址:https://www.cnblogs.com/zhenfei/p/12578893.html

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