# --- ROCK-COPYRIGHT-NOTE-BEGIN --- # # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # Please add additional copyright information _after_ the line containing # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by # the ./scripts/Create-CopyPatch script. Do not edit this copyright text! # # ROCK Linux: rock-src/package/base/iproute2/network.conf # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. A copy of the GNU General Public # License can be found at Documentation/COPYING. # # Many people helped and are helping developing ROCK Linux. Please # have a look at http://www.rocklinux.org/ and the Documentation/TEAM # file for details. # # --- ROCK-COPYRIGHT-NOTE-END --- # # This file defines two shell functions: start_net() and stop_net() # # This functions are called by /etc/init.d/network to set up and shut # down the networking stuff. In most cases its enought to change this # variables. If your setup is more complex you need to rewrite the # functions below. # DHCP="on" IF="eth0" IPADDR="192.168.5.10/24" GATEWAY="192.168.5.1" # # start and stop functions (called by /etc/init.d/network) # xx() { echo ">> $*" ; eval "$*" ; return $? ; } start_net() { if [ -f /etc/mactab ]; then xx nameif -c /etc/mactab fi if [ ".$DHCP" = ".on" ]; then xx /sbin/dhclient -q $IF else xx ip link set $IF up for addr in $IPADDR; do xx ip addr add $addr dev $IF done [ "$GATEWAY" ] && xx ip route add default via $GATEWAY fi return 0 } stop_net() { if [ ".$DHCP" = ".on" ]; then xx killall -15 /sbin/dhclient fi xx ip route del default xx ip addr flush dev $IF xx ip link set $IF down return 0 }