# Is it possible to have both dhcp AND static ip on same NIC?

## vespaman

On my stationary computer, I have set-up eth0 like this;

config_eth0=(

        "192.168.1.48"

        "10.1.10.101/24"

        "10.1.10.102/24"

        "10.1.10.103/24"

        "10.1.10.104/24"

        "10.1.10.105/24"

        "10.1.10.106/24"

        "10.1.10.107/24"

        "10.1.10.108/24"

        "10.1.10.109/24"

        "10.1.10.110/24"

)

I use all the "extra addresses" for software development.

Now, I'd like the same on my laptop, but with the first address being retrieved by dhcp. I tried

config_eth0=(

        "dhcp"

        "10.1.10.101/24"

        "10.1.10.102/24"

        "10.1.10.103/24"

        "10.1.10.104/24"

        "10.1.10.105/24"

        "10.1.10.106/24"

        "10.1.10.107/24"

        "10.1.10.108/24"

        "10.1.10.109/24"

        "10.1.10.110/24"

)

.. but this does not work, as the extra addresses are removed upon starting eth0.

Can this be done?

----------

## UberLord

Depends on the dhcp client used.

dhcpcd-4.x and better should not remove statically assigned addresses.

----------

## vespaman

Well, I can't really tell by invoking dhcpcd (can't find any version info), but at least it is net-misc/dhcpcd 5.0.6 that is installed.

The box is a fresh ~arch installation.

It may be the net.eth startup script that removes these additional static ip's, no?

----------

## UberLord

It shouldn't after you've run dhcp

----------

## vespaman

And now (at home) it does not. 

Could there be something about the set-up of the dhcp servers or routes? Or perhaps because, at work, we have a windows server doing the dhcp management. At home I have linux.

Will test more tomorrow, thanks!

 - Micael

----------

