[Openstack] Second NIC down in cirros image (Liberty)

Neil Jerram neil at tigera.io
Mon Jul 18 09:51:46 UTC 2016


Hi Daniel,

It's because /etc/network/interfaces on CirrOS only starts eth0.

To make a customized CirrOS that does DHCP on eth1 as well as eth0, you can:

- add these lines to /etc/network/interfaces:

auto eth1
iface eth1 inet dhcp

- snapshot the instance after making that change

- thereafter, boot using the snapshot instead of using the upstream CirrOS
image.

However, I think you will then see another problem, which is that a CirrOS
instance will have two default routes, in an unpredictable order.  Whereas
probably what you really want is just one default route through one of the
NICs, and specific routes through the other NIC.  I found that I could
prevent CirrOS from setting up a default route through one of the NICs by
hacking /sbin/cirros-dhcpc: in the renew_bound function, immediately before
the line

        if [ -n "$router" ] ; then

I inserted:

        case $ip in

                11.* )
                       return
                        ;;

        esac

In my case, the NIC for which I did _not_ want a default route was getting
an IP address beginning with 11., and this change prevented CirrOS from
programming a default route through that NIC.  Obviously you'll probably
need to adjust the detail for your setup.

Hope this is helpful,

    Neil



On Mon, Jul 18, 2016 at 7:39 AM Daniel Ruiz Molina <daniel.ruiz at caos.uab.es>
wrote:

> Hello,
>
> After deploying an instance with private and public network, eth0
> receives DHCP offer with private IP but eth1 doesn't receive DHCP offer
> with public IP. However, if I run an VNC console to the instance and,
> then, execute "sudo /sbin/cirros-dhcpd eth1 up", eth1 receives public IP
> (the same IP address that network server shows in dashboard).
>
> Why eth1 starts "down"?
>
> Thanks.
>
> _______________________________________________
> Mailing list:
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> Post to     : openstack at lists.openstack.org
> Unsubscribe :
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20160718/6bef57f0/attachment.html>


More information about the Openstack mailing list