summaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
authorshuai chen <chenshuai@huawei.com>2016-09-08 02:23:39 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-09-08 02:23:39 +0000
commit2c28aad74ecedd679a8ab4fecb63a2d819ddf1b0 (patch)
tree01e7241a8fc3166ea660368ae923ff2320bb7990 /deploy
parentb9fdcf09eda433e2362a2cd56a66d6ac08c5e5e0 (diff)
parentbe932aaf18779db2290b6582ebbdfd445748e04e (diff)
Merge "Persist jumpserver network setup" into stable/colorado
Diffstat (limited to 'deploy')
-rwxr-xr-xdeploy/network.sh20
1 files changed, 20 insertions, 0 deletions
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
}
+