Advertisement
iklio

Untitled

Sep 22nd, 2013
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. #Add table "admin" to /etc/iproute2/rt_tables
  3. myotherdevice=eth0
  4. myothernetwork=10.0.0
  5. myothergateway=10.0.0.138
  6. myotherip=$(ifconfig | grep $myothernetwork | cut -d: -f2 | cut -f1 -d' ')
  7. ip route add ${myothernetwork}.0/24 dev $myotherdevice src $myotherip table admin
  8. ip route add default via $myothergateway dev $myotherdevice table admin
  9. ip rule add from ${myotherip}/32 table admin
  10. ip rule add to ${myotherip}/32 table admin
  11. ip route flush cache
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement