Ask Your Question
1

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 192.168.0.0/21 the instance address is 192.168.4.28. 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 192.168.4.29 netmask 255.255.248.0 gateway 192.168.0.1

Ifconfig command shows this new virtual interface.The problem I can't ping this address using a machine in the 192.168.0.0/21 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

Comments

You can edit your original question, there's no need to create a new thread (https://ask.openstack.org/en/question...).

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

2 answers

Sort by ยป oldest newest most voted
1

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 172.17.2.9 from 172.17.2.12, 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 172.17.2.12
PING 172.17.2.12 (172.17.2.12) from 172.17.2.9 eth1: 56(84) bytes of data.
64 bytes from 172.17.2.12: icmp_seq=1 ttl=64 time=0.734 ms
64 bytes from 172.17.2.12: icmp_seq=2 ttl=64 time=0.429 ms
64 bytes from 172.17.2.12: icmp_seq=3 ttl=64 time=0.411 ms
edit flag offensive delete link more
0

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

Stats

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

Seen: 125 times

Last updated: Aug 28 '18