Ask Your Question
0

how to use large ip range in one interface in one instance

asked 2017-02-09 02:30:20 -0500

mting gravatar image

updated 2017-02-09 18:26:48 -0500

hello I want use a instance for network testing, it simulate 2000 client with different ip address. In real server , i could assign 2000 ip address in one eth, then the testing tool could use them. but with openstack, i just know i could set fixipaddress with port, then assign the port to instance. Is there smart way could do like that openstack assign a subnet to a port ,then i define the ip in that subnet to the interface in the instance by my self? thank you very much

My openstack network setting is below 1.there are 2 network card in compute, one for oam, one for traffic. 2.i am using provider network with linux bridge. Binding each network card as flat/vlan 3.network details

(openstack) network list
+--------------------------------------+-----------------+--------------------------------------+
| ID                                   | Name            | Subnets                              |
+--------------------------------------+-----------------+--------------------------------------+
| 933f4fdb-9c58-454f-ae09-9b79222e6aa0 | oam             | 975e3f5a-e426-435a-83fe-fba5e8d96313 |
| fc154913-a365-4477-af6b-66181a6d8b68 | traffic-vlan888 | 9f1823a6-32b2-42af-aead-58889bd33afa |
+--------------------------------------+-----------------+--------------------------------------+
(openstack) network show oam
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | UP                                   |
| availability_zone_hints   |                                      |
| availability_zones        | nova                                 |
| created_at                | 2017-02-08T14:16:46Z                 |
| description               |                                      |
| id                        | 933f4fdb-9c58-454f-ae09-9b79222e6aa0 |
| ipv4_address_scope        | None                                 |
| ipv6_address_scope        | None                                 |
| mtu                       | 1500                                 |
| name                      | oam                                  |
| port_security_enabled     | True                                 |
| project_id                | a981dc41fca74b0ea2b66ef0140fb789     |
| project_id                | a981dc41fca74b0ea2b66ef0140fb789     |
| provider:network_type     | flat                                 |
| provider:physical_network | oam                                  |
| provider:segmentation_id  | None                                 |
| revision_number           | 6                                    |
| router:external           | Internal                             |
| shared                    | True                                 |
| status                    | ACTIVE                               |
| subnets                   | 975e3f5a-e426-435a-83fe-fba5e8d96313 |
| tags                      | []                                   |
| updated_at                | 2017-02-08T15:05:35Z                 |
+---------------------------+--------------------------------------+
(openstack) network show traffic-vlan888
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | UP                                   |
| availability_zone_hints   |                                      |
| availability_zones        | nova                                 |
| created_at                | 2017-02-08T15:36:12Z                 |
| description               |                                      |
| id                        | fc154913-a365-4477-af6b-66181a6d8b68 |
| ipv4_address_scope        | None                                 |
| ipv6_address_scope        | None                                 |
| mtu                       | 1500                                 |
| name                      | traffic-vlan888                      |
| port_security_enabled     | True                                 |
| project_id                | a981dc41fca74b0ea2b66ef0140fb789     |
| project_id                | a981dc41fca74b0ea2b66ef0140fb789     |
| provider:network_type     | vlan                                 |
| provider:physical_network | traffic                              |
| provider:segmentation_id  | 888                                  |
| revision_number           | 5                                    |
| router:external           | Internal                             |
| shared                    | True                                 |
| status                    | ACTIVE                               |
| subnets                   | 9f1823a6-32b2-42af-aead-58889bd33afa |
| tags                      | []                                   |
| updated_at                | 2017-02-08T15:39:37Z                 |
+---------------------------+--------------------------------------+
(openstack)
edit retag flag offensive close merge delete

Comments

A Neutron port has a single IP address, not a range, but I believe you can just add IP addresses to the interfaces inside the instance. I.e. inside the instance: sudo ip a add 10.100.100.100/24 dev eth0 etc. (just tried it; works). You have to ensure there are no address overlaps with DHCP.

Bernd Bausch gravatar imageBernd Bausch ( 2017-02-09 18:32:45 -0500 )edit

hello Bernd thank you for updating. I found a workaround for it

mting gravatar imagemting ( 2017-02-10 00:37:57 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-02-10 05:10:43 -0500

mting gravatar image

Finally I use linux anyip as a workaround

below is the procedure

for example

test client ip range is 172.22.1.0/24 , instance port ip is 10.35.72.5

  1. assign 172.22.1.0/24 as anyip to lo, ip -4 route add local 172.22.1.0/24 dev lo
  2. add a route in upside router for pointing this ip range , ip route 172.22.1.0/24 10.35.72.5
  3. setting the allowed address pairs of the port with 172.22.1.0/24
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

Stats

Asked: 2017-02-09 02:30:20 -0500

Seen: 92 times

Last updated: Feb 10 '17