IPtables相关使用

IPtables相关使用

我正在自学Linux iptables。我正在做一些我在网上找到的实验。我需要解决这些问题:我正在使用 Vmware 来解决这个问题。我的Windows机器IP是:192.168.48.129,我的虚拟机IP是172.17.40.100

对此部分执行以下步骤:

Make certain that you have iptables services enabled and running instead of Firewalld.
Modify the iptables to meet the following conditions:

            1. All outgoing traffic is allowed.
            2. Responses to any traffic the machine sends out are allowed.
            Traffic on the loopback interface is allowed.
            3. The host machine (and only the host machine) must be able to ssh to that cloning-source VM.
            4. ICMP traffic is allowed if it originated with the local network only.
            5. As this is acting as the secure basis for later machines, no other traffic should be allowed, and no response should be sent if any other traffic is received.

我的回答如下:

**1. iptables -P 输出接受

  1. iptables -I 输出 -j 接受

  2. iptables -I 输入 -p tcp -s 192.168.48.129 --sport 22 -j 接受

  3. iptables -I 输入 -p icmp -s 172.17.40.0/24 -j 接受

  4. iptables -P 输入丢弃 **

相关内容