Skip to content

Instantly share code, notes, and snippets.

@oilbeater
Created July 2, 2017 06:11
Show Gist options
  • Save oilbeater/614801f428391a7b67ae422fbf5f65b6 to your computer and use it in GitHub Desktop.
Save oilbeater/614801f428391a7b67ae422fbf5f65b6 to your computer and use it in GitHub Desktop.
Modify calico route rules.
#!/bin/bash
while :
do
address=`ifconfig bond0 | grep inet | grep -v inet6|awk '{print $2}'`
echo $address
ip route | grep cali | grep -v src | while read -r line ;
do
ip route replace $line src $address
done
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment