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.

67 lines
1.9 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/iproute2/network.conf
  9. # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. #
  23. # This file defines two shell functions: start_net() and stop_net()
  24. #
  25. # This functions are called by /etc/init.d/network to set up and shut
  26. # down the networking stuff. In most cases its enought to change this
  27. # variables. If your setup is more complex you need to rewrite the
  28. # functions below.
  29. #
  30. DHCP="on"
  31. IF="eth0"
  32. IPADDR="192.168.5.10/24"
  33. GATEWAY="192.168.5.1"
  34. #
  35. # start and stop functions (called by /etc/init.d/network)
  36. #
  37. xx() { echo ">> $*" ; eval "$*" ; return $? ; }
  38. start_net() {
  39. if [ -f /etc/mactab ]; then
  40. xx nameif -c /etc/mactab
  41. fi
  42. if [ ".$DHCP" = ".on" ]; then
  43. xx /sbin/dhclient -q $IF
  44. else
  45. xx ip link set $IF up
  46. for addr in $IPADDR; do
  47. xx ip addr add $addr dev $IF
  48. done
  49. [ "$GATEWAY" ] && xx ip route add default via $GATEWAY
  50. fi
  51. return 0
  52. }
  53. stop_net() {
  54. if [ ".$DHCP" = ".on" ]; then
  55. xx killall -15 /sbin/dhclient
  56. fi
  57. xx ip route del default
  58. xx ip addr flush dev $IF
  59. xx ip link set $IF down
  60. return 0
  61. }