diff --git a/src/etc/one-context.d/loc-10-network##apk.one b/src/etc/one-context.d/loc-10-network##apk.one index a8fac14..f90782b 100755 --- a/src/etc/one-context.d/loc-10-network##apk.one +++ b/src/etc/one-context.d/loc-10-network##apk.one @@ -172,10 +172,6 @@ EOT if [ -n "$GATEWAY6" ]; then echo " gateway $GATEWAY6" - - if [ -n "$METRIC" ]; then - echo " metric $METRIC" - fi fi if [ -n "$IP6_ULA" ]; then diff --git a/src/etc/one-context.d/loc-10-network##deb.one b/src/etc/one-context.d/loc-10-network##deb.one index f810ac8..c89705a 100755 --- a/src/etc/one-context.d/loc-10-network##deb.one +++ b/src/etc/one-context.d/loc-10-network##deb.one @@ -114,7 +114,12 @@ EOT if [ -n "$GATEWAY" ]; then echo " gateway $GATEWAY" + + if [ -n "$METRIC" ]; then + echo " metric $METRIC" + fi fi + echo "" } @@ -232,6 +237,7 @@ EOT MASK=$(get_mask) MTU=$(get_mtu) GATEWAY=$(get_gateway) + METRIC=$(get_iface_var "METRIC") IP6=$(get_iface_var "IP6") [[ -z $IP6 ]] && IP6=$(get_iface_var "IPV6") diff --git a/src/etc/one-context.d/loc-10-network##network-scripts.one b/src/etc/one-context.d/loc-10-network##network-scripts.one index 9867161..6069f96 100755 --- a/src/etc/one-context.d/loc-10-network##network-scripts.one +++ b/src/etc/one-context.d/loc-10-network##network-scripts.one @@ -108,9 +108,13 @@ EOT if [ -n "$GATEWAY" ]; then if [ "$CONFIG_PATH" = "/etc/sysconfig/network" ]; then - echo "default $GATEWAY - $DEV" >> /etc/sysconfig/network/ifroute-$DEV + echo "default $GATEWAY - $DEV" ${METRIC:+metric ${METRIC}} >> /etc/sysconfig/network/ifroute-$DEV else echo "GATEWAY=$GATEWAY" + + if [ -n "$METRIC" ]; then + echo "METRIC=$METRIC" + fi fi fi @@ -225,6 +229,7 @@ gen_network_configuration() MASK=$(get_mask) MTU=$(get_mtu) GATEWAY=$(get_gateway) + METRIC=$(get_iface_var "METRIC") IP6=$(get_iface_var "IP6") [[ -z $IP6 ]] && IP6=$(get_iface_var "IPV6") diff --git a/src/etc/one-context.d/loc-10-network##networkd.one b/src/etc/one-context.d/loc-10-network##networkd.one index e96ec25..9c1ffac 100755 --- a/src/etc/one-context.d/loc-10-network##networkd.one +++ b/src/etc/one-context.d/loc-10-network##networkd.one @@ -169,10 +169,6 @@ EOT fi done - if [ -n "$GATEWAY" ]; then - echo "Gateway=$GATEWAY" - fi - if [ -n "$DNS" ]; then for dns_server in $DNS; do echo "DNS=$dns_server" @@ -185,6 +181,18 @@ EOT done fi + cat <