三个人一起躁我吃奶头80分钟,三年片大全免费观看,三年片免费观看影视大全满天星,三年成全免费高清大全,三年片免费观看大全有,三年片在线观看大全

  • IDC銷(xiāo)售:020-66849165/66849090/66849088
  • 云服務(wù)銷(xiāo)售:020-66849108/9091 | 客服(備案,域名,虛機(jī),郵箱):020-66849000-2

登錄 | 會(huì)員注冊(cè) | 控制面板 | 幫助中心 | 購(gòu)物車(chē) | 舉報(bào)中心

幫助中心FAQ

# iptables filter

 

- iptables -F #清空所有規(guī)則

- service iptables save #保存規(guī)則

- iptables -t nat #-t指定表

- iptables -Z #將計(jì)數(shù)器清零

- iptables -A INPUT -s 192.168.188.1 -p tcp --sport 1234 -d 192.168.188.128 --dport 80 -j DROP

- iptables -I/-A/-D INPUT -s 1.1.1.1 -j DROP

- iptables -I INPUT -s 192.168.1.0/24 -i eth0 -j ACCEPT

- iptables -nvL --line-numbers

- iptables -D INPUT 1

- iptables -P INPUT DROP

 

 

 

 

 

 

```

[root@localhost ~]# iptables -nvL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

  193 12868 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           

0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           

6   552 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:22

   10  2365 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain OUTPUT (policy ACCEPT 112 packets, 12324 bytes)

 pkts bytes target     prot opt in     out     source               destination         

```

iptables規(guī)則記錄在/etc/sysconfig/iptables的配置文件中

```

[root@localhost ~]# cat /etc/sysconfig/iptables

# sample configuration for iptables service

# you can edit this manually or use system-config-firewall

# please do not ask us to add additional ports/services to this default configuration

*filter

:INPUT ACCEPT [0:0]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

-A INPUT -p icmp -j ACCEPT

-A INPUT -i lo -j ACCEPT

-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT

-A INPUT -j REJECT --reject-with icmp-host-prohibited

-A FORWARD -j REJECT --reject-with icmp-host-prohibited

COMMIT[root@localhost ~]# iptables -F

```

```

[root@localhost ~]# iptables -nvL

Chain INPUT (policy ACCEPT 6 packets, 428 bytes)

 pkts bytes target     prot opt in     out     source               destination         

 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

 

Chain OUTPUT (policy ACCEPT 4 packets, 448 bytes)

 pkts bytes target     prot opt in     out     source               destination

[root@localhost ~]# cat /etc/sysconfig/iptables

# sample configuration for iptables service

# you can edit this manually or use system-config-firewall

# please do not ask us to add additional ports/services to this default configuration

*filter

:INPUT ACCEPT [0:0]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

-A INPUT -p icmp -j ACCEPT

-A INPUT -i lo -j ACCEPT

-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT

-A INPUT -j REJECT --reject-with icmp-host-prohibited

-A FORWARD -j REJECT --reject-with icmp-host-prohibited

COMMIT

 

```

重啟服務(wù),iptables規(guī)則重置

```

[root@localhost ~]# service iptables restart

Redirecting to /bin/systemctl restart iptables.service

[root@localhost ~]# iptables -nvL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

8   576 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           

0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           

0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:22

0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain OUTPUT (policy ACCEPT 5 packets, 716 bytes)

 pkts bytes target     prot opt in     out     source               destination

[root@localhost ~]# service iptables save

 

```

 

```

[root@localhost ~]# iptables -t filter -nvL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

   68  4536 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           

0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           

0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:22

1   229 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain OUTPUT (policy ACCEPT 38 packets, 5024 bytes)

 pkts bytes target     prot opt in     out     source               destination

[root@localhost ~]# iptables -t nat -nvL

Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

 

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

 

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

 

Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination

```

iptables -Z #將計(jì)數(shù)器清零pktsbytes

```

[root@localhost ~]# iptables -Z ; iptables -nvL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           

0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           

0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:22

0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination

```

 

