Friday, April 25, 2014

Overlapping private networks in Havana

Neutron.conf on Neutron Server && Compute nodes should have an entry :
allow_overlapping_ips = True  

New user "andrew" under ostenant2 created router5 and private network int2 overlapping with int
New VM VF20RS025 (10.0.0.13,192.168.1.108) has been launched with Internet access (F20 OS)


[root@dfw02 ~(keystone_admin)]$ neutron router-list
-+-----------------------------------------------------------------------------++--------------------------------------+--------
| id                                   | name    | external_gateway_info                                                       |
+--------------------------------------+---------+-----------------------------------------------------------------------------+
| 0686e526-0584-4004-a8b0-7d64b376f0ce | router5 | {"network_id": "780ce2f3-2e6e-4881-bbac-857813f9a8e0", "enable_snat": true} |
| 86b3008c-297f-4301-9bdc-766b839785f1 | router2 | {"network_id": "780ce2f3-2e6e-4881-bbac-857813f9a8e0", "enable_snat": true} |
| bf360d81-79fb-4636-8241-0a843f228fc8 | router1 | {"network_id": "780ce2f3-2e6e-4881-bbac-857813f9a8e0", "enable_snat": true} |
+--------------------------------------+---------+-----------------------------------------------------------------------------+

Qrouter namespace created

[root@dfw02 ~(keystone_admin)]$ ip netns list | grep 0686e526-0584-4004-a8b0-7d64b376f0ce
qrouter-0686e526-0584-4004-a8b0-7d64b376f0ce

[root@dfw02 ~(keystone_admin)]$ neutron net-list
+--------------------------------------+------+-----------------------------------------------------+
| id                                   | name | subnets                                             |
+--------------------------------------+------+-----------------------------------------------------+
| 1eea88bb-4952-4aa4-9148-18b61c22d5b7 | int  | fa930cea-3d51-4cbe-a305-579f12aa53c0 10.0.0.0/24    |
| 426bb226-0ab9-440d-ba14-05634a17fb2b | int1 | 9e0d457b-c4c4-45cf-84e2-4ac7550f3b06 40.0.0.0/24    |
| 780ce2f3-2e6e-4881-bbac-857813f9a8e0 | ext  | f30e5a16-a055-4388-a6ea-91ee142efc3d 192.168.1.0/24 |
| 971fd74b-66e4-4016-b997-433e124a22ad | int2 | caca1f54-3211-4395-ba3c-a0c26d9605c0 10.0.0.0/24    |
+--------------------------------------+------+-----------------------------------------------------+ 
 
[root@dfw02 ~(keystone_admin)]$ neutron subnet-list
+--------------------------------------+------+----------------+----------------------------------------------------+
| id                                   | name | cidr           | allocation_pools                                   |
+--------------------------------------+------+----------------+----------------------------------------------------+
| 9e0d457b-c4c4-45cf-84e2-4ac7550f3b06 |      | 40.0.0.0/24    | {"start": "40.0.0.2", "end": "40.0.0.254"}         |
| fa930cea-3d51-4cbe-a305-579f12aa53c0 |      | 10.0.0.0/24    | {"start": "10.0.0.2", "end": "10.0.0.254"}         |
| caca1f54-3211-4395-ba3c-a0c26d9605c0 |      | 10.0.0.0/24    | {"start": "10.0.0.11", "end": "10.0.0.254"}        |
| f30e5a16-a055-4388-a6ea-91ee142efc3d |      | 192.168.1.0/24 | {"start": "192.168.1.100", "end": "192.168.1.200"} |
+--------------------------------------+------+----------------+----------------------------------------------------+
 
 
 Qdhcp namespace created

[root@dfw02 ~(keystone_admin)]$ ip netns list | grep 971fd74b-66e4-4016-b997-433e124a22ad 
qdhcp-971fd74b-66e4-4016-b997-433e124a22ad

