|
|
|
@ -106,6 +106,9 @@ EOT
|
|
|
|
|
|
|
|
|
|
if [ -n "$GATEWAY" ]; then
|
|
|
|
|
echo "GATEWAY=$GATEWAY"
|
|
|
|
|
if [ -d /etc/sysconfig/network ]; then
|
|
|
|
|
echo "default $GATEWAY - -" >> /etc/sysconfig/network/routes
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ -n "$MTU" ]; then
|
|
|
|
@ -126,6 +129,9 @@ EOT
|
|
|
|
|
|
|
|
|
|
if [ -n "$GATEWAY6" ]; then
|
|
|
|
|
echo "IPV6_DEFAULTGW=$GATEWAY6"
|
|
|
|
|
if [ -d /etc/sysconfig/network ]; then
|
|
|
|
|
echo "default $GATEWAY6 - -" >> /etc/sysconfig/network/routes
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ -n "$MTU" ]; then
|
|
|
|
@ -153,6 +159,12 @@ get_dev()
|
|
|
|
|
|
|
|
|
|
gen_network_configuration()
|
|
|
|
|
{
|
|
|
|
|
if [ -d /etc/sysconfig/network-scripts ]; then
|
|
|
|
|
CONFIG_PATH=/etc/sysconfig/network-scripts
|
|
|
|
|
elif [ -d /etc/sysconfig/network ]; then
|
|
|
|
|
CONFIG_PATH=/etc/sysconfig/network
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
INTERFACE_MAC=$(get_interface_mac)
|
|
|
|
|
CONTEXT_INTERFACES=$(get_context_interfaces)
|
|
|
|
|
GATEWAY_IFACE_NUM=$(echo "$GATEWAY_IFACE" | sed 's/^ETH//')
|
|
|
|
@ -179,9 +191,10 @@ gen_network_configuration()
|
|
|
|
|
[ -z "${DEV}" ] && continue
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
|
rm -f /etc/sysconfig/network/routes
|
|
|
|
|
cat <<EOT
|
|
|
|
|
DEVICE=$DEV
|
|
|
|
|
BOOTPROTO=none
|
|
|
|
|
BOOTPROTO=static
|
|
|
|
|
ONBOOT=yes
|
|
|
|
|
NM_CONTROLLED=no
|
|
|
|
|
TYPE=Ethernet
|
|
|
|
@ -189,7 +202,7 @@ EOT
|
|
|
|
|
[[ -n $IP ]] && gen_iface_conf
|
|
|
|
|
[[ -n $IP6 ]] && gen_iface6_conf
|
|
|
|
|
|
|
|
|
|
) > /etc/sysconfig/network-scripts/ifcfg-${DEV}
|
|
|
|
|
) > ${CONFIG_PATH}/ifcfg-${DEV}
|
|
|
|
|
|
|
|
|
|
ifup ${DEV}
|
|
|
|
|
|
|
|
|
|