User Tools

Site Tools


ipv6_opnfv_project:create_networks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ipv6_opnfv_project:create_networks [2015/10/16 06:41]
Bin Hu
ipv6_opnfv_project:create_networks [2015/12/30 08:40] (current)
Sridhar Gaddam
Line 1: Line 1:
-===== Step 5: Creating Networks and Subnets =====+===== Step 4: Creating Networks and Subnets =====
  
 OPNFV POC OpenStack Setup Instructions. OPNFV POC OpenStack Setup Instructions.
Line 6: Line 6:
 Steps to be executed on the snsj113 (IP: 198.59.156.113) machine (''​refer to [[http://​spirent.app.box.com/​notes/​37713582266?​s=tgm98glcerw9zlcdy6pclavjlorgop4v|the details of lab environment]]''​). Steps to be executed on the snsj113 (IP: 198.59.156.113) machine (''​refer to [[http://​spirent.app.box.com/​notes/​37713582266?​s=tgm98glcerw9zlcdy6pclavjlorgop4v|the details of lab environment]]''​).
  
-1. Login as odl user and change directory to devstack.+1. Login as odl user and source the credentials
  
    cd ~/devstack    cd ~/devstack
 +   ​odl@opnfv-openstack-ubuntu:​~/​devstack$ source openrc admin demo   
 +2. Clone the opnfv_os_ipv6_poc repo.
  
-2Source the credentials. +   git clone https://​github.com/​sridhargaddam/​opnfv_os_ipv6_poc.git /opt/stack/opnfv_os_ipv6_poc
- +
-   ​odl@opnfv-openstack-ubuntu:​~/devstack$ source openrc admin demo+
  
 3. We want to manually create networks/​subnets that will help us to achieve the POC, so we have used the flag, ''​NEUTRON_CREATE_INITIAL_NETWORKS=False''​ in ''​local.conf''​ file. When this flag is set to False, devstack does not create any networks/​subnets during the setup phase. ​ 3. We want to manually create networks/​subnets that will help us to achieve the POC, so we have used the flag, ''​NEUTRON_CREATE_INITIAL_NETWORKS=False''​ in ''​local.conf''​ file. When this flag is set to False, devstack does not create any networks/​subnets during the setup phase. ​
Line 18: Line 18:
 4. On snsj113 machine, eth1 provides external/​public connectivity (both IPv4 and IPv6). So let us add this interface to br-ex and move the IP address (including the default route) from eth1 to br-ex. 4. On snsj113 machine, eth1 provides external/​public connectivity (both IPv4 and IPv6). So let us add this interface to br-ex and move the IP address (including the default route) from eth1 to br-ex.
  
-''​Note:​ This can be automated in /​etc/​network/​interfaces. This file /​etc/​network/​interfaces is already configured in host snsj113 to achieve this.''​+''​Note:​ This can be automated in /​etc/​network/​interfaces. ''​
  
-   sudo ovs-vsctl del-port br-ex eth1 && ​sudo ip addr del 198.59.156.113/​24 dev br-ex && sudo ifconfig eth1 up && ​ sudo ip addr add 198.59.156.113/​24 dev eth1 && sudo ifconfig br-ex up && sudo ip route del default via 198.59.156.1 dev eth1 && sudo ip route add default via 198.59.156.1 dev br-ex+   sudo ip addr del 198.59.156.113/​24 dev eth1 && sudo ovs-vsctl add-port ​br-ex eth1 && sudo ifconfig eth1 up && ​ sudo ip addr add 198.59.156.113/​24 dev br-ex && sudo ifconfig br-ex up && sudo ip route add default via 198.59.156.1 dev br-ex
  
 # Verify that br-ex now has the IPaddress 198.59.156.113/​24 and the default route is on br-ex  # Verify that br-ex now has the IPaddress 198.59.156.113/​24 and the default route is on br-ex 
Line 84: Line 84:
    ​neutron router-interface-add ipv6-router ipv4-int-subnet2    ​neutron router-interface-add ipv6-router ipv4-int-subnet2
  
-5. Download ''​fedora20''​ image which would be used as vRouter.+5. Download ''​fedora22''​ image which would be used as vRouter.
  
-   ​glance image-create --name 'Fedora20' --disk-format qcow2 --container-format bare --is-public true --copy-from ​http://cloud.fedoraproject.org/​fedora-20.x86_64.qcow2 ​  +   ​glance image-create --name 'Fedora22' --disk-format qcow2 --container-format bare --is-public true --copy-from ​https://download.fedoraproject.org/pub/fedora/​linux/​releases/​22/​Cloud/​x86_64/​Images/​Fedora-Cloud-Base-22-20150521.x86_64.qcow2 ​  
  
 6. Create a keypair. 6. Create a keypair.
Line 92: Line 92:
    nova keypair-add vRouterKey > ~/​vRouterKey    nova keypair-add vRouterKey > ~/​vRouterKey
  
-7. Copy the contents of the following url to ''​metadata.txt''​ (i.e., metadata which enables IPv6 router functionality inside vRouter)+7. Create some Neutron ports that would be used for vRouter and the two VMs.
  
-   http://fpaste.org/​276989/​39903414/​+   neutron port-create --name eth0-vRouter --mac-address fa:16:​3e:​11:​11:​11 ipv4-int-network2 
 +   ​neutron port-create --name eth1-vRouter --mac-address fa:​16:​3e:​22:​22:​22 ipv4-int-network1 
 +   ​neutron port-create --name eth0-VM1 --mac-address fa:​16:​3e:​33:​33:​33 ipv4-int-network1 
 +   ​neutron port-create --name eth0-VM2 --mac-address fa:​16:​3e:​44:​44:​44 ipv4-int-network1 
 +       
 +8Boot the vRouter using ''​Fedora22''​ image on the Compute node (hostname: opnfv-odl-ubuntu)
  
-8. Boot the vRouter using ''​Fedora20'' ​image on the Compute node (hostname: opnfv-odl-ubuntu)+   nova boot --image Fedora22 --flavor m1.small --user-data /​opt/​stack/​opnfv_os_ipv6_poc/​metadata.txt --availability-zone nova:​opnfv-odl-ubuntu ​--nic port-id=$(neutron port-list | grep -w eth0-vRouter | awk '​{print $2}'--nic port-id=$(neutron port-list | grep -w eth1-vRouter | awk '​{print $2}') --key-name vRouterKey vRouter ​
  
-   nova boot --image Fedora20 --flavor m1.small --user-data=./​metadata.txt --availability-zone nova:​opnfv-odl-ubuntu --nic net-id=$(neutron net-list | grep -w ipv4-int-subnet2 | awk '​{print $2}') --nic net-id=(neutron net-list | grep -w ipv4-int-subnet1 | awk '​{print $2}') --key-name vRouterKey vRouter +9. Verify that vRouter ​boots up successfully and the ssh keys are properly injected.
- +
-9. Verify that Fedora20 image boots up successfully and the ssh keys are properly injected.+
  
 ''​Note:​ It may take few minutes for the necessary packages to get installed and ssh keys to be injected.''​ ''​Note:​ It may take few minutes for the necessary packages to get installed and ssh keys to be injected.''​
Line 117: Line 120:
 10. In order to verify that the setup is working, let's create two cirros VMs on the ''​ipv4-int-network1''​ (i.e., vRouter ''​eth1''​ interface - internal network). 10. In order to verify that the setup is working, let's create two cirros VMs on the ''​ipv4-int-network1''​ (i.e., vRouter ''​eth1''​ interface - internal network).
  
-Note: VM1 is created on Control+Network node (i.e., opnfv-openstack-ubuntu)+''​Note: VM1 is created on Control+Network node (i.e., opnfv-openstack-ubuntu)''​
  
-    nova boot --image cirros-0.3.4-x86_64-uec --flavor m1.tiny --nic net-id=(neutron ​net-list | grep -w ipv4-int-network1 ​| awk '​{print $2}') --availability-zone nova:​opnfv-openstack-ubuntu --key-name vRouterKey VM1+    nova boot --image cirros-0.3.4-x86_64-uec --flavor m1.tiny --nic port-id=$(neutron ​port-list | grep -w eth0-VM1 | awk '​{print $2}') --availability-zone nova:​opnfv-openstack-ubuntu --key-name vRouterKey ​--user-data /​opt/​stack/​opnfv_os_ipv6_poc/​set_mtu.sh ​VM1
  
-Note: VM2 is created on Compute node (i.e., opnfv-odl-ubuntu)+''​Note: VM2 is created on Compute node (i.e., opnfv-odl-ubuntu). We will have to configure appropriate mtu on the VM iface by taking into account the tunneling overhead and any physical switch requirements. If so, push the mtu to the VM either using dhcp options or via meta-data. ''​
  
-    nova boot --image cirros-0.3.4-x86_64-uec --flavor m1.tiny --nic net-id=(neutron ​net-list | grep -w ipv4-int-network1 ​| awk '​{print $2}') --availability-zone nova:​opnfv-odl-ubuntu --key-name vRouterKey VM2+    nova boot --image cirros-0.3.4-x86_64-uec --flavor m1.tiny --nic port-id=$(neutron ​port-list | grep -w eth0-VM2 | awk '​{print $2}') --availability-zone nova:​opnfv-odl-ubuntu --key-name vRouterKey ​--user-data /​opt/​stack/​opnfv_os_ipv6_poc/​set_mtu.sh ​VM2
  
 11. Confirm that both the VMs are successfully booted. 11. Confirm that both the VMs are successfully booted.
Line 136: Line 139:
  
 # On successful execution of the above command, you will be in the router namespace.\\ # On successful execution of the above command, you will be in the router namespace.\\
-# Copy the following contents to a file ''/​tmp/​br-ex.radvd.conf''​ 
- 
-    interface qr-0878306e-2b 
-    { 
-       ​AdvSendAdvert on; 
-       ​MinRtrAdvInterval 3; 
-       ​MaxRtrAdvInterval 10; 
-       ​prefix 2001:​db8:​0:​1::/​64 
-       { 
-   AdvOnLink on; 
-   AdvAutonomous on; 
-       }; 
-    }; 
- 
 # Configure the IPv6 address on the <​qr-xxx>​ iface. # Configure the IPv6 address on the <​qr-xxx>​ iface.
  
-    ip -6 addr add 2001:​db8:​0:​1::​1 dev <​qr-xxx>​+    ​export router_interface=$(ip a s | grep -w "​global qr-*" | awk '​{print $7}'​) 
 +    ​ip -6 addr add 2001:​db8:​0:​1::​1 dev $router_interface
  
-Spawn a ''​radvd''​ daemon to simulate an external router. ​+Update the sample radvd.conf file with the $router_interface and spawn ''​radvd''​ daemon ​inside the namespace ​to simulate an external ​IPv6 router. ​
  
-    $radvd -C /tmp/br-ex.radvd.conf -p /​tmp/​br-ex.pid.radvd -m syslog+    ​cp /​opt/​stack/​opnfv_os_ipv6_poc/​scenario2/​radvd.conf /​tmp/​radvd.$router_interface.conf 
 +    sed -i '​s/​$router_interface/'​$router_interface'/​g'​ /​tmp/​radvd.$router_interface.conf 
 +    ​$radvd -C /tmp/radvd.$router_interface.conf -p /​tmp/​br-ex.pid.radvd -m syslog
  
-You will also have to add an ipv6 route which points ​to the ''​eth0''​ interface ​of vRouter. ​This is necessary for the ipv6 router to know that ''​2001:​db8:​0:​2::/​64''​ is reachable ​via the ''​eth0''​ interface of vRouter.+Configure the downstream ​route pointing ​to the eth0 iface of vRouter. ​ 
 +    ip -6 route add 2001:​db8:​0:​2::/​64 via 2001:​db8:​0:​1:​f816:​3eff:​fe11:​1111
  
-    ip -6 route add 2001:​db8:​0:​2::/​64 via <LLA-of-eth0-iface-on-vRouter> ​dev <qr-iface>+    ​Note: The routing table should now look something similar to shown below.  
 +    ​ip -6 route show 
 +    2001:​db8:​0:​1::​1 dev qr-42968b9e-62 ​ proto kernel ​ metric 256 
 +    2001:​db8:​0:​1::/​64 dev qr-42968b9e-62 ​ proto kernel ​ metric 256  expires 86384sec 
 +    ​2001:​db8:​0:​2::/​64 via 2001:​db8:​0:​1:​f816:​3eff:​fe11:​1111 dev qr-42968b9e-62  proto ra  metric 1024  expires 29sec 
 +    fe80::/64 dev qg-3736e0c7-7c  proto kernel ​ metric 256 
 +    fe80::/​64 ​dev qr-42968b9e-62 ​ proto kernel ​ metric 256
  
-# Verify ​that the route is properly added +Now, let us ssh to one of the VMs (say VM1) to confirm ​that it has successfully configured ​the IPv6 address using SLAAC with prefix from vRouter.
- +
-    ip -6 route show+
  
-Now, let us ssh to one of the VMs (say VM1) to confirm that it has successfully configured the IPv6 address using SLAAC with prefix from vRouter. ​Note: Get the IPv4 address associated to VM1. This can be inferred from nova list command.+''​Note: Get the IPv4 address associated to VM1. This can be inferred from nova list command.''​
  
     ssh -i /​home/​odl/​vRouterKey cirros@<​VM1-ipv4-address> ​     ssh -i /​home/​odl/​vRouterKey cirros@<​VM1-ipv4-address> ​
Line 183: Line 180:
  
     exit     exit
 +    ​
 +The Network Topology of this setup would be as follows.
 +
 +{{:​ipv6_opnfv_project:​setup-os_odl.png}}
 +
 +[[http://​199.188.118.108:​8181/​index.htm| ODL DLUX UI]] would display the two nodes as shown below.
  
 +{{:​ipv6_opnfv_project:​odl-dlux_ipv6_poc.png}}
ipv6_opnfv_project/create_networks.1444977708.txt.gz · Last modified: 2015/10/16 06:41 by Bin Hu