Thursday, October 09, 2014

Forwarding packet from br-int to br-ex on Neutron Node

[root@controller ~(keystone_admin)]# neutron router-list
+--------------------------------------+---------+-----------------------------------------------------------------------------+
| id                                   | name    | external_gateway_info                                                       |
+--------------------------------------+---------+-----------------------------------------------------------------------------+
| 30b921ba-869c-4026-9010-f6554a82e37e | router2 | {"network_id": "022905d0-cfeb-4d5b-ae51-37c93080e7ae", "enable_snat": true} |
| db10bdfd-f0c6-4c30-8a08-30ceb132a979 | router3 | {"network_id": "022905d0-cfeb-4d5b-ae51-37c93080e7ae", "enable_snat": true} |
+--------------------------------------+---------+-----------------------------------------------------------------------------+

1. [root@controller ~(keystone_admin)]# ip netns exec qrouter-db10bdfd-f0c6-4c30-8a08-30ceb132a979 ifconfig
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

qg-a9e0c15a-b6: flags=67  mtu 1500
        inet 192.168.1.154  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::f816:3eff:fe61:7982  prefixlen 64  scopeid 0x20
        ether fa:16:3e:61:79:82  txqueuelen 0  (Ethernet)
        RX packets 794857  bytes 1090221979 (1.0 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 459453  bytes 38942381 (37.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

qr-12b39034-b3: flags=67  mtu 1500
        inet 20.0.0.1  netmask 255.255.255.0  broadcast 20.0.0.255
        inet6 fe80::f816:3eff:feed:976b  prefixlen 64  scopeid 0x20
        ether fa:16:3e:ed:97:6b  txqueuelen 0  (Ethernet)
        RX packets 460529  bytes 39050698 (37.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 788075  bytes 1089807974 (1.0 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0




2. [root@controller ~(keystone_admin)]# ip netns exec qrouter-db10bdfd-f0c6-4c30-8a08-30ceb132a979 route -n


Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0     qg-a9e0c15a-b6
20.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0   qr-12b39034-b3
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 qg-a9e0c15a-b6



3. [root@controller ~(keystone_admin)]# ovs-vsctl show
ba7b93f5-f364-40ac-94ee-8c3266c14282
    Bridge br-tun
        Port "gre-c0a80089"
            Interface "gre-c0a80089"
                type: gre
                options: {in_key=flow, local_ip="192.168.0.127", out_key=flow, remote_ip="192.168.0.137"}
        Port br-tun
            Interface br-tun
                type: internal
        Port patch-int
            Interface patch-int
                type: patch
                options: {peer=patch-tun}
    Bridge br-ex
        Port br-ex
            Interface br-ex
                type: internal
        Port "qg-412ba0b5-e8"
            Interface "qg-412ba0b5-e8"
                type: internal
        Port "enp2s0"
            Interface "enp2s0"
        Port "qg-a9e0c15a-b6"
            Interface "qg-a9e0c15a-b6"
                type: internal
    Bridge br-int
        fail_mode: secure                                      
        Port br-int                                                   
            Interface br-int
                type: internal
        Port patch-tun
            Interface patch-tun
                type: patch
                options: {peer=patch-int}
        Port "qr-635a3c01-f9"
            tag: 2
            Interface "qr-635a3c01-f9"
                type: internal
        Port "tap0e08184f-89"
            tag: 1
            Interface "tap0e08184f-89"
                type: internal
        Port "tapa8c5a401-51"
            tag: 2
            Interface "tapa8c5a401-51"
                type: internal
        Port "qr-12b39034-b3"
            tag: 1
            Interface "qr-12b39034-b3"
                type: internal
    ovs_version: "2.0.0"