aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Dibowitz <phil@ipom.com>2016-10-24 12:48:02 -0700
committerLukáš Nykrýn <lnykryn@redhat.com>2016-10-27 13:37:39 +0200
commit3b9c49f08092e2d38ddf6bbb5257b1688851e17c (patch)
treef5bdce44b1f1188470d5eea36734c61981a6f323
parentc3ff1b4c4d9837514cde7cb2cbd3b15ac4070f73 (diff)
downloadinitscripts-3b9c49f08092e2d38ddf6bbb5257b1688851e17c.tar
initscripts-3b9c49f08092e2d38ddf6bbb5257b1688851e17c.tar.gz
initscripts-3b9c49f08092e2d38ddf6bbb5257b1688851e17c.tar.bz2
initscripts-3b9c49f08092e2d38ddf6bbb5257b1688851e17c.tar.xz
initscripts-3b9c49f08092e2d38ddf6bbb5257b1688851e17c.zip
Add ability to specify arbitrary route options
`ifup` can set _some_ route options. Today it's missing several and so, to set something like `mtu` or `advmss` you have to do hacks like: ``` METRIC='10 mtu 1480' ``` which is sub-optimal. Rather than one-off add support for everything in the man page, provide a hook for arbitrary extra route options.
-rwxr-xr-xsysconfig/network-scripts/ifup-eth2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index fdb711c4..8130b3cb 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -284,11 +284,13 @@ else
# set up default gateway. replace if one already exists
if [ -n "${GATEWAY}" ] && [ "$(ipcalc --network ${GATEWAY} ${netmask[0]} 2>/dev/null)" = "NETWORK=${NETWORK}" ]; then
ip route replace default ${METRIC:+metric $METRIC} \
+ ${EXTRA_ROUTE_OPTS} \
via ${GATEWAY} ${WINDOW:+window $WINDOW} ${SRC} \
${GATEWAYDEV:+dev $GATEWAYDEV} ||
net_log $"Error adding default gateway ${GATEWAY} for ${DEVICE}."
elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then
ip route replace default ${METRIC:+metric $METRIC} \
+ ${EXTRA_ROUTE_OPTS} \
${SRC} ${WINDOW:+window $WINDOW} dev ${REALDEVICE} ||
net_log $"Error adding default gateway for ${REALDEVICE}."
fi