Skip to content

Instantly share code, notes, and snippets.

@cuihaoleo
Created August 22, 2015 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cuihaoleo/9e8de22649e7c74a30f1 to your computer and use it in GitHub Desktop.
Save cuihaoleo/9e8de22649e7c74a30f1 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
if [[ $IFACE == "vlan95" ]]; then
ip route add 202.38.95.0/25 dev vlan95 table 1000
ip route add default via 202.38.95.126 table 1000
ip rule add from 202.38.95.110 table 1000
fi
if [[ $IFACE == "vlan10" ]]; then
ip route add 202.141.160.0/25 dev vlan10 table 1001
ip route add default via 202.141.160.126 table 1001
ip rule add from 202.141.160.110 table 1001
fi
if [[ $IFACE == "vlan400" ]]; then
ip route add 202.141.176.0/25 dev vlan400 table 1002
ip route add default via 202.141.176.126 table 1002
ip rule add from 202.141.176.110 table 1002
ip route add default via 202.141.176.126
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment