OpenStack Juno版本網絡節點gre模式配置php
#開啓linux的ip轉發功能html
#nano /etc/sysctl.conflinux
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-agentshell
$apt-get install -y neutron-plugin-ml2 neutron-plugin-openvswitch-agent neutron-l3-agent neutron-dhcp-agent
#配置neutron網絡
#nano /etc/neutron/neutron.confapp
[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插件ide
#nano /etc/neutron/plugins/ml2/ml2_conf.inioop
[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層代理ui
#nano /etc/neutron/l3_agent.iniurl
[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/