mirror of the now-defunct rocklinux.org
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.

27 lines
448 B

  1. iproute2_init_if() {
  2. if isfirst "iproute2_$if"; then
  3. addcode up 5 4 "ip link set $if up"
  4. addcode down 5 4 "ip link set $if down"
  5. addcode down 5 5 "ip addr flush dev $if"
  6. fi
  7. }
  8. public_ip() {
  9. addcode up 5 5 "ip addr add $1 dev $if"
  10. iproute2_init_if
  11. }
  12. public_gw() {
  13. code="ip route add default via $1 dev $if" ; shift
  14. case "$1" in
  15. metric)
  16. code="$code metric $2" ; shift ;;
  17. esac
  18. shift
  19. addcode up 6 5 "$code"
  20. iproute2_init_if
  21. }