Merge "support config network in openwrt mgmt_driver"

This commit is contained in:
Jenkins 2017-05-24 04:47:50 +00:00 committed by Gerrit Code Review
commit 21c7d6e69b
2 changed files with 47 additions and 1 deletions

View File

@ -0,0 +1,46 @@
vdus:
VDU1:
config:
network: |
package network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'mgmt_net'
option ifname 'eth0'
option proto 'dhcp'
config interface 'net1'
option ifname 'eth1'
option proto 'dhcp'
config interface 'net2'
option ifname 'eth2'
option proto 'dhcp'
firewall: |
package firewall
config defaults
option syn_flood '1'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
config zone
option name 'mgmt_net'
option network 'mgmt_net'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
config zone
option name 'lan'
list network 'net1 net2'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'

View File

@ -91,7 +91,7 @@ class DeviceMgmtOpenWRT(abstract_driver.DeviceMGMTAbstractDriver):
for vdu, vdu_dict in vdus_config_dict.items():
config = vdu_dict.get('config', {})
for key, conf_value in config.items():
KNOWN_SERVICES = ('firewall', )
KNOWN_SERVICES = ('firewall', 'network')
if key not in KNOWN_SERVICES:
continue
mgmt_ip_address = mgmt_url.get(vdu, '')