[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Handling predictive network interfaces 'sometimes'?




On 5/12/19 8:07 am, Noah Meyerhans wrote:
T2 instances are based on Xen and use the Xen netfront (vif) interface.
These interfaces aren't PCI devices, so udev can't generate a name based
on the PCI bus ID. Compare the 'udevadm info' output for a t2 with that
of a t3.  Because Debian doesn't enable the MAC address based naming
scheme, udev ends up leaving the kernel's interface name in place on t2.
Thanks for the info and the pointers on where to look
But a better approach would be
to update your firewall configuration to not hardcode a specific
interface name.  You probably can get what you want by identifying the
interface associated with your default route, which you can get reliably
by with "ip -o route show default"

Apparently Ansible has a variable I can use (ansible_default_ipv4.interface) which is set to "the interface of the default route", detected at runtime, and that is always going to be the interface I'm interested in here. It might not be suitable for the general case, but for these EC2 instances it should work.

Thanks Noah,

Paul


Reply to: