|
|
@ -105,8 +105,12 @@ IPADDR=$IP
|
|
|
|
EOT
|
|
|
|
EOT
|
|
|
|
|
|
|
|
|
|
|
|
if [ -n "$GATEWAY" ]; then
|
|
|
|
if [ -n "$GATEWAY" ]; then
|
|
|
|
|
|
|
|
if [ "$CONFIG_PATH" = "/etc/sysconfig/network" ]; then
|
|
|
|
|
|
|
|
echo "default $GATEWAY - $DEV" >> /etc/sysconfig/network/ifroute-$DEV
|
|
|
|
|
|
|
|
else
|
|
|
|
echo "GATEWAY=$GATEWAY"
|
|
|
|
echo "GATEWAY=$GATEWAY"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ -n "$MTU" ]; then
|
|
|
|
if [ -n "$MTU" ]; then
|
|
|
|
echo "MTU=$MTU"
|
|
|
|
echo "MTU=$MTU"
|
|
|
@ -125,8 +129,12 @@ EOT
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ -n "$GATEWAY6" ]; then
|
|
|
|
if [ -n "$GATEWAY6" ]; then
|
|
|
|
|
|
|
|
if [ "$CONFIG_PATH" = "/etc/sysconfig/network" ]; then
|
|
|
|
|
|
|
|
echo "default $GATEWAY6 - $DEV" >> /etc/sysconfig/network/ifroute-$DEV
|
|
|
|
|
|
|
|
else
|
|
|
|
echo "IPV6_DEFAULTGW=$GATEWAY6"
|
|
|
|
echo "IPV6_DEFAULTGW=$GATEWAY6"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ -n "$MTU" ]; then
|
|
|
|
if [ -n "$MTU" ]; then
|
|
|
|
echo "IPV6_MTU=$MTU"
|
|
|
|
echo "IPV6_MTU=$MTU"
|
|
|
@ -153,6 +161,12 @@ get_dev()
|
|
|
|
|
|
|
|
|
|
|
|
gen_network_configuration()
|
|
|
|
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)
|
|
|
|
INTERFACE_MAC=$(get_interface_mac)
|
|
|
|
CONTEXT_INTERFACES=$(get_context_interfaces)
|
|
|
|
CONTEXT_INTERFACES=$(get_context_interfaces)
|
|
|
|
GATEWAY_IFACE_NUM=$(echo "$GATEWAY_IFACE" | sed 's/^ETH//')
|
|
|
|
GATEWAY_IFACE_NUM=$(echo "$GATEWAY_IFACE" | sed 's/^ETH//')
|
|
|
@ -179,17 +193,23 @@ gen_network_configuration()
|
|
|
|
[ -z "${DEV}" ] && continue
|
|
|
|
[ -z "${DEV}" ] && continue
|
|
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
(
|
|
|
|
|
|
|
|
rm -f /etc/sysconfig/network/ifroute-$DEV
|
|
|
|
cat <<EOT
|
|
|
|
cat <<EOT
|
|
|
|
DEVICE=$DEV
|
|
|
|
DEVICE=$DEV
|
|
|
|
BOOTPROTO=none
|
|
|
|
BOOTPROTO=static
|
|
|
|
ONBOOT=yes
|
|
|
|
|
|
|
|
NM_CONTROLLED=no
|
|
|
|
NM_CONTROLLED=no
|
|
|
|
TYPE=Ethernet
|
|
|
|
TYPE=Ethernet
|
|
|
|
EOT
|
|
|
|
EOT
|
|
|
|
|
|
|
|
if [ "$CONFIG_PATH" = "/etc/sysconfig/network" ]; then
|
|
|
|
|
|
|
|
echo "STARTMODE=auto"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
echo "ONBOOT=yes"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
[[ -n $IP ]] && gen_iface_conf
|
|
|
|
[[ -n $IP ]] && gen_iface_conf
|
|
|
|
[[ -n $IP6 ]] && gen_iface6_conf
|
|
|
|
[[ -n $IP6 ]] && gen_iface6_conf
|
|
|
|
|
|
|
|
|
|
|
|
) > /etc/sysconfig/network-scripts/ifcfg-${DEV}
|
|
|
|
) > ${CONFIG_PATH}/ifcfg-${DEV}
|
|
|
|
|
|
|
|
|
|
|
|
ifup ${DEV}
|
|
|
|
ifup ${DEV}
|
|
|
|
|
|
|
|
|
|
|
|