Skip to content

Instantly share code, notes, and snippets.

View KaiSforza's full-sized avatar
🔁

Kai Sforza KaiSforza

🔁
View GitHub Profile
@Apsu
Apsu / VIP.md
Last active December 24, 2015 08:59
Quick description of VIP failover + local service routing issue

In Linux, when you add an IP to an interface, the kernel creates two routes for you:

table local: local x.x.x.y dev foo proto kernel scope host src x.x.x.y
table main: x.x.x.a/bb dev foo proto kernel scope link src x.x.x.y

Now, if you are setting up an HA pair or cluster, you will often have a VIP -- a "virtual" or "floating" IP -- which is moved between boxes during failovers. And if you happen to be running clients on these nodes as well which connect to that VIP, something very odd happens when you move the IP.

So... linux has routing rules, tables, and a cache. When a connection is made, the cache is consulted for a matching route tuple (src, dst, tos, fwmark, iif) and if it exists, the connection stores a pointer to it so each packet can rapidly be routed. If the cache entry expires or otherwise goes away, a new route is cloned by following the policy rules to look in the tables.

Now... when an IP you're connected to/from goes away... something very odd happens. The stack realizes that it can

@KaiSforza
KaiSforza / TERMS_OF_USE.rst
Last active October 5, 2015 23:28
Kai.ZNC terms of use. By connecting you agree to this.

Introduction

KaiBNC is a free bouncer. Its use is a privilege, not a right. Breaking any of these rules can result in the following:

  1. Warning. I will message you, telling you what you did wrong in case it was not your fault. I will also contact an operator on that network.
  2. 1 hour account suspension. You will be unable to login to your account for 1 hour. I would like not to get to this point. Your nick will remain connected to IRC for people to message you.
  3. 12 hour ban from ZNC and IRC disconnect. Your service will be suspended and your nick disconnected from IRC. I will warn you before taking your account offline.
  4. 24 hour ban from ZNC, IRC disconnect, and report to a global/local operator on that network.
  5. Account deletion, report to global/local operator on that network.