File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -145,8 +145,13 @@ def load_mgmt_config(filename):
145
145
hostname = config_data ['DEVICE_METADATA' ]['localhost' ]['hostname' ]
146
146
_change_hostname (hostname )
147
147
mgmt_conf = netaddr .IPNetwork (config_data ['MGMT_INTERFACE' ].keys ()[0 ][1 ])
148
+ gw_addr = config_data ['MGMT_INTERFACE' ].values ()[0 ]['gwaddr' ]
148
149
command = "ifconfig eth0 {} netmask {}" .format (str (mgmt_conf .ip ), str (mgmt_conf .netmask ))
149
150
run_command (command , display_cmd = True )
151
+ command = "ip route add default via {} dev eth0 table default" .format (gw_addr )
152
+ run_command (command , display_cmd = True )
153
+ command = "ip rule add from {} table default" .format (str (mgmt_conf .ip ))
154
+ run_command (command , display_cmd = True )
150
155
command = "[ -f /var/run/dhclient.eth0.pid ] && kill `cat /var/run/dhclient.eth0.pid` && rm -f /var/run/dhclient.eth0.pid"
151
156
run_command (command , display_cmd = True )
152
157
print "Please note loaded setting will be lost after system reboot. To preserve setting, run `config save`."
You can’t perform that action at this time.
0 commit comments