Ignore:
Timestamp:
Oct 31, 2006, 9:38:50 PM (18 years ago)
Author:
Jim Gifford <clfs@…>
Branches:
clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
Children:
728f219
Parents:
0928ac4
Message:

Added the ability to have network subinterfaces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bootscripts/clfs/sysconfig/network-devices/services/ipv4-static

    r0928ac4 refc99f2  
    5151        up)
    5252                boot_mesg "Adding IPv4 address ${IP} to the ${1} interface..."
    53                 ip addr add ${args} dev ${1}
     53                if [ "${INTERFACE}" != "" ]; then
     54                        ip addr add ${args} dev ${1} label ${1}
     55                else
     56                        ip addr add ${args} dev ${1}
     57                fi
    5458                evaluate_retval
    5559       
    56                 if [ -n "${GATEWAY}" ]; then
    57                         if ip route | grep -q default; then
    58                                 boot_mesg "Gateway already setup; skipping." ${WARNING}
    59                                 echo_warning
    60                         else
    61                                 boot_mesg "Setting up default gateway..."
    62                                 ip route add default via ${GATEWAY} dev ${1}
    63                                 evaluate_retval
    64                          fi
     60                if [ "${INTERFACE}" = "" ]; then
     61                        if [ -n "${GATEWAY}" ]; then
     62                                if ip route | grep -q default; then
     63                                        boot_mesg "Gateway already setup; skipping." ${WARNING}
     64                                        echo_warning
     65                                else
     66                                        boot_mesg "Setting up default gateway..."
     67                                        ip route add default via ${GATEWAY} dev ${1}
     68                                        evaluate_retval
     69                                 fi
     70                        fi
    6571                fi
    6672        ;;
    6773       
    6874        down)
    69                 if [ -n "${GATEWAY}" ]; then
    70                         boot_mesg "Removing default gateway..."
    71                         ip route del default
     75                if [ "${INTERFACE}" = "" ]; then
     76                        boot_mesg "Removing Settings From ${1} interface..."
     77                        ip address flush dev ${1}
    7278                        evaluate_retval
    7379                fi
    74        
    75                 boot_mesg "Removing IPv4 address ${IP} from the ${1} interface..."
    76                 ip addr del ${args} dev ${1}
    77                 evaluate_retval
    7880        ;;
    7981       
Note: See TracChangeset for help on using the changeset viewer.