Browse Source

Use sysctl to enable net.ipv4.ip_forward separately

Use sysctl to enable net.ipv4.ip_forward separately instead of
reloading the whole sysctl.conf.

Change-Id: Ia334793972a5357edfe29d7dba2d448273a72c75
jianghua wang 2 years ago
parent
commit
fdf8795844
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      plugin_source/deployment_scripts/compute_post_deployment.py

+ 5
- 2
plugin_source/deployment_scripts/compute_post_deployment.py View File

@@ -143,9 +143,12 @@ def install_suppack(himn, username, package, xcp_version):
143 143
 
144 144
 def forward_from_himn(eth):
145 145
     """Forward packets from HIMN to storage/mgmt network. """
146
-    utils.execute('sed', '-i', 's/#net.ipv4.ip_forward/net.ipv4.ip_forward/g',
146
+    # make change to be persistent
147
+    utils.execute('sed', '-i',
148
+                  's/.*net\.ipv4\.ip_forward.*=.*/net.ipv4.ip_forward=1/g',
147 149
                   '/etc/sysctl.conf')
148
-    utils.execute('sysctl', '-p', '/etc/sysctl.conf')
150
+    # make it to take effective now.
151
+    utils.execute('sysctl', 'net.ipv4.ip_forward=1')
149 152
 
150 153
     endpoint_names = ['br-storage', 'br-mgmt']
151 154
     for endpoint_name in endpoint_names:

Loading…
Cancel
Save