iptables

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了iptables相关的知识,希望对你有一定的参考价值。

 

 

root@cloud:~# iptables -t nat  -L POSTROUTING  -n --line-number 
Chain POSTROUTING (policy ACCEPT)
num  target     prot opt source               destination         
1    KUBE-POSTROUTING  all  --  0.0.0.0/0            0.0.0.0/0            /* kubernetes postrouting rules */
2    MASQUERADE  all  --  172.17.0.0/16        0.0.0.0/0           
3    RETURN     all  --  10.244.0.0/16        10.244.0.0/16       
4    MASQUERADE  all  --  10.244.0.0/16       !224.0.0.0/4         
5    RETURN     all  -- !10.244.0.0/16        10.244.0.0/24       
6    MASQUERADE  all  -- !10.244.0.0/16        10.244.0.0/16       
root@cloud:~# iptables -t filter  -L INPUT  -n --line-number 
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination         
1    KUBE-SERVICES  all  --  0.0.0.0/0            0.0.0.0/0            ctstate NEW /* kubernetes service portals */
2    KUBE-EXTERNAL-SERVICES  all  --  0.0.0.0/0            0.0.0.0/0            ctstate NEW /* kubernetes externally-visible service portals */
3    KUBE-FIREWALL  all  --  0.0.0.0/0            0.0.0.0/0           
4    DROP       tcp  --  210.22.22.150        0.0.0.0/0            tcp dpt:10000
5    DROP       tcp  --  210.22.22.150        0.0.0.0/0            tcp dpt:10004
root@cloud:~# 

 

root@cloud:~# iptables -t filter  -D INPUT  4
root@cloud:~# date
Tue May 18 16:50:21 CST 2021
root@cloud:~# iptables -t filter  -L INPUT  -n --line-number 
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination         
1    KUBE-SERVICES  all  --  0.0.0.0/0            0.0.0.0/0            ctstate NEW /* kubernetes service portals */
2    KUBE-EXTERNAL-SERVICES  all  --  0.0.0.0/0            0.0.0.0/0            ctstate NEW /* kubernetes externally-visible service portals */
3    KUBE-FIREWALL  all  --  0.0.0.0/0            0.0.0.0/0       

 

以上是关于iptables的主要内容,如果未能解决你的问题,请参考以下文章

CentOS中iptables防火墙 开放80端口方法

Iptables 网络安全

iptables防火墙

iptables基础知识

Linux中iptables防火墙指定端口范围

iptables防火墙