I've added a second nic, in order to connect to another VPC network.
I've read this https://cloud.google.com/vpc/docs/create-use-multiple-interfaces ...setup routing, firewall.
Everything was working good, but after some hours, the second nic lost its Internal IP address.
Tried service networking restart
ifdown
ifup
but no luck.
Does anyone have any ideas about what could have happened?
Or how can I prevent this to happen?
I'm answering my own question in case it is useful for someone...
On my tests, I did chattr +i /etc/resolv.conf
to keep the /etc/resolv.conf
file static, and by doing that, the dhclient script failed to update the file which made the DHCP renew fail.
Bottom line, do not do chattr +i /etc/resolv.conf
on multi-nic VMs on GCP since it would end up with a failing DHCP lease.
This situation is a limiting one since you can't add more interfaces or remove them "You cannot add network interfaces to, or remove them from, an existing VM." According to the text you quote, I suggest you recreate the instance, in case you have sensitive information in it, The option is to create a snapshot and then mount it on the new instance.
limitations VM instances with multi-interfaces Snapshot Instance creation from a Snapshot
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.