找回密码
 注册
查看: 1252|回复: 1

iptables 防火墙规则删除操作记录 -D 参数 INPUT进规则

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2022-1-17 15:00:01 | 显示全部楼层 |阅读模式
[root@compute10 ~]# iptables -L -n --line-numbers
5 D9 X( x- W* b2 u- k; C1 kChain INPUT (policy ACCEPT)
+ g- _8 q3 L7 E4 n4 nnum  target     prot opt source               destination         
4 ]8 s& F% {" D8 H1    ACCEPT     tcp  --  10.161.53.0/27       0.0.0.0/0            multiport dports 5900:5999 /* ACCEPT VNC Port only by Controller Node */. B- v. `* P# y5 M
2    REJECT     tcp  --  0.0.0.0/0            0.0.0.0/0            multiport dports 5900:5999 reject-with icmp-port-unreachable
' R5 G! `/ Q' R! S6 ~! x6 p3    ACCEPT     tcp  --  10.161.53.0/27       0.0.0.0/0            multiport dports 5900:5999 /* ACCEPT VNC Port only by Controller and compute Node */# _6 w; N# f' y4 g8 k
4    ACCEPT     tcp  --  10.161.53.100        0.0.0.0/0            multiport dports 5900:5999 /* ACCEPT VNC Port only by Windows remote Node */& U. H6 b! T4 Y# n
5    REJECT     tcp  --  0.0.0.0/0            0.0.0.0/0            multiport dports 5900:5999 reject-with icmp-port-unreachable0 D# k+ k% M3 j5 N
Chain FORWARD (policy ACCEPT)
) F" x/ D# f$ ~6 x# P2 A7 onum  target     prot opt source               destination         ' Y& A8 E% g6 Y: Z9 H
Chain OUTPUT (policy ACCEPT)& a- _1 v0 r" G: R) e7 O$ _0 s: F; D
num  target     prot opt source               destination         , n5 R6 o+ u( _- R
[root@compute10 ~]# iptables -D INPUT 1
5 r* x( k% j& M, B4 F" [  @[root@compute10 ~]# iptables -D INPUT 2. m5 Z, [" e& d9 D' G( T' U
[root@compute10 ~]# iptables -D INPUT 3' L) o6 x7 T% V+ |" a% r
[root@compute10 ~]# iptables -D INPUT 4/ g6 O6 O2 D' ~! g" G4 H
iptables: Index of deletion too big.
' }% N7 j; g5 w9 a' j[root@compute10 ~]# iptables -L -n --line-numbers : A* G/ R3 L! K$ @" Y
Chain INPUT (policy ACCEPT), i! o! W2 b* t2 ^; u8 O% @
num  target     prot opt source               destination         ) ?# w/ f0 v3 M% Q6 H- n
1    REJECT     tcp  --  0.0.0.0/0            0.0.0.0/0            multiport dports 5900:5999 reject-with icmp-port-unreachable8 _8 t" G: o% o; B: O: r
2    ACCEPT     tcp  --  10.161.53.100        0.0.0.0/0            multiport dports 5900:5999 /* ACCEPT VNC Port only by Windows remote Node */
3 E& Q# _1 L5 N# HChain FORWARD (policy ACCEPT)
* L% n& a  t5 X* D% _6 i0 Snum  target     prot opt source               destination         ) H! a; G" ?5 J! D7 m) n- I6 L6 u
Chain OUTPUT (policy ACCEPT); }7 V4 k( [0 H3 Y( W
num  target     prot opt source               destination         2 |7 v# J, l" i8 c$ i
[root@compute10 ~]# iptables -D INPUT 1! J. \0 P- P; z( N# b4 p& `/ w, b
[root@compute10 ~]# iptables -D INPUT 2
3 Z2 V' B* D; Giptables: Index of deletion too big.
# B  ]8 Q" l; E* ^  t$ x[root@compute10 ~]# iptables -L -n --line-numbers
' i( R+ J6 p1 w  xChain INPUT (policy ACCEPT)
0 M3 S. f2 N$ [! ]; Unum  target     prot opt source               destination         # Y0 S5 V/ |3 j* L" y
1    ACCEPT     tcp  --  10.161.53.100        0.0.0.0/0            multiport dports 5900:5999 /* ACCEPT VNC Port only by Windows remote Node */4 N+ s2 _$ P  g
Chain FORWARD (policy ACCEPT)
# J- T7 r2 M/ U7 ?$ K, |num  target     prot opt source               destination         
3 W4 X2 @, ^; q$ yChain OUTPUT (policy ACCEPT)
# b% J% i! U# snum  target     prot opt source               destination         " C& u5 l+ ^% U- ~2 ~" {
[root@compute10 ~]# iptables -D INPUT 1
0 \9 w  v9 e% A+ u. z[root@compute10 ~]# iptables -L -n --line-numbers
" N5 ^1 T" h% O; G9 g! DChain INPUT (policy ACCEPT)
; A$ M+ I4 ~/ \: Ynum  target     prot opt source               destination         1 g. U) b8 \: |0 _% t  n4 R6 F' N! M
Chain FORWARD (policy ACCEPT)6 |7 k) i5 L! t! o) v
num  target     prot opt source               destination         ) S8 [; ?1 D% P" k, q
Chain OUTPUT (policy ACCEPT)
3 H, Z! s2 s" f" ~( o: Z6 lnum  target     prot opt source               destination         ) m, X6 L2 Y/ A6 u. [9 T; T- y8 P
4 n$ h9 @3 n6 j4 U

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2022-7-1 13:49:09 | 显示全部楼层
iptables -A INPUT -s 10.161.53.31/27 -p tcp -m multiport --dports 5900:5999 -m comment --comment "ACCEPT VNC Port only by Controller Node" -j ACCEPT
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 01:59 , Processed in 0.017962 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表