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.

19 lines
352 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. addcode up 6 5 "ip route add default via $1 dev $if"
  14. iproute2_init_if
  15. }