ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

2020.9.20 第三次作业 iptables

2020-09-21 11:50:22  阅读:260  来源: 互联网

标签:iptables 10.0 20 2020.9 0.0 192.168 255.255 root eth0


1. 拒绝所有主机ping当前主机

iptables -A INPUT -p icmp --icmp-type 8 -j REJECT

2. 本机能够访问别的机器的HTTP服务,但是别的机器无法访问本机

iptables -A INPUT -p tcp --syn --dport 80 -j REJECT

3. 当我们发现有 ip 恶意***我们得时候,我们可以通过对防火墙设定规则来进行控制。所以我们可以添加connlimit模块来实现对最大并发得控制。请写出步骤

# 限制每IP所能够发起并发连接数为8
iptables -A INPUT -m connlimit --connlimit-above 8 -j REJECT

4. 实践题

互联网中的主机:

[root@centos6 ~]$hostname -I
192.168.1.128
[root@centos6 ~]$route -n 
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
0.0.0.0         192.168.1.129   0.0.0.0         UG    0      0        0 eth0

防火墙:

[root@centos8 ~]$hostname -I
10.0.0.8 192.168.1.129
[root@centos8 ~]$route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.2        0.0.0.0         UG    100    0        0 eth0
10.0.0.0        0.0.0.0         255.255.255.0   U     100    0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     101    0        0 eth1
[root@centos8 ~]$cat /proc/sys/net/ipv4/ip_forward
1

局域网服务器:

[root@centos7 ~]$hostname -I
10.0.0.18
[root@centos7 ~]$route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.8        0.0.0.0         UG    0      0        0 eth0
10.0.0.0        0.0.0.0         255.255.255.0   U     100    0        0 eth0

标签:iptables,10.0,20,2020.9,0.0,192.168,255.255,root,eth0
来源: https://blog.51cto.com/14893909/2536425

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有