skip to Main Content

I’d like add a secondary IP address for ‘eth0’ from CentOS VM managed by Openstack. The result is: cannot ping another VM’s IP from secondary IP. Could you help?

Steps to reproduce:

  1. ip -f inet addr list

    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
    valid_lft forever preferred_lft forever
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet 172.22.42.220/24 brd 172.22.42.255 scope global noprefixroute dynamic eth0
    valid_lft 83609sec preferred_lft 83609sec
  2. ping -I 172.22.42.220 172.22.42.1 is OK
  3. add a secondary IP by :ip -f inet addr add 172.22.42.222/32 brd 172.22.42.255 dev eth0

    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
    valid_lft forever preferred_lft forever
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet 172.22.42.220/24 brd 172.22.42.255 scope global noprefixroute dynamic eth0
    valid_lft 83368sec preferred_lft 83368sec
    inet 172.22.42.222/32 brd 172.22.42.255 scope global eth0
    valid_lft forever preferred_lft forever
  4. ping -I 172.22.42.220 172.22.42.222 and ping -I 172.22.42.222 172.22.42.220 are OK (-I means source IP)
  5. ping -I 172.22.42.220 172.22.42.1 is OK but ping -I 172.22.42.222 172.22.42.1 fails

2

Answers


  1. you have to set the additional (multiple) ip address to the same port-id in openstack first.

    Here is an example:

    neutron port-update a5e93de7-927a-5402-b545-17f79538d3a6 --allowed_address_pairs list=true type=dict mac_address=ce:9e:5d:ad:6d:80,ip_address=10.101.11.5 ip_address=10.101.11.6
    

    then you can check with :

    neutron port-show a5e93de7-927a-5402-b545-17f79538d3a6
    
    Login or Signup to reply.
  2. so, if you are aware of your openstack server instance name , then you can find the port id with :

    openstack port list --server testserver01
    
    +--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+
    | ID                                   | Name | MAC Address       | Fixed IP Addresses                                                           | Status |
    +--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+
    |  a5e93de7-927a-5402-b545-17f79538d3a6|      | fa:16:3e:5d:73:24 | ip_address='10.10.0.1', subnet_id='89387a48-5c5e-4dd0-8e0a-2181c97ec19a' | ACTIVE |
    +--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+
    
    
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search