Saturday, January 31, 2015

Neutron with type VLAN in a single interface host(Ubuntu 14.04)

0: Disabling NetworkManager  or remove it 

sudo apt-get purge network-manager

echo "manual" | sudo tee /etc/init/network-manager.override manual 
sudo stop network-manager

1: install neutron

2:config eth0(/etc/network/interfaces.d/eth0.cfg)
auto eth0
iface eth0 inet manual
  up ip link set dev $IFACE up
      up ip link set $IFACE promisc on(only for VM NIC )
      down ip link set $IFACE promisc off
  down ip link set dev $IFACE down
allow-hotplug br-ex
iface br-ex inet static
        bridge_ports eth0
        address 172.1.1.101
        netmask 255.255.0.0
        gateway 172.1.1.254

3.1  Remove default virbr0
During this process, libvirt creates a default virtual bridge (virbr0) for the guests which you can check using :
# virsh net-list --all
Since we will be creating our own bridge using OVS and won’t need the default one, we can remove it :
# virsh net-destroy default
# virsh net-autostart --disable default
We can also remove ebtables as we will be using OVS instead of the default linux bridge :
# aptitude purge ebtables

3: ovs-vsctl add-port br-ex eth0
4: sudo /etc/init.d/networking restart
please make sure :
#ifconfig br-ex(ifconfig br-ex <ip> up  ifconfig br-ex netmask 255.255.255.0)
#ip link set br-ex promisc on
#route -n(route add default gw <ip>
#ifup eth0

5:/etc/sysctl.conf
 net.ipv4.ip_forward = 1
 net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0

    net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0

Boot support (Ubuntu 14.04)

The boot support for the Openvswitch is implemented very different. It depends on the Openvswitch version, the Ubuntu version and the package repository. Up to now there is NO support to bring up the interfaces automatically. In any case, a patch is required.
All Ubuntu distributions are using Openvswitch packages(by November 2013), which do not have an openvswitch upstart script. One way to bring up interfaces here is using a few lines in /etc/rc.local or patching /etc/init.d/openvswitch-switch .
The necessary lines for /etc/rc.local would be:

packstack install

Provider networks are networks created by the OpenStack administrator that map directly to an existing physical network in the data center. An example of this would be networks behind a set of firewalls or load balancers that are routable within your data center. Useful network types in this category are flat(untagged) and vlan (802.1q tagged). It is possible to allow provider networks to be shared among tenants as part of the network creation process.



ovs-vsctl add-br br-eth0
ovs-vsctl add-port br-eth0 eth0
ifconfig br-eth0 <ip address of eth0> up
ip link set br-eth0 promisc on
route add default gw
ip netns list

lshw -class network

sudo /etc/init.d/networking restart


ip link show dev br-ex


sudo vim /etc/resolvconf/resolv.conf.d/base
nameserver <ip>
sudo resolvconf -u
sudo apt-get instll virt-manager

VLAN Network Manager

the internal network interface in promiscuous mode, because
it must receive packets whose target MAC address is of the guest VM, not
of the host.

Recreate provider network

Useful network types in Provider networks  are flat(untagged) and vlan (802.1q tagged).

Useful network types in Tenant networks  are vlan(802.1q tagged) and gre (unique id). With the use of the L3 agent and Neutron routers, it is possible to route between GRE-based tenant networks



NOTE: It is important to do the network restart before setting up the router gateway below, because a network restart takes destroys and recreates br-ex which causes the router's interface in the qrouter-* netns to be deleted, and it won't be recreated without clearing and re-setting the gateway.
# . keystonerc_admin
# neutron router-gateway-clear router1
# neutron subnet-delete public_subnet
You need to recreate the public subnet with an allocation range outside of your external DHCP range and set the gateway to the default gateway of the external network.
# neutron subnet-create --name public_subnet --enable_dhcp=False --allocation-pool=start=192.168.122.10,end=192.168.122.20 --gateway=192.168.122.1 public 192.168.122.0/24
# neutron router-gateway-set router1 public

two categories of networks that can be created within Neutron

Provider networks are networks created by the OpenStack administrator that map directly to an existing physical network in the data center. An example of this would be networks behind a set of firewalls or load balancers that are routable within your data center. Useful network types in this category are flat(untagged) and vlan (802.1q tagged). It is possible to allow provider networks to be shared among tenants as part of the network creation process.



ovs-vsctl add-br br-eth0
ovs-vsctl add-port br-eth0 eth0
ifconfig br-eth0 <ip address of eth0> up
ip link set br-eth0 promisc on
route add default gw

lshw -class network

sudo /etc/init.d/networking restart


ip link show dev br-ex


sudo vim /etc/resolvconf/resolv.conf.d/base
nameserver <ip>
sudo resolvconf -u
sudo apt-get instll virt-manager

VLAN Network Manager

the internal network interface in promiscuous mode, because
it must receive packets whose target MAC address is of the guest VM, not
of the host.

Thursday, January 29, 2015

multi-nic vm instance in openstack

delete bridge
#ip link set br100 down
# brctl delbr br100

AMQPLAIN login refused: user 'guest' can only connect via localhost

//  overwrite the /etc/rabbitmq/rabbitmq.config file with the below config :
[{rabbit, [{loopback_users, []}]}].
$  sudo service rabbitmq-server stop

Tuesday, January 27, 2015

different ways to allow a virtual machine access to the external network



There are a few different ways to allow a virtual machine access to the external network






https://help.ubuntu.com/community/KVM/Networking

Sunday, January 25, 2015

NeutronDevstack

Basic Setup

In order to use Neutron with devstack (http://devstack.org) a single node setup, you'll need the following settings in your local.conf (see this page for more details on local.conf).
[[local|localrc]]
disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
# Optional, to enable tempest configuration as part of devstack
enable_service tempest

OPENSTACK INSTALLATION


sudo ufw disable


Disabling NetworkManager

According to this bug here's how to disable Network Manager without uninstalling it:
Stop network manager
sudo stop network-manager
Create an override file for the upstart job:


echo "manual" | sudo tee /etc/init/network-manager.override


/etc/network/interfaces. The example below assumes you are configuring your first Ethernet interface identified aseth0. Change the addressnetmask, and gateway values to meet the requirements of your network.
auto eth0
iface eth0 inet static
address 10.0.0.100
netmask 255.255.255.0
gateway 10.0.0.1


cloud-init

dpkg -l | grep openvpn


sudo  dpkg --get-selections | grep cloud  | dpkg-query -L