Recently, I have the need to block the ip address on the Linux host, here are some notes.
route command require root privilege.
List active connection
netstat -tcp --numeric
Check current routing table
/sbin/route -n

Reject ip using routing table
/sbin/route add -host 192.168.56.1 reject

Remove the rule from routing table
/sbin/route del -host 192.168.56.1 reject
0 comments:
Post a Comment