用iptables写一条规则不允许172.16.0.0/16的网段访问本设备,以下哪项规则写法是正确的? ( )。
A: iptables –t filter –A INPUT –s 172.16.0.0/16 –p all –j DROP
B: iptables –t filter –P INPUT –s 172.16.0.0/16 –p all –j DROP
C: iptables –t filter –A INPUT –s 172.16.0.0/16 –p all –j ACCEPT
D: iptables –t filter –P INPUT –s 172.16.0.0/16 –p all –j ACCEPT
A: iptables –t filter –A INPUT –s 172.16.0.0/16 –p all –j DROP
B: iptables –t filter –P INPUT –s 172.16.0.0/16 –p all –j DROP
C: iptables –t filter –A INPUT –s 172.16.0.0/16 –p all –j ACCEPT
D: iptables –t filter –P INPUT –s 172.16.0.0/16 –p all –j ACCEPT
举一反三
- 允许tcp协议的数据包在20端口进行数据传输的正确语句是( <br/>) A: iptables <br/>-A INPUT -p tcp <br/>--dport 20 -j ACCEPT B: iptables <br/>-A INPUT -p tcp <br/>--dport 20 -j DROP C: iptables <br/>-A INPUT -p tcp <br/>--dport 25 -j ACCEPT <br/>D、iptables <br/>-A INPUT -p udp <br/>--dport 20 -j ACCEPT
- 用iptables写一条规则不允许172.16.0.0/16的网段访问本设备,以下哪项规则写法是正确的()。 A: iptables-tfilter-pINPUT-s172.16.0.0/16-pall-jACCEPT B: iptables-tfilter-pINPUT-d172.16.0.0/16-pall-jACCEPT C: iptables-tfilter-pINPUT-s172.16.0.0/16-pall-jDROP D: iptables-tfilter-AINPUT-s172.16.0.0/16-pall-jDROP
- 执行命令iptables -P INPUT DROP可把iptables服务的INPUT规则链默认策略设置为DROP。
- 如果想要防止199.88.77.0/24网络用TCP分组连接端口21, iptables命令( ): A: iptables –A FORWARD –s 199.88.77.0/24 –p tcp –-dport 21 –j REJECT B: iptables –A FORWARD –s 199.88.77.0/24 –p tcp -dport 21 –j REJECT C: iptables –a forward –s 199.88.77.0/24 –p tcp –-dport 21 –j reject D: iptables –A FORWARD –s 199.88.77.0/24 –p tcp –dport 21 –j DROP
- 命令iptables -P INPUT ACCEPT的作用是?