[Openstack] [neutron] [ML2] VM can't connect to the Internet

Kai Liu ribozyme847 at gmail.com
Mon Oct 14 07:29:44 UTC 2013


Hi all,

I installed neutron + ML2 with the latest version of devstack on Ubuntu 12.04.3 LTS.

After installation I launched an instance of cirros image.  It seems that the vm is assigned a 
fixed ip correctly. (see below)

/=== network info ===/
/if-info: lo,up,127.0.0.1,8,::1/
/if-info: eth0,up,10.0.0.3,24,fe80::f816:3eff:fe45:4077/
/ip-route:default via 10.0.0.1 dev eth0/
/ip-route:10.0.0.0/24 dev eth0  src 10.0.0.3/



The problem is I can ping 10.0.0.1~10.0.0.3 and 192.168.8.170, but I can't ping the other 
IPs in 192.168.8.0/24, including public gateway(192.168.8.254).

Did I missed any settings in localrc?

I'm also confused why br-ex was assigned the public gateway IP, I thought it would be the 
HOST_IP.

I found these codes in lib/neutron:

/        EXT_GW_IP=$(neutron subnet-create --ip_version 4 
${Q_FLOATING_ALLOCATION_POOL:+--allocation-pool $Q_FLOATING_ALLOCATION_POOL} --
gateway $PUBLIC_NETWORK_GATEWAY --name $PUBLIC_SUBNET_NAME $EXT_NET_ID 
$FLOATING_RANGE -- --enable_dhcp=False | grep 'gateway_ip' | get_field 2)/
/        neutron router-gateway-set $ROUTER_ID $EXT_NET_ID/

/        if is_service_enabled q-l3; then/
/            # logic is specific to using the l3-agent for l3/
/            if is_neutron_ovs_base_plugin && [[ "$Q_USE_NAMESPACE" = "True" ]]; then/
/                CIDR_LEN=${FLOATING_RANGE#*/}/
/                sudo ip addr add $EXT_GW_IP/$CIDR_LEN dev $PUBLIC_BRIDGE/
/                sudo ip link set $PUBLIC_BRIDGE up/
/                ROUTER_GW_IP=`neutron port-list -c fixed_ips -c device_owner | grep 
router_gateway | awk -F '"' '{ print $8; }'`/
/                sudo route add -net $FIXED_RANGE gw $ROUTER_GW_IP/
/            fi/
/            if [[ "$Q_USE_NAMESPACE" == "False" ]]; then/
/                # Explicitly set router id in l3 agent configuration/
/                iniset $Q_L3_CONF_FILE DEFAULT router_id $ROUTER_ID/
/            fi/
/        fi/

Can anyone explain this?

Any help will be appreciated.

Here is my localrc:

/stack at ubuntu:~/devstack$ cat localrc/
/DATABASE_PASSWORD=admin/
/RABBIT_PASSWORD=admin/
/SERVICE_TOKEN=admin/
/SERVICE_PASSWORD=admin/
/ADMIN_PASSWORD=admin/

/LOGFILE=stack.sh.log/

/HOST_IP=192.168.8.159/
/FLOATING_RANGE=192.168.8.0/24/
/PUBLIC_NETWORK_GATEWAY=192.168.8.254/
/Q_FLOATING_ALLOCATION_POOL=start=192.168.8.170,end=192.168.8.190/

/disable_service n-net/
/enable_service q-svc/
/enable_service q-agt/
/enable_service q-dhcp/
/enable_service q-l3/
/enable_service q-meta/
/enable_service neutron/
/# Optional, to enable tempest configuration as part of devstack/
/enable_service tempest/

/Q_PLUGIN=ml2/
/ENABLE_TENANT_TUNNELS=True/

And some information after installation:

/stack at ubuntu:~/devstack$ ifconfig/
/br-ex     Link encap:Ethernet  HWaddr 22:a7:ec:de:66:43/
/          inet addr:192.168.8.254  Bcast:0.0.0.0  Mask:255.255.255.0/
/          inet6 addr: fe80::20a7:ecff:fede:6643/64 Scope:Link/
/          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1/
/          RX packets:6 errors:0 dropped:0 overruns:0 frame:0/
/          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0/
/          collisions:0 txqueuelen:0/
/          RX bytes:468 (468.0 B)  TX bytes:468 (468.0 B)/

/eth0      Link encap:Ethernet  HWaddr e8:39:35:a6:96:c8/
/          inet addr:192.168.8.159  Bcast:192.168.8.255  Mask:255.255.255.0/
/          inet6 addr: fe80::ea39:35ff:fea6:96c8/64 Scope:Link/
/          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1/
/          RX packets:39477 errors:0 dropped:0 overruns:40 frame:0/
/          TX packets:18955 errors:0 dropped:0 overruns:0 carrier:0/
/          collisions:0 txqueuelen:1000 /
/          RX bytes:6264879 (6.2 MB)  TX bytes:3340504 (3.3 MB)/

/lo        Link encap:Local Loopback/
/          inet addr:127.0.0.1  Mask:255.0.0.0/
/          inet6 addr: ::1/128 Scope:Host/
/          UP LOOPBACK RUNNING  MTU:65536  Metric:1/
/          RX packets:58735 errors:0 dropped:0 overruns:0 frame:0/
/          TX packets:58735 errors:0 dropped:0 overruns:0 carrier:0/
/          collisions:0 txqueuelen:0/
/          RX bytes:46486407 (46.4 MB)  TX bytes:46486407 (46.4 MB)/

/virbr0    Link encap:Ethernet  HWaddr 52:ca:c8:c7:3e:a3/
/          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0/
/          UP BROADCAST MULTICAST  MTU:1500  Metric:1/
/          RX packets:0 errors:0 dropped:0 overruns:0 frame:0/
/          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0/
/          collisions:0 txqueuelen:0/
/          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)/

/stack at ubuntu:~/devstack$ sudo ovs-vsctl show/
/3e6acae9-5ab9-475c-81b5-8dc79de86920/
/    Bridge br-tun/
/        Port br-tun/
/            Interface br-tun/
/                type: internal/
/        Port patch-int/
/            Interface patch-int/
/                type: patch/
/                options: {peer=patch-tun}/
/    Bridge br-ex/
/        Port "qg-5922ebfd-0d"/
/            Interface "qg-5922ebfd-0d"/
/                type: internal/
/        Port br-ex/
/            Interface br-ex/
/                type: internal/
/    Bridge br-int/
/        Port br-int/
/            Interface br-int/
/                type: internal/
/        Port "qr-5d5ae022-05"/
/            tag: 1/
/            Interface "qr-5d5ae022-05"/
/                type: internal/
/        Port "tap0c96ec44-33"/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20131014/d25866c4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: topology.png
Type: image/png
Size: 12630 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20131014/d25866c4/attachment.png>


More information about the Openstack mailing list