iptables操作事例
[root@nginx02 ~]
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@nginx02 ~]
[root@nginx02 ~]
...
Chain IN_public (0 references)
target prot opt source destination
[root@nginx02 ~]
[root@nginx02 ~]
...
Chain OUT_public (0 references)
target prot opt source destination
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
...
Chain FORWARD (policy DROP)
target prot opt source destination
...
[root@nginx02 ~]
...
Chain IN_public (2 references)
num target prot opt source destination
1 IN_public_log all -- 0.0.0.0/0 0.0.0.0/0
2 IN_public_deny all -- 0.0.0.0/0 0.0.0.0/0
...
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 192.168.88.102
[root@nginx02 ~]
[root@nginx02 ~]
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 192.168.88.102
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- 192.168.88.102 0.0.0.0/0
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 192.168.88.102
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- 192.168.88.102 0.0.0.0/0
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 192.168.88.102 tcp dpt:22
ACCEPT tcp -- 0.0.0.0/0 192.168.88.102 tcp dpt:80
ACCEPT icmp -- 0.0.0.0/0 192.168.88.102
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- 192.168.88.102 0.0.0.0/0 tcp spt:22
ACCEPT tcp -- 192.168.88.102 0.0.0.0/0 tcp spt:80
ACCEPT icmp -- 192.168.88.102 0.0.0.0/0
[root@nginx02 netfilter]
/lib/modules/3.10.0-862.el7.x86_64/kernel/net/netfilter
[root@nginx02 netfilter]
filename: /lib/modules/3.10.0-862.el7.x86_64/kernel/net/netfilter/nf_conntrack_ftp.ko.xz
alias: nfct-helper-ftp
alias: ip_conntrack_ftp
description: ftp connection tracking helper
author: Rusty Russell <rusty@rustcorp.com.au>
license: GPL
retpoline: Y
rhelversion: 7.5
srcversion: 83D9304C9B64D8FBC064040
depends: nf_conntrack
intree: Y
vermagic: 3.10.0-862.el7.x86_64 SMP mod_unload modversions
signer: CentOS Linux kernel signing key
sig_key: 3A:F3:CE:8A:74:69:6E:F1:BD:0F:37:E5:52:62:7B:71:09:E3:2B:96
sig_hashalgo: sha256
parm: ports:array of ushort
parm: loose:bool
[root@nginx02 netfilter]
1
[root@nginx02 netfilter]
262144
[root@nginx02 net]
ipv4 2 tcp 6 299 ESTABLISHED src=192.168.88.1 dst=192.168.88.102 sport=51385 dport=22 src=192.168.88.102 dst=192.168.88.1 sport=22 dport=51385 [ASSURED] mark=0 zone=0 use=2
ipv4 2 tcp 6 431982 ESTABLISHED src=192.168.88.1 dst=192.168.88.102 sport=50469 dport=22 src=192.168.88.102 dst=192.168.88.1 sport=22 dport=50469 [ASSURED] mark=0 zone=0 use=2
ipv4 2 tcp 6 431986 ESTABLISHED src=192.168.88.1 dst=192.168.88.102 sport=51384 dport=22 src=192.168.88.102 dst=192.168.88.1 sport=22 dport=51384 [ASSURED] mark=0 zone=0 use=2
[root@nginx02 netfilter]
[ 232.452376] nf_conntrack version 0.5.0 (65536 buckets, 262144 max)
[root@nginx02 netfilter]
65536
[root@nginx02 netfilter]
432000
[root@nginx02 netfilter]
[root@nginx02 netfilter]
[root@nginx02 netfilter]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 netfilter]
[root@nginx02 netfilter]
[root@nginx02 netfilter]
nf_conntrack_ftp 18638 0
nf_conntrack 133053 7 nf_nat,nf_nat_ipv4,nf_nat_ipv6,xt_conntrack,nf_conntrack_ftp,nf_conntrack_ipv4,nf_conntrack_ipv6
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
[root@nginx02 ~]
|