diff options
author | Erik Troan <ewt@redhat.com> | 1998-03-10 15:09:33 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 1998-03-10 15:09:33 +0000 |
commit | f4ff5c957f22d8fbbe27b6dadd8f1c6e029a956d (patch) | |
tree | efa33f61615aa7b6336119166d5ab7b53739dfba /sysconfig | |
parent | 4fa9ee612c2c06f34f1c44265334f86fcbf24cf5 (diff) | |
download | initscripts-f4ff5c957f22d8fbbe27b6dadd8f1c6e029a956d.tar initscripts-f4ff5c957f22d8fbbe27b6dadd8f1c6e029a956d.tar.gz initscripts-f4ff5c957f22d8fbbe27b6dadd8f1c6e029a956d.tar.bz2 initscripts-f4ff5c957f22d8fbbe27b6dadd8f1c6e029a956d.tar.xz initscripts-f4ff5c957f22d8fbbe27b6dadd8f1c6e029a956d.zip |
use ipcalc to calculate netmask and/or broadcast address
Diffstat (limited to 'sysconfig')
-rwxr-xr-x | sysconfig/network-scripts/ifup | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index 3f791533..672f803c 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -113,6 +113,14 @@ elif [ "$BOOTPROTO" = dhcp -a "$ISALIAS" = no ]; then fi if [ "$IPSETUP" != yes ]; then + if [ -z "$BROADCAST" ]; then + eval `/sbin/ipcalc --broadcast ${IPADDR} ${NETMASK}` + fi + + if [ -z "$NETMASK" ]; then + eval `/sbin/ipcalc --netmask ${IPADDR} ${NETMASK}` + fi + ifconfig ${DEVICE} ${MACADDR:+hw ether $MACADDR} ${IPADDR} \ netmask ${NETMASK} broadcast ${BROADCAST} if [ "$ISALIAS" = no ] ; then |