[root@dfw02 ~(keystone_admin)]$ ip netns exec qrouter-0686e526-0584-4004-a8b0-7d64b376f0ce iptables -S -tnat
-P PREROUTING ACCEPT
-P INPUT ACCEPT
-P OUTPUT ACCEPT
-P POSTROUTING ACCEPT
-N neutron-l3-agent-OUTPUT
-N neutron-l3-agent-POSTROUTING
-N neutron-l3-agent-PREROUTING
-N neutron-l3-agent-float-snat
-N neutron-l3-agent-snat
-N neutron-postrouting-bottom
-A PREROUTING -j neutron-l3-agent-PREROUTING
-A OUTPUT -j neutron-l3-agent-OUTPUT
-A POSTROUTING -j neutron-l3-agent-POSTROUTING
-A POSTROUTING -j neutron-postrouting-bottom
-A neutron-l3-agent-OUTPUT -d 192.168.1.112/32 -j DNAT --to-destination 10.0.0.11
-A neutron-l3-agent-OUTPUT -d 192.168.1.108/32 -j DNAT --to-destination 10.0.0.13
-A neutron-l3-agent-POSTROUTING ! -i qg-edd58124-43 ! -o qg-edd58124-43 -m conntrack ! --ctstate DNAT -j ACCEPT
-A neutron-l3-agent-PREROUTING -d 169.254.169.254/32 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8700
-A neutron-l3-agent-PREROUTING -d 192.168.1.112/32 -j DNAT --to-destination 10.0.0.11
-A neutron-l3-agent-PREROUTING -d 192.168.1.108/32 -j DNAT --to-destination 10.0.0.13
-A neutron-l3-agent-float-snat -s 10.0.0.11/32 -j SNAT --to-source 192.168.1.112
-A neutron-l3-agent-float-snat -s 10.0.0.13/32 -j SNAT --to-source 192.168.1.108
-A neutron-l3-agent-snat -j neutron-l3-agent-float-snat
-A neutron-l3-agent-snat -s 10.0.0.0/24 -j SNAT --to-source 192.168.1.107
-A neutron-postrouting-bottom -j neutron-l3-agent-snat


