This file contains 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
#!/bin/bash | |
# Inserts or removes iptables rules to prevent snat to the hosts local weave ip ranges | |
# This way the source ip will be retained for traffic not coming from weave | |
# Requires weave to be running, the script does wait for weave report to respond | |
echo running $0 $1 | |
action="${1:-start}" | |
echo action: ${action} | |
#functions taken from: https://stackoverflow.com/questions/10768160/ip-address-converter | |
dec2ip () { | |
local ip dec=$@ |