Configured Subnets:
-------------------
(neutron) subnet-list
--------------------------------------------------------------------------------------------------------+
id | name | cidr | allocation_pools |
--------------------------------------------------------------------------------------------------------+
7d3d86df-5974-463b-8a75-6080d9d4d374 | SUBNET1 | 10.10.10.0/24 | {"start": "10.10.10.2", "end": "10.10.10.254"} |
e8049198-da7c-4b41-af30-bfe31363e36c | SUBNET2 | 10.20.20.0/24 | {"start": "10.20.20.2", "end": "10.20.20.254"} |
18e237ca-d0a3-4faf-9d9e-2b8caeb58f3a | SUBNET4 | 10.40.40.0/24 | {"start": "10.40.40.2", "end": "10.40.40.254"} |
92bd28f8-5476-4d92-997f-2d5da5e2b70d | SUBNET3 | 10.30.30.0/24 | {"start": "10.30.30.2", "end": "10.30.30.254"} |
--------------------------------------------------------------------------------------------------------+
(neutron) subnet-show SUBNET2
----------------------------------------------------------------------------+
Field | Value |
----------------------------------------------------------------------------+
allocation_pools | {"start": "10.20.20.2", "end": "10.20.20.254"} |
cidr | 10.20.20.0/24 |
created_at | 2017-12-12T04:22:05 |
description | |
dns_nameservers | |
enable_dhcp | True |
gateway_ip | 10.20.20.1 |
host_routes | {"destination": "10.10.10.0/24", "nexthop": "10.20.20.5"} |
id | e8049198-da7c-4b41-af30-bfe31363e36c |
ip_version | 4 |
ipv6_address_mode | |
ipv6_ra_mode | |
name | SUBNET2 |
network_id | 817fc530-411a-406e-91de-4f06b9013b5f |
subnetpool_id | |
tenant_id | 6f5d2d2c15a241b7be98359b6b5130fc |
updated_at | 2017-12-12T04:36:09 |
----------------------------------------------------------------------------+
Checking the routes in VM for SUBNET2
VM2:
root@vm2:~# ifconfig
eth0 Link encap:Ethernet HWaddr fa:16:3e:f0:a0:e0
inet addr:10.20.20.3 Bcast:10.20.20.255 Mask:255.255.255.0
inet6 addr: fe80::f816:3eff:fef0:a0e0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12 errors:0 dropped:1 overruns:0 frame:0
TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2558 (2.5 KB) TX bytes:4574 (4.5 KB)
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:116 errors:0 dropped:0 overruns:0 frame:0
TX packets:116 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:10272 (10.2 KB) TX bytes:10272 (10.2 KB)
root@vm2:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.20.20.1 0.0.0.0 UG 0 0 0 eth0
10.20.20.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
root@vm2:~# dhclient eth0
RTNETLINK answers: File exists
root@vm2:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.20.20.1 0.0.0.0 UG 0 0 0 eth0
10.20.20.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
root@vm2:~#
Routes are not pushed to VMs after DHCP request from VM
==================================================================================
Checking the routes in cirros image
root@compute-0-1:~# nova boot --image cirros-0.3.4-x86_64-uec --flavor myhuge --nic port-id=33631c28-11ae-4e46-82ed-b269367cfa04 VM2 --security-groups sg-hostroute --availability-zone nova:compute-0-1.domain.tld
----------------------------------------------------------------------------------------------------+
Property | Value |
----------------------------------------------------------------------------------------------------+
OS-DCF:diskConfig | MANUAL |
OS-EXT-AZ:availability_zone | nova |
OS-EXT-SRV-ATTR:host | |
OS-EXT-SRV-ATTR:hostname | vm2 |
OS-EXT-SRV-ATTR:hypervisor_hostname | |
OS-EXT-SRV-ATTR:instance_name | instance-00000710 |
OS-EXT-SRV-ATTR:kernel_id | |
OS-EXT-SRV-ATTR:launch_index | 0 |
OS-EXT-SRV-ATTR:ramdisk_id | |
OS-EXT-SRV-ATTR:reservation_id | r-tbk1844e |
OS-EXT-SRV-ATTR:root_device_name | |
OS-EXT-SRV-ATTR:user_data | |
OS-EXT-STS:power_state | 0 |
OS-EXT-STS:task_state | scheduling |
OS-EXT-STS:vm_state | building |
OS-SRV-USG:launched_at | |
OS-SRV-USG:terminated_at | |
accessIPv4 | |
accessIPv6 | |
adminPass | 26RaDGMGxLme |
config_drive | |
created | 2017-12-12T05:40:41Z |
description | |
flavor | myhuge (1) |
hostId | |
host_status | |
id | a3cd2987-2365-4f51-811a-d518a0fa3cc5 |
image | cirros-0.3.4-x86_64-uec (6e6ee817-0256-408a-b09d-fba4d1aaa234) |
key_name | |
locked | False |
metadata | {} |
name | VM2 |
os-extended-volumes:volumes_attached | [] |
progress | 0 |
scheduler_hints | {} |
security_groups | sg-hostroute |
status | BUILD |
tenant_id | 6f5d2d2c15a241b7be98359b6b5130fc |
updated | 2017-12-12T05:40:41Z |
user_id | 5c3e508cfbf04adeba44629f49e2bcba |
----------------------------------------------------------------------------------------------------+
root@compute-0-1:~#
root@compute-0-1:~#
root@compute-0-1:~#
root@compute-0-1:~#
root@compute-0-1:~# clear
root@compute-0-1:~# sudo virsh list
Id Name State
----------------------------------------------------
1 cic-1_vm running
46 instance-000006f5 running
47 instance-000006f8 running
49 instance-00000707 running
50 instance-0000070d running
51 instance-00000710 running
root@compute-0-1:~# sudo virsh console 51
Connected to domain instance-00000710
Escape character is ^]
login as 'cirros' user. default password: 'cubswin'. use 'sudo' for root.
vm2 login: cirros
Password:
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether fa:16:3e:f0:a0:e0 brd ff:ff:ff:ff:ff:ff
inet 10.20.20.3/24 brd 10.20.20.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::f816:3eff:fef0:a0e0/64 scope link
valid_lft forever preferred_lft forever
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.20.20.1 0.0.0.0 UG 0 0 0 eth0
10.20.20.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
$ sudo /sbin/cirros-dhcpc up eth0
udhcpc (v1.23.2) started
Sending discover...
Sending select for 10.20.20.3...
Lease of 10.20.20.3 obtained, lease time 86400
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.20.20.1 0.0.0.0 UG 0 0 0 eth0
10.20.20.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
$ sudo ifconfig eth0 down
$ ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 18 bytes 1692 (1.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 18 bytes 1692 (1.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
$ sudo /sbin/cirros-dhcpc up eth0
udhcpc (v1.23.2) started
Sending discover...
Sending select for 10.20.20.3...
Lease of 10.20.20.3 obtained, lease time 86400
$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.20.20.3 netmask 255.255.255.0 broadcast 10.20.20.255
inet6 fe80::f816:3eff:fef0:a0e0 prefixlen 64 scopeid 0x20<link>
ether fa:16:3e:f0:a0:e0 txqueuelen 1000 (Ethernet)
RX packets 8 bytes 2284 (2.2 KiB)
RX errors 0 dropped 2 overruns 0 frame 0
TX packets 28 bytes 3496 (3.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 18 bytes 1692 (1.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 18 bytes 1692 (1.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.20.20.1 0.0.0.0 UG 0 0 0 eth0
10.20.20.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
rechecking the hostroutes configured in SUBNET2
root@compute-0-1:~# neutron
(neutron) subnet-show SUBNET2
----------------------------------------------------------------------------+
Field | Value |
----------------------------------------------------------------------------+
allocation_pools | {"start": "10.20.20.2", "end": "10.20.20.254"} |
cidr | 10.20.20.0/24 |
created_at | 2017-12-12T04:22:05 |
description | |
dns_nameservers | |
enable_dhcp | True |
gateway_ip | 10.20.20.1 |
host_routes | {"destination": "10.10.10.0/24", "nexthop": "10.20.20.5"} |
id | e8049198-da7c-4b41-af30-bfe31363e36c |
ip_version | 4 |
ipv6_address_mode | |
ipv6_ra_mode | |
name | SUBNET2 |
network_id | 817fc530-411a-406e-91de-4f06b9013b5f |
subnetpool_id | |
tenant_id | 6f5d2d2c15a241b7be98359b6b5130fc |
updated_at | 2017-12-12T04:36:09 |
----------------------------------------------------------------------------+