|
控制节点的配置项:
#使用core plugin使用ml2
[iyunv@master1 ~]# grep '^[a-z]' /etc/neutron/neutron.conf
auth_strategy = keystone
core_plugin = ml2
service_plugins =
#ml2加载指定网络类型
#加载指定的plugin-agent:Linuxbridge
[iyunv@master1 ~]# grep '^[a-z]' /etc/neutron/plugins/ml2/ml2_conf.ini
type_drivers = local,flat,vlan,gre,vxlan,geneve
tenant_network_types = local
mechanism_drivers = linuxbridge,openvswitch
extension_drivers = port_security
flat_networks = public
enable_ipset = true
#在哪个网口实现映射
[iyunv@master1 ~]# grep '^[a-z]' /etc/neutron/plugins/ml2/linuxbridge_agent.ini
physical_interface_mappings = public:ens33
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
enable_security_group = true
enable_vxlan = false
#创建instance
openstack server create --flavor m1.nano --image cirros-0.3.5-pudding --nic net-id=4c796250-e068-412d-8bd6-4b2dca4cf737 --security-group default --key-name my-key instance-test-local-01
#创建后的网络
[iyunv@master1 ~]# ifconfig (日志内容做过修改)
brq4c796250-e0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::24b9:d4ff:fe00:899e prefixlen 64 scopeid 0x20<link>
ether ca:56:cc:5a:c6:37 txqueuelen 1000 (Ethernet)
......
tap6884f21b-7b: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::fc16:3eff:fe49:e57 prefixlen 64 scopeid 0x20<link>
ether fe:16:3e:49:0e:57 txqueuelen 1000 (Ethernet)
......
tapbc4ce6d5-ac: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether ca:56:cc:5a:c6:37 txqueuelen 1000 (Ethernet)
......
#可以看到一个br设备brq4c796250-e0,2个tap设备tap6884f21b-7b和tapbc4ce6d5-ac,这2个tap设备均挂在br设备上,可以通过brctl show看到;
#查看网桥的挂载情况
[iyunv@master1 ~]# brctl show
bridge name bridge id STP enabled interfaces
brq4c796250-e0 8000.ca56cc5ac637 no tap6884f21b-7b
tapbc4ce6d5-ac
virbr0 8000.525400de9a4a yes virbr0-nic
#查看实例的mac地址和接口,确认了tap6884f21b-7b此tap设备(虚拟交换机的接口)连接的是instance;MAC地址是从交换机port里取到的
[iyunv@master1 ~]# virsh domiflist instance-00000011
接口 类型 源 型号 MAC
-------------------------------------------------------
tap6884f21b-7b bridge brq4c796250-e0 virtio fa:16:3e:49:0e:57
#另外一个是dnsmasq的,DHCP服务器的,port的ID的前12位+tap就是对端设备设备
[iyunv@master1 ~]# neutron port-list
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------------+
| 6884f21b-7bd3-424b-ba6b-2e3f1cd4bc2c | | fa:16:3e:49:0e:57 | {"subnet_id": "0d09d633-cf51-4660-a74f-1668d78c5e74", "ip_address": "172.16.1.12"} |
| bc4ce6d5-ac9f-4300-9dad-dce47c99fab4 | | fa:16:3e:29:3a:a3 | {"subnet_id": "0d09d633-cf51-4660-a74f-1668d78c5e74", "ip_address": "172.16.1.2"} |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------------+
|
|
|