Linux杀手锏之无效路由_route-add-or-del-host-ip-reject
昨天在iptables入门学习之iptables的INPUT,OUTPUT,FORWARD 这篇文章里提到用iptables来封锁一个IP的数据包的进或出。但是如果数据量很大的话,iptables就会随着数据量增大而增加机器的负担。其实对付大流量的攻击,国外的ISP在网络层上直接就block掉,直译为“无效路由”命令是: route add -host ip或者域名 reject
查看路由表,不解析成域名或机器名,只显示IP, 等价于netstat -rn
指定的规则将在重启后失效
- debian:~# route -n
- Kernel IP routing table
- Destination Gateway Genmask Flags Metric Ref Use Iface
- 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
- 0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0