OpenStack Juno版本网络节点gre模式配置
#开启linux的ip转发功能
#nano /etc/sysctl.conf
net.ipv4.ip_forward=1 net.ipv4.conf.all.rp_filter=0 net.ipv4.conf.default.rp_filter=0
$sysctl -p /etc/sysctl.conf
#安装neutron-plugin-ml2,neutron-plugin-openvswitch-agent,neutron-l3-agent,neutron-dhcp-agent
$apt-get install -y neutron-plugin-ml2 neutron-plugin-openvswitch-agent neutron-l3-agent neutron-dhcp-agent
#配置neutron
#nano /etc/neutron/neutron.conf
[DEFAULT] rpc_backend = rabbit rabbit_host = <CONTROLLER_NODE_IP> rabbit_password = <RABBIT_PASSWD> core_plugin = ml2 service_plugins = router allow_overlapping_ips = True auth_strategy = keystone verbose = True [keystone_authtoken] ... auth_uri = http://<CONTROLLER_NODE_IP>:5000/v2.0 identity_uri = http://<CONTROLLER_NODE_IP>:35357 admin_tenant_name = service admin_user = neutron admin_password = <NEUTRON_PASS> #注意注释掉含有 auth_host, auth_port, and auth_protocol的选项
#配置ml2插件
#nano /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2] type_drivers = flat,gre tenant_network_types = gre mechanism_drivers = openvswitch [ml2_type_flat] flat_networks = external [ml2_type_gre] tunnel_id_ranges = 1:1000 [securitygroup] enable_security_group = True enable_ipset = True firewall_driver =neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver [ovs] #<INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS>是管理段控制节点ip, #如果没有管理网段,就填控制节点IP local_ip = <INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS> enable_tunneling = True bridge_mappings = external:br-ex [agent] tunnel_types = gre
#配置3层代理
#nano /etc/neutron/l3_agent.ini
[DEFAULT] interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver use_namespaces = True external_network_bridge = br-ex router_delete_namespaces = True
#配置dhcp代理
#nano /etc/neutron/dhcp_agent.ini
[DEFAULT] interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq use_namespaces = True dhcp_delete_namespaces = True
#配置元数据代理
#nano /etc/neutron/metadata_agent.ini
[DEFAULT] auth_url = http://<CONTROLLER_NODE_IP>:5000/v2.0 auth_region = regionOne admin_tenant_name = service admin_user = neutron admin_password = <NEUTRON_PASS> nova_metadata_ip = <CONTROLLER_NODE_IP> metadata_proxy_shared_secret = <NEUTRON_PASS>
#配置nova
#nano /etc/nova/nova.conf
service_metadata_proxy = True metadata_proxy_shared_secret = <NEUTRON_PASS> #注意与/etc/neutron/metadata_agent.ini中的metadata_proxy_shared_secret配置一样
$ovs-vsctl add-br br-ex #建立一个叫br-ex的网桥
$ovs-vsctl add-port br-ex eth0 #eth0连接到br-ex网桥
#nano /etc/network/interfaces
auto lo iface lo inet loopback # The primary network interface #auto eth0 #iface eth0 inet static # address 192.168.1.80 # netmask 255.255.255.0 # network 192.168.1.0 # broadcast 192.168.1.255 # gateway 192.168.1.254 # # dns-* options are implemented by the resolvconf package, if instal$ # dns-nameservers 114.114.114.114 auto eth0 iface eth0 inet manual up ifconfig $IFACE 0.0.0.0 up up ip link set $IFACE promisc on down ip link set $IFACE promisc off down ifconfig $IFACE down auto br-ex iface br-ex inet static address 192.168.1.80 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.29.254 # # dns-* options are implemented by the resolvconf package, if instal$ dns-nameservers 114.114.114.114
$ip link set eth0 addr <br-ex MAC_ADDR/HWADDR> #br-ex的mac地址
$ip link set br-ex addr <eth0 MAC_ADDR/HWADDR> #eth0的mac地址
$reboot #重启
# 附带网络重启组件命令
$service neutron-plugin-openvswitch-agent restart $service neutron-l3-agent restart $service neutron-dhcp-agent restart $service neutron-metadata-agent restart
# 验证组件运行情况
$neutron agent-list
注意:<...>为自定义部分
参考:
http://jingyan.baidu.com/article/4d58d5413e95be9dd5e9c06b.html
http://www.aboutyun.com/home.php?mod=space&uid=61&do=blog&id=1749
http://www.chenshake.com/install-openstack-openstack-juno-version/