码迷,mamicode.com
首页 > 其他好文 > 详细

openstack neutron-修改新创建安全组的默认规则

时间:2016-10-11 00:23:14      阅读:768      评论:0      收藏:0      [点我收藏+]

标签:配置文件   数据库   源代码   false   

neutron 创建安全组会有两条默认的出口规则


Direction

Ether Type

IP Protocol

Port Range

Remote IP Prefix

Remote Security Group

Actions



EgressIPv6AnyAny::/0-Delete Rule

EgressIPv4AnyAny0.0.0.0/0-

遇到的需求要修改它,

找了数据库,配置文件后,在源代码中找到了他

位置 neutron/db/securitygroups_db.py

  def create_security_group(self, context, security_group, default_sg=False):



 for ethertype in ext_sg.sg_supported_ethertypes:

    if default_sg:

    # Allow intercommunication

      ingress_rule = sg_models.SecurityGroupRule(

      id=uuidutils.generate_uuid(), tenant_id=tenant_id,

      security_group=security_group_db,

      direction=‘ingress‘,

      ethertype=ethertype,

      source_group=security_group_db)

      context.session.add(ingress_rule)

修改这段内容,完成目的。 

openstack neutron-修改新创建安全组的默认规则

标签:配置文件   数据库   源代码   false   

原文地址:http://superbigsea.blog.51cto.com/6862263/1860311

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!