How to force linux interface to work with specific network card

debian-wheezyhardwarenetworking

It's my first time expercience with multiples networks cards.
I have two networks cards on my debian server.

  • card 1: on on a public network,
  • card 2 : on private network

I have edit my /etc/network/interface file with :

  • eth0 : use dhcp (public network)
  • eth1 : use static IP (private network)
    my interface are up using allow-hotplug

But in fact, eth0 is automaticly attached to the card2 and eth1 to the card1.

I have changed my interface file ( invert eth0 and eth1 conf) but it's not work, i think the cards are randomly attached to interfaces.

How can i configure my cards/interface to force eth0 use only card1 and eth1 use only card2 ?

Thanks for your help.

Sorry for my lack of english.

Best Answer

You might want to configure udev mappings for your network cards based on their MAC addresses.

Good explanations are provided at debianhelp on udev

Related Topic