[root@dfw02 ~]# ssh -l fedora -i oskey35.pem 192.168.1.108
The authenticity of host '192.168.1.108 (192.168.1.108)' can't be established.
RSA key fingerprint is 9b:b3:07:5e:61:71:67:01:c5:9f:7a:53:e0:ca:60:6a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.108' (RSA) to the list of known hosts.
[fedora@vf20rs025 ~]$ sudo su -
[root@vf20rs025 ~]# ifconfig
eth0: flags=4163  mtu 1454
        inet 10.0.0.13  netmask 255.255.255.0  broadcast 10.0.0.255
        inet6 fe80::f816:3eff:fe74:68c  prefixlen 64  scopeid 0x20
        ether fa:16:3e:74:06:8c  txqueuelen 1000  (Ethernet)
        RX packets 279  bytes 29979 (29.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 247  bytes 26077 (25.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 0  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@vf20rs025 ~]# yum -y install links
fedora/20/x86_64/metalink                                                         |  35 kB  00:00:00     
fedora                                                                            | 3.8 kB  00:00:00     
updates/20/x86_64/metalink                                                        |  22 kB  00:00:00     
updates                                                                           | 4.9 kB  00:00:00     
(1/4): fedora/20/x86_64/group_gz                                                  | 394 kB  00:00:07     
(2/4): updates/20/x86_64/group_gz                                                 | 394 kB  00:00:06     
(3/4): updates/20/x86_64/primary_db                                               | 9.6 MB  00:00:11     
(4/4): fedora/20/x86_64/primary_db                                                |  18 MB  00:00:18     
(1/2): updates/20/x86_64/updateinfo                                               | 1.0 MB  00:00:04     
(2/2): updates/20/x86_64/pkgtags                                                  | 1.0 MB  00:00:08     
Resolving Dependencies
--> Running transaction check
---> Package links.x86_64 1:2.6-6.fc20 will be installed
--> Processing Dependency: libgpm.so.2()(64bit) for package: 1:links-2.6-6.fc20.x86_64
--> Processing Dependency: libX11.so.6()(64bit) for package: 1:links-2.6-6.fc20.x86_64
--> Running transaction check
---> Package gpm-libs.x86_64 0:1.20.7-3.fc20 will be installed
---> Package libX11.x86_64 0:1.6.1-1.fc20 will be installed
--> Processing Dependency: libX11-common = 1.6.1-1.fc20 for package: libX11-1.6.1-1.fc20.x86_64
--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.6.1-1.fc20.x86_64
--> Running transaction check
---> Package libX11-common.noarch 0:1.6.1-1.fc20 will be installed
---> Package libxcb.x86_64 0:1.9.1-3.fc20 will be installed
--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.9.1-3.fc20.x86_64
--> Running transaction check
---> Package libXau.x86_64 0:1.0.8-2.fc20 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================
 Package                     Arch                 Version                     Repository            Size
=========================================================================================================
Installing:
 links                       x86_64               1:2.6-6.fc20                fedora               1.8 M
Installing for dependencies:
 gpm-libs                    x86_64               1.20.7-3.fc20               fedora                32 k
 libX11                      x86_64               1.6.1-1.fc20                fedora               597 k
 libX11-common               noarch               1.6.1-1.fc20                fedora               181 k
 libXau                      x86_64               1.0.8-2.fc20                fedora                29 k
 libxcb                      x86_64               1.9.1-3.fc20                fedora               167 k

Transaction Summary
=========================================================================================================
Install  1 Package (+5 Dependent packages)

Total download size: 2.8 M
Installed size: 6.6 M
Downloading packages:
(1/6): gpm-libs-1.20.7-3.fc20.x86_64.rpm                                          |  32 kB  00:00:10     
(2/6): libX11-1.6.1-1.fc20.x86_64.rpm                                             | 597 kB  00:00:08     
(3/6): links-2.6-6.fc20.x86_64.rpm                                                | 1.8 MB  00:00:01     
(4/6): libXau-1.0.8-2.fc20.x86_64.rpm                                             |  29 kB  00:00:05     
(5/6): libxcb-1.9.1-3.fc20.x86_64.rpm                                             | 167 kB  00:00:05     
(6/6): libX11-common-1.6.1-1.fc20.noarch.rpm                                      | 181 kB  00:00:11     
---------------------------------------------------------------------------------------------------------
Total                                                                    158 kB/s | 2.8 MB     00:17     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : gpm-libs-1.20.7-3.fc20.x86_64                                                         1/6 
  Installing : libXau-1.0.8-2.fc20.x86_64                                                            2/6 
  Installing : libxcb-1.9.1-3.fc20.x86_64                                                            3/6 
  Installing : libX11-common-1.6.1-1.fc20.noarch                                                     4/6 
  Installing : libX11-1.6.1-1.fc20.x86_64                                                            5/6 
  Installing : 1:links-2.6-6.fc20.x86_64                                                             6/6 
  Verifying  : libX11-common-1.6.1-1.fc20.noarch                                                     1/6 
  Verifying  : 1:links-2.6-6.fc20.x86_64                                                             2/6 
  Verifying  : libXau-1.0.8-2.fc20.x86_64                                                            3/6 
  Verifying  : gpm-libs-1.20.7-3.fc20.x86_64                                                         4/6 
  Verifying  : libxcb-1.9.1-3.fc20.x86_64                                                            5/6 
  Verifying  : libX11-1.6.1-1.fc20.x86_64                                                            6/6 

Installed:
  links.x86_64 1:2.6-6.fc20                                                                              

Dependency Installed:
  gpm-libs.x86_64 0:1.20.7-3.fc20   libX11.x86_64 0:1.6.1-1.fc20   libX11-common.noarch 0:1.6.1-1.fc20  
  libXau.x86_64 0:1.0.8-2.fc20      libxcb.x86_64 0:1.9.1-3.fc20  

Complete!