summaryrefslogtreecommitdiffstats
path: root/autocluster
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2014-06-18 12:18:58 +1000
committerMartin Schwenke <martin@meltin.net>2014-06-25 20:46:15 +1000
commit90125744b49031bffb3bf7a7f190873f7c4cfdbd (patch)
treee9db8e73cad6bd1fc0dcc161fe07f347dd15b1a9 /autocluster
parent0f7e763d3004a3d8c0bed650f866aed56a54e0c5 (diff)
downloadautocluster-90125744b49031bffb3bf7a7f190873f7c4cfdbd.tar.gz
autocluster-90125744b49031bffb3bf7a7f190873f7c4cfdbd.tar.xz
autocluster-90125744b49031bffb3bf7a7f190873f7c4cfdbd.zip
Define gateway for default route in $NETWORKS
It now goes into one of the ifcfg-eth* files instead of /etc/sysconfig/network. NetworkManager in RHEL 7.0 seems to have a horrible bug. If GATEWAY is defined in /etc/sysconfig/network and if it brings up the "wrong" interface first then it adds a host route to the gateway on the "wrong" network. This means that outbound traffic is OK. However, for incoming traffic, ARP responses go out the "wrong" interface and are either filtered on the node or are ignored by the host machine. Signed-off-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'autocluster')
-rwxr-xr-xautocluster11
1 files changed, 11 insertions, 0 deletions
diff --git a/autocluster b/autocluster
index cb719cb..9146728 100755
--- a/autocluster
+++ b/autocluster
@@ -785,6 +785,16 @@ setup_network()
local netname dev ip mask mac opts
while read netname dev ip mask mac opts; do
echo " $dev"
+
+ local o gw
+ gw=""
+ for o in $opts ; do
+ case "$o" in
+ gw\=*)
+ gw="${o#gw=}"
+ esac
+ done
+
cat <<EOF | \
diskimage put - "/etc/sysconfig/network-scripts/ifcfg-${dev}"
DEVICE=$dev
@@ -793,6 +803,7 @@ TYPE=Ethernet
IPADDR=$ip
NETMASK=$mask
HWADDR=$mac
+${gw:+GATEWAY=}${gw}
EOF
# This goes to 70-persistent-net.rules