Ask Your Question

Configuring a second virtual network interface on an instance

asked 2018-08-28 06:40:34 -0500

amirdhaoui gravatar image

I launched an instance attached to the public network. the public network address is the instance address is I can ping and reach internet using this address. I want to add another IP address to the same interface so I added this config :

auto ens3:1 iface ens3:1 inet static address netmask gateway

Ifconfig command shows this new virtual interface.The problem I can't ping this address using a machine in the network.

I did the same thing using a physical machine and it works. What is different for a VM running on OpenStack ? Thanks

edit retag flag offensive close merge delete


You can edit your original question, there's no need to create a new thread (

eblock gravatar imageeblock ( 2018-08-28 07:23:51 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2018-08-28 07:43:06 -0500

eblock gravatar image

You could be facing martians, try this:

test:~ # echo 1 > /proc/sys/net/ipv4/conf/all/log_martians 
test:~ # tail -F /var/log/messages | grep martian &
test:~ # ping -I <INTERFACE> <IP_ADDR>

If you see something like this

test kernel: [1733692.659800] IPv4: martian source from, on dev eth1

allow the reverse path even if it's not the same interface (mode 2, see this for details):

test:~ # echo 2 > /proc/sys/net/ipv4/conf/eth0/rp_filter
test:~ # echo 2 > /proc/sys/net/ipv4/conf/eth1/rp_filter

Now the ping works:

test:~ # ping -I eth1
PING ( from eth1: 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.734 ms
64 bytes from icmp_seq=2 ttl=64 time=0.429 ms
64 bytes from icmp_seq=3 ttl=64 time=0.411 ms
edit flag offensive delete link more

answered 2018-08-28 07:29:13 -0500

Vinoth gravatar image

From the above details, I understand that you have configured two Gateways in here. Only one interface should have the Gateway configured and set to default.

So remove the gateway of ens3:1 interface and try accessing the internet.

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


Asked: 2018-08-28 06:40:34 -0500

Seen: 125 times

Last updated: Aug 28 '18