Ask Your Question
0

how to add extra static route in neutron (Havana)

asked 2014-07-15 03:25:24 -0600

frankingwh gravatar image

updated 2014-07-15 08:20:20 -0600

SamYaple gravatar image

I would like to add an extra static route in neutron in CLI. I did a search and it seems like i could use the following command

neutron router-update router1 --routes type=dict list=true destination=100.0.0.0/24,nexthop=172.24.4.23

The command seems to exe successfully and I can see the route in neutron router-list -c name -c routes. However, when I check with ip netns exec qrouter-22366760-ae5e-4588-ba71-e8244f5f8fd8 route -n, the static route does not appear in the routing table.

May I know if it is possible to add static route in neutron with CLI or API?

edit retag flag offensive close merge delete

Comments

did you fix the problem? I am also being perplexed by this problem.

chairwa gravatar imagechairwa ( 2014-07-28 09:27:16 -0600 )edit

4 answers

Sort by ยป oldest newest most voted
3

answered 2015-02-08 10:42:58 -0600

james-denton gravatar image

This was a bug in Havana that was fixed in Icehouse and beyond. To fix it, you had to add a root_helper directive in l3_agent.ini.

edit flag offensive delete link more

Comments

You know everything!

SamYaple gravatar imageSamYaple ( 2015-02-08 22:42:23 -0600 )edit

Hi James, I am with Octata version and getting a similar issue. In subnet i see additional routes but not reflected in routing table.

Narain gravatar imageNarain ( 2018-03-19 06:29:32 -0600 )edit
0

answered 2014-12-12 04:17:52 -0600

It may help. try with it.

neutron router-update ROUTER_UUID --router_rules type=dict list=true source=any,destination=any,action=permit source=100.0.0.0/24,destination=any,action=permit,nexthops=172.24.4.23

edit flag offensive delete link more

Comments

does this command work !!!

abhilash-goyal gravatar imageabhilash-goyal ( 2016-09-15 00:12:56 -0600 )edit
0

answered 2015-06-15 06:37:57 -0600

updated 2015-06-16 04:38:30 -0600

SamYaple gravatar image

how to add multiple neutron static routes in neutron?

e.g: Am adding first neutron route as

neutron router-update demo-router --routes type=dict list=true destination=199.1.1.0/24,nexthop=20.20.20.17

Same is getting reflected under neutron table

neutron router-list -c name -c routes
+-------------+-----------------------------------------------------------------+
| name        | routes                                                          |
+-------------+-----------------------------------------------------------------+
| demo-router | [{u'nexthop': u'20.20.20.17', u'destination': u'199.1.1.0/24'}] |
+-------------+-----------------------------------------------------------------+

If i want to add another route, the previously added route gets replaced by the newly added route. Tried many times, but no luck. Can we add more than one static route under neutron?

neutron router-update demo-router --routes type=dict list=true destination=10.0.10.0/24,nexthop=20.20.20.17
Updated router: demo-router
root@pop2-controller:/home/controller# neutron router-list -c name -c routes
+-------------+-----------------------------------------------------------------+
| name        | routes                                                          |
+-------------+-----------------------------------------------------------------+
| demo-router | [{u'nexthop': u'20.20.20.17', u'destination': u'10.0.10.0/24'}] |
+-------------+-----------------------------------------------------------------+

No route seen for 199.1.1.0/24 subnet? Whats the intended behaviour here?

TIA

edit flag offensive delete link more

Comments

Yes, you can. All entries should be separated by spaces. Example:

Neutron router-update <router> type=list dict=true destination=1.1.1,0/24,nexthop=192.168.1.1 destination=3.3.3.0/24,nexthop=192.168.1.2

Multiple routes can be added that way. The API currently overwrites all routes upon update.

james-denton gravatar imagejames-denton ( 2015-06-15 22:46:52 -0600 )edit

Is there a way to add routes based on source address ?

abhilash-goyal gravatar imageabhilash-goyal ( 2016-09-15 00:11:52 -0600 )edit
0

answered 2016-09-07 17:12:40 -0600

Saminder13 gravatar image

I also found this issue. However to fix this, you should have a route for 172.24.4.23 network with proto set to kernel in the router routing table. I was missing this entry, however by adding it using sudo ip netns exec qrouter-1faa6c68-7719-4a2c-b92c-4961cac27ada ip r add 38.73.3.120/29 protocol kernel scope link via 38.73.3.121 works for me. Otherwise, OS says network unreachable while adding the entry if route is not inserted by the kernel.

Before using this command, my routing table looked like this: 2016.09.07 (Wed) 12:48:40> sudo ip netns exec qrouter-1faa6c68-7719-4a2c-b92c-4961cac27ada ip r default via 38.73.3.65 dev qg-13de1071-e6
20.0.0.0/16 dev qr-c90021cd-09 proto kernel scope link src 20.0.0.1
30.0.0.0/16 dev qr-514a3707-55 proto kernel scope link src 30.0.0.1
38.73.3.64/28 dev qg-13de1071-e6 proto kernel scope link src 38.73.3.67
38.73.3.120/29 via 38.73.3.121 dev qr-b053ed0b-43

New routing table looks like : 2016.09.07 (Wed) 12:48:40> sudo ip netns exec qrouter-1faa6c68-7719-4a2c-b92c-4961cac27ada ip r
default via 38.73.3.65 dev qg-13de1071-e6
20.0.0.0/16 dev qr-c90021cd-09 proto kernel scope link src 20.0.0.1
30.0.0.0/16 dev qr-514a3707-55 proto kernel scope link src 30.0.0.1
38.73.3.64/28 dev qg-13de1071-e6 proto kernel scope link src 38.73.3.67
38.73.3.120/29 via 38.73.3.121 dev qr-b053ed0b-43 proto kernel scope link

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-07-15 03:25:24 -0600

Seen: 12,323 times

Last updated: Sep 07 '16