From b978ad01b353697148a48c6b76abc1b6bb739e45 Mon Sep 17 00:00:00 2001 From: QiLiang Date: Sun, 28 Aug 2016 18:51:41 +0800 Subject: Persist jumpserver network setup JIRA: COMPASS-474 Change-Id: I11d0862c3c98db02cf2bbbae31bf4bf643c5ca52 Signed-off-by: QiLiang --- deploy/network.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/deploy/network.sh b/deploy/network.sh index e3230fa9..46b8c023 100755 --- a/deploy/network.sh +++ b/deploy/network.sh @@ -104,6 +104,23 @@ function setup_baremetal_net() { setup_bridge_net install $INSTALL_NIC } +function setup_network_boot_scripts() { + sudo cp $COMPASS_DIR/deploy/network.sh /usr/sbin/network_setup + sudo chmod +777 /usr/sbin/network_setup + sudo cat << EOF >> /usr/sbin/network_setup + +sleep 2 +save_network_info +clear_forward_rejct_rules +EOF + sudo chmod 755 /usr/sbin/network_setup + + egrep -R "^/usr/sbin/network_setup" /etc/rc.local + if [[ $? != 0 ]]; then + sudo sed -i '/^exit 0/i\/usr\/sbin\/network_setup' /etc/rc.local + fi +} + function create_nets() { setup_nat_net mgmt $MGMT_GW $MGMT_MASK $MGMT_IP_START $MGMT_IP_END @@ -113,4 +130,7 @@ function create_nets() { # create external network setup_bridge_external clear_forward_rejct_rules + + setup_network_boot_scripts } + -- cgit 1.2.3-korg