Installer/Updater
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
923 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #!/bin/sh
  2. set -e
  3. # Description: Add routes to allow communication between machines which
  4. # only have an IPv4LL address assigned and those which only
  5. # have a routable address assigned.
  6. #
  7. # See http://developer.apple.com/qa/qa2004/qa1357.html for
  8. # more information.
  9. [ -x /usr/sbin/avahi-autoipd ] || exit 0
  10. [ "$IFACE" != "lo" ] || exit 0
  11. case "$ADDRFAM" in
  12. inet) ;;
  13. *) exit 0 ;;
  14. esac
  15. case "$METHOD" in
  16. static|dhcp|NetworkManager) ;;
  17. *) exit 0 ;;
  18. esac
  19. if [ -x /bin/ip ]; then
  20. # route already present?
  21. ip route show | grep -q '^169.254.0.0/16[[:space:]]' && exit 0
  22. /bin/ip route add 169.254.0.0/16 dev $IFACE metric 1000 scope link
  23. elif [ -x /sbin/route ]; then
  24. # route already present?
  25. /sbin/route -n | egrep -q "^169.254.0.0[[:space:]]" && exit 0
  26. /sbin/route add -net 169.254.0.0 netmask 255.255.0.0 dev $IFACE metric 1000
  27. fi