Surviving Chaos
  • Surviving Chaos
  • A Brief Intoduction to Chaos
    • Principles of Chaos
    • Kinds of Failure
    • Goals and Non-goals
  • Infrastructure Familiarization
    • Service Resilience
    • Monitoring and Logging
    • Generating Work & Data
  • Assembling Your Kit
    • Using a Cloud Node
    • Using a Private Node
  • A Menagerie of Tools
    • 1000 Ways to Die (`kill`)
    • Failing the Network (`ip`)
    • Controlling Traffic (`tc`)
    • Isolating and Parititioning (`iptables`)
    • A Fuzzy Schedule (`nmz`)
    • A Disfunctional Docker (`pumba`)
  • Failure as a Feature
  • Continous Chaos (CI/CD)
    • Example: Schrödinger
  • Resources / References
Powered by GitBook
On this page
  1. A Menagerie of Tools

Failing the Network (`ip`)

The ip tool lets you manage network links on your system. It also allows you to manipulate some settings related to the links.

Typically, your main Ethernet link is eth0, along with a loopback on lo. If it's not you can use ip address to discover which link is of interest to you. On machines with docker installed you'll also see a docker0 link.

If you're shelled into a machine on a particular link (like eth0) you should avoid taking it down or making the MTU too low.

Changing the State of a Link

Turn it on:

ip link set docker0 up

Turn it off:

ip link set docker0 down

Determine the Link Used for an Address

ip route get 127.0.0.1
# local 127.0.0.1 dev lo src 127.0.0.1 uid 0 
#    cache <local> 
ip route get 8.8.8.8
# 8.8.8.8 via 138.197.128.1 dev eth0 src 138.197.129.130 uid 0 
#    cache

Exercises

  • Interrupt a network link where a client such as psql is running. (Connect via the lo linksudo -u postgres psql -h 127.0.0.1)

  • Change the MTU size of a link with an active daemon connection to something ridicululous, simulating an strange error.

Previous1000 Ways to Die (`kill`)NextControlling Traffic (`tc`)

Last updated 6 years ago