Created
March 5, 2018 10:24
-
-
Save johanek/92f4a76b6c3f2727ebaf330a22d34b0c to your computer and use it in GitHub Desktop.
[ip route unreachable] Simulate dropped data or unreachable destination with ip route
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# blackhole all packets destined for 192.168.2.1 | |
ip route add blackhole 192.168.2.1 | |
# to delete the same route, replace add with del | |
ip route del blackhole 192.168.2.1 | |
#Depending on your use case, an unreachable route may work better, as it returns ICMP-unreachable instead of discarding the packets, although they tend to have the same effect. | |
ip route add unreachable 192.168.2.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment