FAKE(8)

πŸ’– FAKE(8) β€” the IP address takeover tool bestie πŸ’–

okay so this is a System Manager's Manual page for fake, and honestly? it's giving main character energy for your whole failover setup. let's get into it 🫢


✨ NAME ✨

fake β€” IP address takeover tool. that's it, that's the whole vibe. she takes over an IP address. periodt. πŸ’…


🌸 SYNOPSIS 🌸

fake [remove] IP_ADDRESS

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie: the fake utility enables the switching in of a backup server by bringing up an additional interface and then using ARP spoofing to take over IP_ADDRESS. iconic behaviour, no cap.

Variants of this script have been used extensively at Zip World (http://www.zipworld.com.au/) for backing up mail, web and proxy servers. ngl that's a lot of responsibility for one little script. πŸ’€

⚠️ okay real talk though β€” even though this system has been shown to work, you are well advised to test the system thoroughly before putting it into production. like, please. test it. fr fr. 😭

Please read the documents in /usr/share/doc/fake/ for an explanation of how fake works and for a discussion of issues surrounding its use. it's required reading, iykyk. πŸ“š


πŸŽ€ OPTIONS πŸŽ€

  • remove β€” Stop the takeover of an IP address. Without this option, fake starts the takeover of an IP address. so it's like a lil on/off switch, but the "off" is spelled remove. slay. πŸ”₯

πŸ’œ GLOBAL CONFIGURATION FILE πŸ’œ

The global configuration file lives at /etc/fake/.fakerc. The settings there are overridden by those in ${HOME}/.fakerc. so your homegirl config wins, always. πŸ‘‘

Here is a sample configuration file β€” literally verbatim, don't @ me:

############################################################
# Set up basic environment for fake
# Variables are set as bash variables
# i.e. <VARIABLE>=<value>
#
# Must set:
#  ARP_DELAY: Delay in seconds between gratuitous ARP
#  PID_DIR: Directory where PID files are kept
#  INSTANCE_CONFIG_DIR: Directory where specific
#   configuration files for an IP address takeover are kept
#  CLEAR_ROUTERS_FILE: New line delimited list of routers to rsh
#    to and execute "clear arp-cache"
#  FAKE_RSH: Programme to use to "rsh" to another machine
#    to obtain macaddress by running ifconfig
#
# PATH can be set here to ensure that send_arp is in the
#  path
############################################################

FAKE_HOME="/etc/fake"

#PATH=/sbin:/usr/sbin:/bin:/usr/bin

ARP_DELAY=1
CLEAR_ROUTERS_FILE="$FAKE_HOME/clear_routers"
PID_DIR="/var/run"
INSTANCE_CONFIG_DIR="$FAKE_HOME/instance_config"

#Only needed if you wish to send gratuitous ARP
#advertising the "real" mac address when turning fake off
#FAKE_RSH=ssh

🌈 INSTANCE CONFIGURATION 🌈

To configure an instance of fake, create /etc/fake/instance_config/<IP-address-to-take-over>.cfg with the following format:

SPOOF_IP=<IP-address-to-take-over>

The SPOOF_IP variable must contain the same IP address as appears in the name of the file. this is checked at run time. so if you name the file one thing and put another thing inside, she WILL notice. πŸ™ˆ

IFCONFIG=TRUE|FALSE
SPOOF_NETMASK=<netmask-of-network-that-IP-address-to-take-over-is-on>
TARGET_INTERFACE=<interface-to-bring-up>

If the IFCONFIG variable is set to TRUE, the address specified by SPOOF_IP will be brought up on the interface specified by TARGET_INTERFACE; SPOOF_NETMASK and TARGET_INTERFACE must also be defined. no skipping steps bestie. ✨

🚨 For obvious reasons it is very important that the TARGET_INTERFACEs of running instances of fake all be different from one another. like, literally different. do not clone them. i'm begging. 😭

Optionally, if you wish to rsh to the main server and advertise the "real" MAC address when turning fake off, then set the following:

FOREIGN_INTERFACE=<interface-on-foreign-host-with-MAC-address-to-use>
FOREIGN_ARP=<number-of-ARPs-to-send-with-real-MAC-address>

To use this last feature in an automated fashion you will need to be able to $FAKE_RSH to $SPOOF_IP from the host that fake runs on without manual authentication. With rsh this is typically achived using .rhosts; with ssh an RSH key with an empty passphrase can be employed. (yes, the original says "achived". i'm keeping it. it's part of her charm. 🫢)

Here is an example of /etc/fake/instance_config/203.12.97.7.cfg:

SPOOF_IP=203.12.97.7
IFCONFIG=TRUE
SPOOF_NETMASK=255.255.255.0
TARGET_INTERFACE=eth0:2
FOREIGN_INTERFACE=eth0
FOREIGN_ARP=5

⭐ ACTIVATION ⭐

To activate fake, run:

fake <IP-address-to-take-over> &

Logs will be made to the local0.notice syslog facility. πŸ“

On startup you should see messages in the syslog; running ifconfig should show the new interface; running route should show a route for the spoofed IP address on the new interface (which is needed so the machine that fake is running on can communicate correctly to this IP address); and running tcpdump -i <interface> arp should show the gratuitous ARP packets. it's giving "everything is working, you're so valid". πŸ”₯


🧚 DEACTIVATION 🧚

To deactivate, run:

fake remove <IP-address-to-take-over>

As of version 1.1.2 the fake process can be sent a SIGTERM or SIGHUP to effect the removal. signals, but make it graceful. πŸ’…

On removal you should see a message in the syslog; ifconfig should show that the new interface has been removed; route should show that the new route has been removed; and tcpdump should show that the gratuitous ARP has stopped. clean exit, we love to see it. ✨

πŸ“Œ Note: Activating fake multiple times with the same arguments has the same effect as activating it once. Similarly, deactivating fake multiple times with the same arguments has the same effect as deactivating it once. so don't stress about double-tapping, she's idempotent and unbothered. 😌

πŸ“ FILES πŸ“

  • /etc/fake/.fakerc
  • /etc/fake/clear_routers
  • /etc/fake/instance_config/<IP-address>.cfg
  • /var/run/fake.<IP-address>.pid

πŸ‘‘ AUTHOR πŸ‘‘

Horms <horms@verge.net.au> β€” the original icon, the blueprint, the moment. πŸ’–


and that's the whole page bestie!! this manual was dated 9 June 2004 and came out of the System Manager's Manual collection β€” ancient text, still slaying. go forth and take over those IPs responsibly. πŸŽ€πŸ’œβœ¨

πŸ“¦ where this page comes from