[root[@localhost](https://my.oschina.net/u/570656) ~]# iptables -A INPUT -s 192.168.188.1 -p tcp --sport 1234 -d 192.168.188.128 --dport 80 -j DROP/REJECT

 

iptables -A #插入到后面

```

[root@localhost ~]# iptables -A INPUT -s 192.168.188.1 -p tcp --sport 1234 -d 192.168.188.128 --dport 80 -j DROP

[root@localhost ~]# iptables -nvL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

  354 23684 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           

0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           

   13  1196 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:22

  383 47064 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

0     0 DROP       tcp  --  *      *       192.168.188.1        192.168.188.128      tcp spt:1234 dpt:80

 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain OUTPUT (policy ACCEPT 23 packets, 2212 bytes)

 pkts bytes target     prot opt in     out     source               destination

```

> 0     0 DROP       tcp  --  *      *       192.168.188.1        192.168.188.128      tcp spt:1234 dpt:80

 

iptables -I #插入到前面

```

[root@localhost ~]# iptables -I INPUT -p tcp --dport 80 -j DROP

[root@localhost ~]# iptables -nvL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80

  513 35132 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           

0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           

   13  1196 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:22

  384 47308 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

0     0 DROP       tcp  --  *      *       192.168.188.1        192.168.188.128      tcp spt:1234 dpt:80

 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain OUTPUT (policy ACCEPT 7 packets, 1156 bytes)

 pkts bytes target     prot opt in     out     source               destination

 

```

iptables -D #刪除

```

[root@localhost ~]# iptables -D INPUT -p tcp --dport 80 -j DROP

[root@localhost ~]# iptables -nvL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

  605 42492 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           

0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           

   17  1564 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:22

  672 75245 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

0     0 DROP       tcp  --  *      *       192.168.188.1        192.168.188.128      tcp spt:1234 dpt:80

 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain OUTPUT (policy ACCEPT 19 packets, 1972 bytes)

 pkts bytes target     prot opt in     out     source               destination  

[root@localhost ~]# iptables -D INPUT -s 192.168.188.1 -p tcp --sport 1234 -d 192.168.188.128 --dport 80 -j DROP

[root@localhost ~]# iptables -nvL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

  744 55092 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           

0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           

   18  1656 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:22

  673 75489 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain OUTPUT (policy ACCEPT 17 packets, 1628 bytes)

 pkts bytes target     prot opt in     out     source               destination  

```

> 刪除iptables的規(guī)則,但是重新書(shū)寫(xiě)一條規(guī)則或許太麻煩或者忘記規(guī)則的寫(xiě)法時(shí)

 

```

 

[root@localhost ~]# iptables -A INPUT -s 192.168.188.1 -p tcp --sport 1234 -d 192.168.188.128 --dport 80 -j DROP

[root@localhost ~]# iptables -I INPUT -p tcp --dport 80 -j DROP

[root@localhost ~]# iptables -nvL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80

  912 70948 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           

0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           

   18  1656 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:22

  674 75718 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

0     0 DROP       tcp  --  *      *       192.168.188.1        192.168.188.128      tcp spt:1234 dpt:80

 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain OUTPUT (policy ACCEPT 7 packets, 1364 bytes)

 pkts bytes target     prot opt in     out     source               destination

```

iptables -nvL --line-number

```

[root@localhost ~]# iptables -nvL --line-number

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)

num   pkts bytes target     prot opt in     out     source               destination         

1        0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80

2     1010 77416 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

3        0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           

4        0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           

5       18  1656 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:22

6      674 75718 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

7        0     0 DROP       tcp  --  *      *       192.168.188.1        192.168.188.128      tcp spt:1234 dpt:80

 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

num   pkts bytes target     prot opt in     out     source               destination         

1        0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain OUTPUT (policy ACCEPT 59 packets, 7820 bytes)

num   pkts bytes target     prot opt in     out     source               destination

```

```

[root@localhost ~]# iptables -D INPUT 1

[root@localhost ~]# iptables -D INPUT 7

iptables: Index of deletion too big.

[root@localhost ~]# iptables -D INPUT 6

[root@localhost ~]# iptables -nvL --line-number

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)

num   pkts bytes target     prot opt in     out     source               destination         

1     1165 87732 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

2        0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           

3        0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           

4       19  1748 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:22

5      674 75718 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

num   pkts bytes target     prot opt in     out     source               destination         

1        0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain OUTPUT (policy ACCEPT 42 packets, 4056 bytes)

num   pkts bytes target     prot opt in     out     source               destination

```

 

iptables -P #默認(rèn)規(guī)則

```

[root@localhost ~]# iptables -P OUTPUT DROP

```

 

> 終端使用DROP規(guī)則會(huì)使原本數(shù)據(jù)包在22端口通信,接收不了數(shù)據(jù),在返回給客戶端再返回給終端,結(jié)果到達(dá)不了終端,然后接收不了數(shù)據(jù)就會(huì)導(dǎo)致斷開(kāi)終端連接,解決辦法到主機(jī)上將規(guī)則改回ACCEPT

 

```

[root@localhost ~]# iptables -nvL --line-number

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)

num   pkts bytes target     prot opt in     out     source               destination         

1     1165 87732 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

2        0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           

3        0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           

4       19  1748 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:22

5      674 75718 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

num   pkts bytes target     prot opt in     out     source               destination         

1        0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

 

Chain OUTPUT (policy DROP 37 packets, 24648 bytes)

num   pkts bytes target     prot opt in     out     source               destination

[root@localhost ~]# iptables -P OUTPUT ACCEPT

```

 

> -s #ip

-p #指定協(xié)議

--sport #源端口號(hào)

-d #目標(biāo)ip

--dport #目標(biāo)端口號(hào)

-j #行為

 

 

#iptables小案例

 

```

vi /usr/local/sbin/iptables.sh

#!/bin/bash

ipt="/usr/sbin/iptables"

$ipt -F

$ipt -P INPUT DROP

$ipt -P OUTPUT ACCEPT

$ipt -P FORWARD ACCEPT

$ipt -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

$ipt -A INPUT -s 192.168.133.0/24 -p tcp --dport 22 -J ACCEPT

$ipt -A INPUT -p tcp --dprot 80 -j ACCEPT

$ipt -A INPUT -p tcp --dprot 21 -j ACCEPT

 

icmp示例

iptables -I INPUT -p icmp --icmp-type 8 -j DROP

 

```

 

 

```

[root@localhost ~]# vim /usr/local/sbin/iptables.sh

#!/bin/bash

ipt="/usr/sbin/iptables"

$ipt -F

$ipt -P INPUT DROP

$ipt -P OUTPUT ACCEPT

$ipt -P FORWARD ACCEPT

$ipt -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

$ipt -A INPUT -s 192.168.133.0/24 -p tcp --dport 22 -j ACCEPT

$ipt -A INPUT -p tcp --dport 80 -j ACCEPT

$ipt -A INPUT -p tcp --dport 21 -j ACCEPT

```

> tcp協(xié)議里ESTABLISHED是保持連接,RELATED狀態(tài)

 

```

[root@localhost ~]# w

 22:10:01 up 1 day, 20:48,  2 users,  load average: 0.00, 0.01, 0.05

USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT

root     tty1      06:40   15:23m  0.42s  0.42s -bash

root     pts/0     21:50    1.00s  0.45s  0.00s w

[root@localhost ~]# sh /usr/local/sbin/iptables.sh

[root@localhost ~]# iptables -nvL

Chain INPUT (policy DROP 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

   28  1848 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

0     0 ACCEPT     tcp  --  *      *       192.168.133.0/24     0.0.0.0/0            tcp dpt:22

0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80

0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:21

 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

 

Chain OUTPUT (policy ACCEPT 15 packets, 1428 bytes)

 pkts bytes target     prot opt in     out     source               destination

[root@localhost ~]# iptables -nvL

Chain INPUT (policy DROP 1 packets, 229 bytes)

 pkts bytes target     prot opt in     out     source               destination         

   41  2712 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

0     0 ACCEPT     tcp  --  *      *       192.168.133.0/24     0.0.0.0/0            tcp dpt:22

0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80

0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:21

 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

 pkts bytes target     prot opt in     out     source               destination         

 

Chain OUTPUT (policy ACCEPT 27 packets, 3628 bytes)

 pkts bytes target     prot opt in     out     source               destination  

[root@localhost ~]# service iptables restart #此命令為重啟iptables服務(wù)

Redirecting to /bin/systemctl restart iptables.service

```

> 可以看出pkts bytes的值正在增長(zhǎng)

 

 

icmp案例

Windows

```

C:UsersAdministrator>ping 192.168.9.134


正在 Ping 192.168.9.134 具有 32 字節(jié)的數(shù)據(jù):

來(lái)自 192.168.9.134 的回復(fù): 字節(jié)=32 時(shí)間<1ms TTL=64

來(lái)自 192.168.9.134 的回復(fù): 字節(jié)=32 時(shí)間<1ms TTL=64

來(lái)自 192.168.9.134 的回復(fù): 字節(jié)=32 時(shí)間<1ms TTL=64

來(lái)自 192.168.9.134 的回復(fù): 字節(jié)=32 時(shí)間<1ms TTL=64

 

192.168.9.134 Ping 統(tǒng)計(jì)信息:

    數(shù)據(jù)包: 已發(fā)送 = 4,已接收 = 4,丟失 = 0 (0% 丟失),

往返行程的估計(jì)時(shí)間(以毫秒為單位):

    最短 = 0ms,最長(zhǎng) = 0ms,平均 = 0ms

```

Linux

```

[root@localhost ~]# iptables -I INPUT -p icmp --icmp-type 8 -j DROP

```

> 使icmp被禁止了,--icmp-type 8icmp8種類(lèi)型

 

Windows

```

C:UsersAdministrator>ping 192.168.9.134

 

正在 Ping 192.168.9.134 具有 32 字節(jié)的數(shù)據(jù):

請(qǐng)求超時(shí)。

請(qǐng)求超時(shí)。

請(qǐng)求超時(shí)。

請(qǐng)求超時(shí)。

 

192.168.9.134

噶尔县| 清流县| 绥德县| 瑞昌市| 嘉定区| 鄯善县| 宜丰县| 郸城县| 霍林郭勒市| 从江县| 扎赉特旗| 金华市| 溆浦县| 东方市| 什邡市| 周至县| 中牟县| 乌兰察布市| 溧水县| 富宁县| 浏阳市| 福清市| 铜鼓县| 鲁甸县| 威信县| 松原市| 子洲县| 徐州市| 邻水| 二连浩特市| 新兴县| 鲁甸县| 白朗县| 武安市| 当阳市| 富裕县| 邹平县| 成都市| 洪江市| 上虞市| 敦煌市|