Skip to content

Instantly share code, notes, and snippets.

@Cauterite
Last active May 14, 2017 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cauterite/ec8605a9282cf90fe225c315db8be4d5 to your computer and use it in GitHub Desktop.
Save Cauterite/ec8605a9282cf90fe225c315db8be4d5 to your computer and use it in GitHub Desktop.
--------------------------------------------------------------------------------
my ASUS P5Q-Premium, running Debian 8.8, has four ethernet ports. i only need to
use one at a time.
the labels "eth0", "eth1", etc. are assigned to these ports in seemingly random
order, and whether the numbering starts at 0 or 1 seems to be determined by the
presence of some other random PCI device present on the board, so it's hard to
know which eth# you're plugging the cable into.
but i want to get the same MAC address no matter which eth# i'm using, so that i
can add a static DHCP mapping in my router for NAT purposes.
4 NICS -> 1 MAC -> 1 IP
so i did this:
> apt-get install ifenslave
> nano /etc/network/interfaces
and added these lines to "interfaces":
allow-hotplug eth0
allow-hotplug eth1
allow-hotplug eth2
allow-hotplug eth3
allow-hotplug eth4
auto bond0
iface bond0 inet dhcp
bond-slaves eth0 eth1 eth2 eth3 eth4
bond-mode broadcast
and rebooted.
now any devices present from "eth0" to "eth4" are essentially treated as the
same NIC. they have the same MAC address and packets are broadcast across all
of them.
--------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment