所有compute节点
下载安装组件
# yum install openstack-neutron openstack-neutron-linuxbridge ebtables ipset -y
修改新增内核参数:
vi /etc/sysctl.conf
net.ipv4.conf.default.rp_filter=0
net.ipv4.conf.all.rp_filter=0
net.bridge.bridge-nf-call-iptables=1
net.bridge.bridge-nf-call-ip6tables=1
sysctl -p
提示:sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: 没有那个文件或目录
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-ip6tables: 没有那个文件或目录
解决方法如下:
modprobe bridge
lsmod|grep bridge
sysctl -p
1公有网络配置+私有网络配置-----------------这里我以compute1节点为例,其它节点的配置是相同的,只是IP 和 网卡对应的名称不同而已
配置neutron服务
vi /etc/neutron/neutron.conf
[DEFAULT]
rpc_backend = rabbit
auth_strategy = keystone
verbose = True
[oslo_messaging_rabbit]
rabbit_host=controller
rabbit_userid = openstack
rabbit_password = openstack
rabbit_retry_interval=1
rabbit_retry_backoff=2
rabbit_max_retries=0
rabbit_durable_queues=true
rabbit_ha_queues=true
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = neutron
password = neutron
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
配置Linux bridge服务
vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = public:bond0
[vxlan]
enable_vxlan = True
local_ip = 10.40.42.11
l2_population = False
[agent]
prevent_arp_spoofing = True
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
enable_ipset = True
添加neutron服务到nova中-----在11节中我就有提到的那个紫色的提前配置,这里再提一次
vi /etc/nova/nova.conf
[neutron]
url = http://controller:9696
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron
重启nova api服务
# systemctl restart openstack-nova-compute.service
开机自启,开启服务
# systemctl enable neutron-linuxbridge-agent.service
# systemctl restart neutron-linuxbridge-agent.service
验证:
在controller上
source admin-openrc.sh
# neutron ext-list
+-----------------------+-----------------------------------------------+
| alias | name |
+-----------------------+-----------------------------------------------+
| dns-integration | DNS Integration |
| ext-gw-mode | Neutron L3 Configurable external gateway mode |
| binding | Port Binding |
| agent | agent |
| subnet_allocation | Subnet Allocation |
| l3_agent_scheduler | L3 Agent Scheduler |
| external-net | Neutron external network |
| flavors | Neutron Service Flavors |
| net-mtu | Network MTU |
| quotas | Quota management support |
| l3-ha | HA Router extension |
| provider | Provider Network |
| multi-provider | Multi Provider Network |
| extraroute | Neutron Extra Route |
| router | Neutron L3 Router |
| extra_dhcp_opt | Neutron Extra DHCP opts |
| security-group | security-group |
| dhcp_agent_scheduler | DHCP Agent Scheduler |
| rbac-policies | RBAC Policies |
| port-security | Port Security |
| allowed-address-pairs | Allowed Address Pairs |
| dvr | Distributed Virtual Router |
+-----------------------+-----------------------------------------------+
# neutron agent-list --显示为true代表正常
+--------------------------------------+--------------------+---------------+-------+----------------+---------------------------+
| id | agent_type | host | alive | admin_state_up | binary |
+--------------------------------------+--------------------+---------------+-------+----------------+---------------------------+
| 1811b84c-6cbc-4d7e-bd48-42d994dab725 | Metadata agent | kxcontroller1 | :-) | True | neutron-metadata-agent |
| 1c8cb6af-3d55-4f43-8667-bea1478c47e7 | Linux bridge agent | kxcompute6 | :-) | True | neutron-linuxbridge-agent |
| 24f4c9c9-07d8-4b5b-acec-52a9e667e78d | Linux bridge agent | kxcompute7 | :-) | True | neutron-linuxbridge-agent |
| 392dc2f7-f1a9-4503-b233-a0c3e158414f | Linux bridge agent | kxcompute9 | :-) | True | neutron-linuxbridge-agent |
| 3db2a560-1854-4415-a193-fea5e8810a74 | L3 agent | kxcontroller2 | :-) | True | neutron-l3-agent |
| 42c75bc2-467c-43a1-8e72-40fb7885e518 | DHCP agent | kxcontroller2 | :-) | True | neutron-dhcp-agent |
| 67f29b57-2337-4b5c-aabd-8e4e539900c5 | L3 agent | kxcontroller1 | :-) | True | neutron-l3-agent |
| 6fb77933-ae56-4114-b984-676ebe338928 | Linux bridge agent | kxcontroller1 | :-) | True | neutron-linuxbridge-agent |
| 77e84a0d-0a37-4187-8514-740742aa7e83 | Linux bridge agent | kxcontroller2 | :-) | True | neutron-linuxbridge-agent |
| 78e8d51b-83f5-497c-b958-a341d24ab1f9 | Linux bridge agent | kxcompute5 | :-) | True | neutron-linuxbridge-agent |
| 8a2d383b-5169-4fbb-8c38-e4f9f3691148 | Linux bridge agent | kxcompute4 | :-) | True | neutron-linuxbridge-agent |
| a0d8191c-383d-4a19-93da-be34ca28cf41 | Linux bridge agent | kxcompute3 | :-) | True | neutron-linuxbridge-agent |
| aca314fa-ffc5-4ced-8a20-311a2c20f272 | DHCP agent | kxcontroller1 | :-) | True | neutron-dhcp-agent |
| c72af482-8a87-4777-ad81-ddcf583a4ad6 | Metadata agent | kxcontroller2 | :-) | True | neutron-metadata-agent |
| c7c80a0b-6011-4d80-a7ab-a47e2c510be2 | Linux bridge agent | kxcompute8 | :-) | True | neutron-linuxbridge-agent |
| dd72cb0c-e6dd-4493-afa4-acbd54d13a45 | Linux bridge agent | kxcompute1 | :-) | True | neutron-linuxbridge-agent |
| f7edb96e-46bf-430c-8de0-7c197574e6a6 | Linux bridge agent | kxcompute2 | :-) | True | neutron-linuxbridge-agent |
+--------------------------------------+--------------------+---------------+-------+----------------+---------------------------+